Skip to content

Commit

Permalink
[VFX] Fix SpawnIndex attribute when using instancing
Browse files Browse the repository at this point in the history
We are storing the wrong value for SpawnIndex attribute during Init compute, when processing several instances at the same time.
We are currently using the batch thread index, instead of per instance thread index.
The fix is very simple, just replacing one with the other when storing the value.
  • Loading branch information
gabrieldelacruz authored and Evergreen committed Jul 1, 2024
1 parent 206c513 commit f6518e1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void CSMain(uint3 groupId : SV_GroupID,
attributes.seed = WangHash(particleIndex ^ systemSeed);
#endif
#if VFX_USE_SPAWNINDEX_CURRENT
attributes.spawnIndex = id;
attributes.spawnIndex = index;
#endif

#if VFX_USE_SPAWNER_FROM_GPU && VFX_USE_SPAWNCOUNT_SOURCE
Expand Down

0 comments on commit f6518e1

Please sign in to comment.