Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | FuLeZi |
I would like to write a spatial shader and end up with the same result as with a spatial material.
As a first step I tried to mimic the spatial material but without success. My material (terrain) appears too bright.
Expected result (export from Blender):
Material properties (export from Blender):
My spatial shader (too bright):
And here is the shader I’ve tried:
shader_type spatial;
render_mode diffuse_burley, specular_schlick_ggx, ensure_correct_normals, depth_draw_opaque;
uniform sampler2D sand_tex;
uniform sampler2D sand_normal;
uniform float sandres = 1;
void fragment() {
vec3 sandcolor;
sandcolor = texture(sand_tex, UV * sandres).rgb;
ALBEDO = sandcolor;
NORMAL_MAP = texture(sand_normal, UV * sandres).rgb;
SPECULAR = 0.5;
ROUGHNESS = 0.5;
METALLIC = 0.0;
}
Do you see what I’ve missed?