-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 #91380
base: master
Are you sure you want to change the base?
Add double precision support for World Triplanar Mapping #91380
Conversation
1494ab2
to
422f514
Compare
The center which is the triplanar material is correct in both far and near. Screen.Recording.2024-04-30.at.3.47.50.PM.mov |
tested working here, thank you |
25e78bf
to
ae60904
Compare
Resolved a conflict in |
fe5a9d0
to
aa45100
Compare
Updated to 4.3-beta2. |
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. Co-Authored-By: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Braz?= <brazjoaopedro@ymail.com>
aa45100
to
a9d22cd
Compare
Updated to master. Had a code conflict in servers. |
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.
I'm not so sure about this PR. Its seems way too hacky to me. It is making huge changes in our shader compiler and internal shader to support something in the standard material.
Also, It looks like the new hint isn't even used in the StandardMaterial3D? So won't it remain broken for everyone?
It also relies on users manually passing in another matrix as a uniform and then secretly inserting that matrix into the backend code.
I think its worthwhile to see if we can improve this behaviour with a much simpler approach
ALso keep in mind our best practices https://docs.godotengine.org/en/latest/contributing/development/best_practices_for_engine_contributors.html#prefer-local-solutions particularly "Prefer local solutions".
Will need a rethink then, was trying to salvage some older prs |
I am not able to fix this at this moment, but the pr is still wanted and is salvageable. |
I don't think I can salvage this pull request but it is still wanted. |
Salvages #75577
The conflicts are mostly on these lines in the shader.
Use https://github.com/V-Sekai/godot-double-precision-test
Bugsquad edit: