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...


This discussion was caught in the moderation queue since you have not confirmed your account yet.
Upon creating your account you should have received an account verification email. The confirmation email may have been incorrectly flagged as spam, so please also check your spam filter. Without confirming your account, future posts may also be caught in the moderation queue. You can resend a confirmation email when you log into your account if you cannot find the first verification email.
If you need any help, please let us know! You can find ways to contact forum staff on the Contact page. Thanks! :smile:

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

I wrote about the problem on github.

a month later

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_;
}
Write a Reply...