-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Add double precision support for World Triplanar Mapping #75577
Add double precision support for World Triplanar Mapping #75577
Conversation
e7d986e
to
6963388
Compare
(forgot to --doctool, sorry about that) |
6963388
to
27075ab
Compare
Would you like to change the existed |
That's actually a great idea! |
27075ab
to
1d52989
Compare
I think I ran --doctool with a double precision build 😒 |
1d52989
to
7f2f145
Compare
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.
Tested locally, it mostly works as expected. World triplanar now works correctly on still objects (even if the camera moves), but moving the object when far away from the world origin will have visible snapping in the final UV.
Testing project: test_triplanar_double.zip
All videos below taken at X = 5,000,000. The object uses a StandardMaterial3D and is moved using a script.
master
, single precision
single_world_triplanar.mp4
master
, double precision
double_master_world_triplanar.mp4
This PR, double precision
double_pr_world_triplanar.mp4
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 pull request is a good idea but needs a rebase. Calinou tested on the last version.
7f2f145
to
2d281d6
Compare
Rebased. |
There are some rebases needed, I'll try to see if anything's blocking this for 4.3. |
This commit adds emulated doubles support for the World UV Triplanar Mapping. It also adds some QoL features to both ease the "integration" with the double precision pipeline and also to allow greater flexibility when dealing with Triplanar UVs. Features: - New mat4 TRIPLANAR_MATRIX vertex-only property (the same as MODEL_MATRIX by default). - New "hint_triplanar_mat" hint for mat4 uniforms, which allow users to specify a custom TRIPLANAR_MATRIX. Naturally, only a single instance of the hint is allowed per shader. - New vec3 TRIPLANAR_POSITION vertex-only property, which holds the VERTEX transformed by the TRIPLANAR_MATRIX (With emulated doubles, if applicable). - Updated Standard 3D Material to make use of the above features. - Updated VisualShader to include the TRIPLANAR_MATRIX and TRIPLANAR_POSITION as valid Inputs. - Added a "hint_triplanar_enabled" toggle to the VisualShaderNodeTransformParameter to allow the new "hint_triplanar_mat" hint to be set. Note: The shader related changes were applied to all renderers (Forward+, Mobile and Compatibility). Note²: Given the lack of emulated doubles support for the Compatibility renderer, only the single precision path was implemented.
2d281d6
to
9b69463
Compare
Superseded by: #91380 |
Superseded by #91380. Thanks for the contribution nonetheless! |
Description
This PR adds emulated doubles support for the World UV Triplanar Mapping. It also adds some QoL features to both ease the "integration" with the double precision pipeline and also to allow greater flexibility when dealing with Triplanar UVs.
Features:
Below is a Demo which was tailored to showcase these additions.
Video:
2023-04-01_17-57-04.mp4
Project: TestDoubles.zip
Note: The shader related changes were applied to all renderers (Forward+, Mobile and Compatibility).
Note²: Given the lack of emulated doubles support for the Compatibility renderer, only the single precision path was implemented.
Note³: Related to #75462, where the need for this was brought up by @Zylann (specifically the support for custom matrices when computing the TRIPLANAR_POSITION).