GarageGames / Torque3D

MIT Licensed Open Source version of Torque 3D from GarageGames
http://torque3d.org
MIT License
3.35k stars 1.2k forks source link

scatterSky mStaticRefreshFreq = 8; #2222

Open ghost opened 6 years ago

ghost commented 6 years ago

I just noticed that the scatterSky staticRefreshFrequ is not set to 250 like all the other settings like here https://github.com/GarageGames/Torque3D/blob/5428dcff3de520768212b27ff4cb99bcfc2d711a/Engine/source/environment/sun.cpp#L69 This leads to bad performance if someone creates a new level since it will default to 8ms then. Is there any reason behind this or was this just missed to set properly?

Azaezel commented 6 years ago

Yes. scattersky is not only procedural, but meant for use with time of day. AKA moving. Hence defaulting to a lower delay in refreshing shadows it casts.

ghost commented 6 years ago

Thats the same with the sun also procedural daytimes are probably the rarer case so it should be set higher by default and when someone needs it smoother he can set it lower again.

I'm asking because I had someone reporting very bad FPS when he made a new level, since all shadows would default to 8ms which gave a significant drop in performance, so he got confused why his levels run so bad and mine much better.

I also did some experiments with procedural daytimes and you will more have the problem of shadow pixels flipping, since they cannot move as smooth as the shadow resolution and if it is low a pixel would just flip.

From other games I observed how they do it, I noticed in Skyrim they have procedural daytimes, but it will not move smooth, but in ticks so every few seconds or so the sun would move a bit, the shadows will adapt and then it will stand still for another some seconds.