- Edited
Hi Why through SpatialMaterial the assigned color is displayed correctly (model 1), and when I make through ShaderMaterial the color is wrong (model 2).
How does ShaderMaterial fix it?!
Hi Why through SpatialMaterial the assigned color is displayed correctly (model 1), and when I make through ShaderMaterial the color is wrong (model 2).
How does ShaderMaterial fix it?!
Looks like you have another material pass on top of the shader material object...
Here's an example of creating new material in a new scene. I can't get the right color.
The color difference in one scene. SpatialMaterial is created in a simple way
That might have to do with color management, probably best to report on the issue tracker. List what godot version, what operating system and what computer hardware you are using, as well as all the info you have given here. For best results it's good to include a simple test scene reproducing the issue as well.
https://github.com/godotengine/godot/issues/new?assignees=&labels=&template=bug_report.md&title=
I wrote about the problem on github.
I solved the problem using hint_color and hint_albedo For color hint_color . For texture hint_albedo.
code += "uniform vec4 albedo : hint_color;
code += "uniform sampler2D texture_albedo : hint_albedo;
shader_type spatial;
uniform vec4 color1 : hint_color = vec4(0.4,0.5,0.3,1);
void fragment() {
vec3 color1_ = color1.rgb;
EMISSION = color1_;
}