Skip to content

Commit

Permalink
hairparticle fix: simulation should happen even when culled by distan…
Browse files Browse the repository at this point in the history
…ce, but forces can be skipped
  • Loading branch information
turanszkij committed Feb 19, 2025
1 parent df0d0fc commit 9d88627
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions WickedEngine/shaders/hairparticle_simulateCS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void main(uint3 DTid : SV_DispatchThreadID, uint3 Gid : SV_GroupID, uint groupIn
const half3 boneAxis = target;
const half boneLength = len;

for (uint segmentID = 0; !distance_culled && (segmentID < xHairSegmentCount); ++segmentID)
for (uint segmentID = 0; segmentID < xHairSegmentCount; ++segmentID)
{
// Identifies the hair strand segment particle:
const uint particleID = strandID + segmentID;
Expand All @@ -208,7 +208,7 @@ void main(uint3 DTid : SV_DispatchThreadID, uint3 Gid : SV_GroupID, uint groupIn
//draw_sphere(tail_next, len);

// Apply every force and collider:
for (uint i = forces().first_item(); i < forces().end_item(); ++i)
for (uint i = forces().first_item(); !distance_culled && (i < forces().end_item()); ++i)
{
ShaderEntity entity = load_entity(i);

Expand Down

0 comments on commit 9d88627

Please sign in to comment.