multitexture

Hi, all.
when I use multiple texures, (the texures are in different size, and they are mapped properly to the same geometry). If I try to access the texture on fragment shader with call texture2D(texture1, vec2(s, t)), texture2D(texture2, vec2(s, t)), texture2D(texture3, vec2(s, t)). can they get the color for the same geometry point?

in another words, did all the textures aligned together?

tks

Yes, because your texture-coordinates are in range [0; 1] (normalized) and thus “aligned”.

Jan.

really? it doesn’t matter how you apply the textures?
like for particular one point, when you apply textures to it, the corresponding texture coordinates may not be same for different textures. but on the shader side, when you make the call:
“texture2D(texture1, vec2(s, t)), texture2D(texture2, vec2(s, t)), texture2D(texture3, vec2(s, t)).”
they will get the pixel value for the same geometry point? (notice the coordinates(s, t) are same)

appreciate!

Keep in mind that shaders replace fixed functionality - you decide where and which textures are sampled, wchich components are taken and how textures are blended.
You do whatever you want and if it’s (s,t) you want - you get it :slight_smile:

thanks, helps a lot

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.