DRW: Add new GPU hair system.

This new system use transform feedback to compute subdivided hair points
position. For now no smoothing is done between input points.

This new system decouple the strands data (uv, mcol) with the points
position, requiring less update work if only simulation is running.

In the future, we can have compute shader do the work of the feedback
transform pass since it's really what it's meant to. Also we could generate
the child particles during this pass, releasing some CPU time.

draw_hair.c has been created to handle all of the Shading group creations
as well as subdivision shaders.

We store one final batch per settings combination because multiple viewport
or render could use the same particle system with a different subdivision
count or hair shape type.
This commit is contained in:
2018-05-29 12:11:03 +02:00
parent 2faef3473c
commit 328f8dc21c
9 changed files with 1177 additions and 23 deletions

View File

@@ -871,6 +871,7 @@ DRWShadingGroup *DRW_shgroup_empty_tri_batch_create(struct GPUShader *shader, DR
DRWShadingGroup *DRW_shgroup_transform_feedback_create(struct GPUShader *shader, DRWPass *pass, Gwn_VertBuf *tf_target)
{
BLI_assert(tf_target != NULL);
DRWShadingGroup *shgroup = drw_shgroup_create_ex(shader, pass);
shgroup->type = DRW_SHG_FEEDBACK_TRANSFORM;