- Edited
Hey there!
I'm quite new to Godot, to materials and to shaders too
(Sorry for my poor english too!)
I'm trying to understand fragment shaders and how I could use them to customize colors on my models.
While trying to do this, I noticed that if I use a ShaderMaterial, I am never able to get exactly the same color / tone that I get when using StandardMaterial3D.
My standard material has no particular options that differ from the default (only roughness = 0.55)
My shader material uses the same texture as the standard material below and has a very simple script (that does nothing for the moment, but getting the color from the original texture):
shader_type spatial;
render_mode cull_disabled;
uniform sampler2D base_texture;
void fragment() {
ROUGHNESS = 0.55;
vec4 current_color = texture(base_texture, UV);
ALBEDO = current_color.rgb;
}
Anyway, I get an important difference when displaying one model using the StandardMaterial3D and another one using the ShaderMaterial, as you can see:
Why are they so different?
I feel like I miss something... Anyone to point me towards the right direction?