-
-
Notifications
You must be signed in to change notification settings - Fork 22k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decrease shader TIME
rollover to 30 seconds on mobile platforms
#59990
base: master
Are you sure you want to change the base?
Decrease shader TIME
rollover to 30 seconds on mobile platforms
#59990
Conversation
de00b97
to
bf0c941
Compare
doc/classes/ProjectSettings.xml
Outdated
@@ -1756,6 +1756,10 @@ | |||
<member name="rendering/limits/spatial_indexer/update_iterations_per_frame" type="int" setter="" getter="" default="10"> | |||
</member> | |||
<member name="rendering/limits/time/time_rollover_secs" type="float" setter="" getter="" default="3600"> | |||
When the [code]TIME[/code] shader built-in variable is incremented, it will roll over to [code]0.0[/code] when the value specified in [member rendering/limits/time/time_rollover_secs] is exceeded (in seconds). Since large floating-point values are less precise than small floating-point values, this should be set as low as possible to maximize the precision of the [code]TIME[/code] built-in variable in shaders. However, if this is set too low, shader animations may appear to restart from the beginning while the project is running. | |||
</member> | |||
<member name="rendering/limits/time/time_rollover_secs.mobile" type="int" setter="" getter="" default="30"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property hint doesn't seem to apply to the override, it's typed as int
(and likely doesn't have a range slider).
Also, why 30 seconds specifically? That sounds really low.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, why 30 seconds specifically? That sounds really low.
@clayjohn recommended to use 30 instead of 60, as 16-bit floating point precision gets low very quickly. If the rollover time was 60, the worst precision you'd get would be 0.03
, and this is already too imprecise for many shader effects: https://en.wikipedia.org/wiki/Half-precision_floating-point_format#Precision_limitations
In comparison, this is not nearly as much of an issue with 32-bit floats.
In general, this looks good. Before merging we should double check what the behaviour on the vulkan-mobile backend is (e.g. does it default to 16p or 32p floats) |
#52500 wasn't merged, so it might still be defaulting to 32-bit floats right now. |
This avoids precision issues that became obvious when exporting a project to a mobile platform. Shader animations will have to loop over 30 seconds to avoid visual discrepancies when `TIME` is reset back to 0.
bf0c941
to
20f1c51
Compare
Some notes:
|
This avoids precision issues that became obvious when exporting a project to a mobile platform.
Shader animations will have to loop over 30 seconds to avoid visual discrepancies when
TIME
is reset back to 0.