PDA

View Full Version : multitexture



kewuwsi
04-12-2007, 07:13 AM
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

Jan
04-12-2007, 08:26 AM
Yes, because your texture-coordinates are in range [0; 1] (normalized) and thus "aligned".

Jan.

kewuwsi
04-12-2007, 08:51 AM
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!

k_szczech
04-13-2007, 06:30 AM
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 :)

kewuwsi
04-17-2007, 10:16 AM
thanks, helps a lot