-
-
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
3D Fragment shader COLOR seem to be in 8bits #30470
Comments
That document applies only to shaders. So it only applies to calculations done inside the shader, not to information coming into the shader. I think vertex colors are sent to the GPU using 8 bits as a way to save bandwidth. Not sure off the top of my head though. Also, if you are using 3.1 you should use the 3.1 version of the docs. |
I was suspecting that Colors wouldn't be standard floats for memory concern... Do you know how I could transfer more informations about my vertices? I already use the UV2 but ideally I need 4 more floats.
3.0 is the latest version of this doc apparently. |
No, its not. Here is the latest version. http://docs.godotengine.org/en/latest/tutorials/shading/shading_reference/shading_language.html
It depends on what information you are willing to override, weights is probably something you can use, it uses four floats. Bones as well. |
Why don't you use an hdr texture that'll give you 32 to 16 bits float per component? |
Closing in favor of godotengine/godot-proposals#2935, as feature proposals are now tracked on the Godot proposals repository. |
Godot version:
3.1.1
OS/device including version:
Windows and Ubuntu
GLES3
Issue description:
With SurfaceTool I created a 3D mesh, each vertex had COLOR set as Color(0.125, 0.125, 0.125, 0.125).
In the fragment shader, the data in COLOR would be something between 0.121 and 0.122.
It seems like the data is in 8bits instead of the default 32bits as stated in the documentation on shaders here. However this document is for 3.0.
Steps to reproduce:
A simple 3D project with a 3D camera, and a mesh instance.
Create a square using surfacetool, set the Color above.
Create a default material, turn it into a shader, modify the fragment part. Display Albebo as white if Color.r/g/b/a is inferior to 0.122, display as black otherwise. It was drawn white on both linux and windows.
The text was updated successfully, but these errors were encountered: