mycral

10-14-2010, 07:40 AM

this is my glsl codes: :confused:

================================================== ====

vertex program:

varying vec2 tex0st;

varying vec2 tex1st;

uniform sampler2D Texture0;

uniform sampler2D Texture1;

void main(void)

{

vec4 texcolor;

vec4 texcolor2;

texcolor = texture2D(Texture0,tex0st);

texcolor2 = texture2D(Texture1,tex0st);

gl_FragColor = texcolor + texcolor2;

}

fragment program:

varying vec2 tex0st;

varying vec2 tex1st;

uniform sampler2D Texture0;

uniform sampler2D Texture1;

void main(void)

{

vec4 texcolor;

vec4 texcolor2;

texcolor = texture2D(Texture0,tex0st);

texcolor2 = texture2D(Texture1,tex0st);

gl_FragColor = texcolor + texcolor2;

}

================================================== ========

In the fragment programent,I got the texture coordinate but the coordinate is the vertex's coordinate ,the texture coordinate is not the other pixcel's coordinate ..... who can tell me how it works! Thanks in advanc [/B] :p

:confused: :confused:

================================================== ====

vertex program:

varying vec2 tex0st;

varying vec2 tex1st;

uniform sampler2D Texture0;

uniform sampler2D Texture1;

void main(void)

{

vec4 texcolor;

vec4 texcolor2;

texcolor = texture2D(Texture0,tex0st);

texcolor2 = texture2D(Texture1,tex0st);

gl_FragColor = texcolor + texcolor2;

}

fragment program:

varying vec2 tex0st;

varying vec2 tex1st;

uniform sampler2D Texture0;

uniform sampler2D Texture1;

void main(void)

{

vec4 texcolor;

vec4 texcolor2;

texcolor = texture2D(Texture0,tex0st);

texcolor2 = texture2D(Texture1,tex0st);

gl_FragColor = texcolor + texcolor2;

}

================================================== ========

In the fragment programent,I got the texture coordinate but the coordinate is the vertex's coordinate ,the texture coordinate is not the other pixcel's coordinate ..... who can tell me how it works! Thanks in advanc [/B] :p

:confused: :confused: