branchrust_reboot/main/animalfootsteps_optimscancel
5 Commits over 0 Days - Infinitycph!
Well actually lets drop the sounds from missed rays because that meant all the shit at 0,0,0 would be audible now
Fixed missed rays spawning the footstep sounds at 0,0,0 🙃
Animal footsteps raycast optims:
- On dry terrain, we read the terrain splat map instead of raycasting, one ray every 2 meters to check the animal is still on terrain
- If not on terrain (rocks, base, water) we just do one ray instead of 4
- If the animal is in water, we still play the effect past the audible range to make sure you can see the water splash effects
5 wolves running around on grass, 80% less raycasts
~0.115 -> ~0.08 ms
Skip footstep effect spawning and only keep the sound if they're fully invisible
It cuts all the effect spawning on grass for all animals
Wolf footstep playing in editor: ~0.15ms -> ~0.11ms
(this is not applied if music is enabled because aggressive animals footstep effects increase music intensity when nearby)
Fixed all wild animals in network range casting rays for their footsteps effects regardless of distance (if occlusion culling disabled)
We now match the footstep sound def max hearing distance before casting the ray (around 50 meters)
Was spending 0.5ms and 1.2KB every frame for 4 animals