Quantcast
Viewing all articles
Browse latest Browse all 4929

Shader question

@pandereto wrote:

Hi

Its possible to use in the same shader square and non square textures?

Also if i want to use the two i need to have two different texture coordinates (one for square and another one from non square)

So for example, can i do this¿?

in vertex:

varying vec4 texcoord;
uniform sampler2DRect myNonSquareText;
texcoord = gl_ModelViewProjectionMatrix * gl_Vertex;

in frag:

uniform sampler2DRect myNonSquareText;
gl_FragColor = texture2DRect(myNonSquareText, texcoord);

Im asking because i might be doing something wrong because i don't get the color only black, and i don't get any warning on the console.... So im a bit lost

Thanksss

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles