diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-05-29 13:11:03 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-05-30 13:25:20 +0300 |
commit | 328f8dc21c0e8a7e3da14f6578fb84a811f80b89 (patch) | |
tree | 6d7cbe0cb0bc0fee859bff5c73f98dbf9109b6f8 /source/blender/draw/intern/draw_common.h | |
parent | 2faef3473c061e34a03668905c8d81672a72dd38 (diff) |
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.
Diffstat (limited to 'source/blender/draw/intern/draw_common.h')
-rw-r--r-- | source/blender/draw/intern/draw_common.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_common.h b/source/blender/draw/intern/draw_common.h index 11cff02d6c9..49a1ae42198 100644 --- a/source/blender/draw/intern/draw_common.h +++ b/source/blender/draw/intern/draw_common.h @@ -29,8 +29,12 @@ struct DRWPass; struct DRWShadingGroup; struct Gwn_Batch; +struct GPUMaterial; struct Object; struct ViewLayer; +struct ModifierData; +struct ParticleSystem; +struct PTCacheEdit; /* Used as ubo but colors can be directly referenced as well */ /* Keep in sync with: common_globals_lib.glsl (globalsBlock) */ @@ -145,6 +149,22 @@ void DRW_shgroup_armature_object(struct Object *ob, struct ViewLayer *view_layer void DRW_shgroup_armature_pose(struct Object *ob, struct DRWArmaturePasses passes); void DRW_shgroup_armature_edit(struct Object *ob, struct DRWArmaturePasses passes); +/* draw_hair.c */ + +/* This creates a shading group with display hairs. + * The draw call is already added by this function, just add additional uniforms. */ +struct DRWShadingGroup *DRW_shgroup_hair_create( + struct Object *object, struct ParticleSystem *psys, struct ModifierData *md, + struct DRWPass *hair_pass, struct DRWPass *tf_pass, + struct GPUShader *shader); + +struct DRWShadingGroup *DRW_shgroup_material_hair_create( + struct Object *object, struct ParticleSystem *psys, struct ModifierData *md, + struct DRWPass *hair_pass, struct DRWPass *tf_pass, + struct GPUMaterial *material); + +void DRW_hair_free(void); + /* pose_mode.c */ bool DRW_pose_mode_armature( struct Object *ob, struct Object *active_ob); |