Navidrct
Member
hi
i want to get application surface texture and pass it to shader so i can use it there to make my sprite transparen by shader
so in draw function of my sprite that i want use
at line 2 you see that i get sampler index and at line 3 i try to get application surface texture to pass it to shader as sampler2d
in shader test
and in here i try to use application surface sampler with v_vTexcoord and texture2D function i try to draw application surface instead of my sprite so it will be transparent
what did i do wrong?
im sure everywhere but please if someone know how to do that tell me
i want to get application surface texture and pass it to shader so i can use it there to make my sprite transparen by shader
so in draw function of my sprite that i want use
GML:
var _time = shader_get_uniform(shd_test,"time");
glassshader_bgsampler = shader_get_sampler_index(shd_test, "s_BackgroundSampler")
spr = surface_get_texture(application_surface);
shader_set(shd_test);
shader_set_uniform_f(_time,current_time/3000);
texture_set_stage(glassshader_bgsampler, spr);
draw_self();
shader_reset();
in shader test
C:
//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform float time;
uniform sampler2D s_BackgroundSampler ;
void main()
{
vec4 color = texture2D(s_BackgroundSampler,v_vTexcoord);
gl_FragColor = color;
}
what did i do wrong?
im sure everywhere but please if someone know how to do that tell me