![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | ruben086 |
ALBEDO is vec3 and COLOR is vec4… I need make pass COLOR to ALBEDO on Godot… This shader work on shader_type items_canvas but not working on spatial material…
shader_type spatial;
uniform float amp = 0.1;
uniform vec4 tint_color = vec4(0.0, 0.5,0.99, 1);
uniform sampler2D iChannel0;
void fragment ()
{
vec2 uv = FRAGCOORD.xy / (1.0/VIEWPORT_SIZE).xy;// (1.0/SCREEN_PIXEL_SIZE) for shader_type canvas_item
vec2 p = uv +
(vec2(.5)-texture(iChannel0, uv*0.3+vec2(TIME*0.05, TIME*0.025)).xy)*amp +
(vec2(.5)-texture(iChannel0, uv*0.3-vec2(-TIME*0.005, TIME*0.0125)).xy)*amp;
vec4 a = texture(iChannel0, p)*tint_color;
ALBEDO = a.xyz; //the w channel is not important, works without it
on shader_type canvas_item but if used this on 3d spatial the effect no pass.. whats problem?
}