Help with shaders
Posted: Mon Apr 22, 2019 10:13 pm
I currently have this code:
The problem is when I draw a circle, the shader does not rise at all(I'm creating a smoke shader), and cannot seem to get the alpha of pixels from outside the circle
Code: Select all
[[
vec4 effect( vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords ){
vec4 pixel = Texel(texture, screen_coords);
vec2 coords = vec2(texture_coords.x,screen_coords.y+1);
vec4 Upixel = Texel(texture,coords);
if (Upixel.a < pixel.a){
float average = (Upixel.a+pixel.a)/2;
Upixel.a = average;
pixel.a = average;
}
}
]]