GLSL Shader multi-texture lookup with different texCoord (iPad)?

Well in the first case of course you get 5 slices from the same texture Think about what you are doing Take a y coordinate of 0.6 (1 - 0.6) = 0.4 mod( 0.4, 0.2 ) = 0.0 0.0 + 0.2 = 0.2 Basically you force the y coordinate to be in the range 0.2 to 0.4 which will always be image1. I'm not sure why you are seeing image2 though As for the 2nd case ... this heavily implies that the texture coord you are receiving is wrong. So .. do you want to show us the vertex shader as well as this fragment shader?

I have to admit, though, I can't understand why you don't just put the 5 slices into a single texture and just render it You may want to check out this: vis.uni-stuttgart.de/glsldevil/index.htm....

Well in the first case of course you get 5 slices from the same texture. Think about what you are doing. Take a y coordinate of 0.6.(1 - 0.6) = 0.4 mod( 0.4, 0.2 ) = 0.0 0.0 + 0.2 = 0.2 Basically you force the y coordinate to be in the range 0.2 to 0.4 which will always be image1.

I'm not sure why you are seeing image2 though ... As for the 2nd case ... this heavily implies that the texture coord you are receiving is wrong. So .. do you want to show us the vertex shader as well as this fragment shader? I have to admit, though, I can't understand why you don't just put the 5 slices into a single texture and just render it ... You may want to check out this: vis.uni-stuttgart.de/glsldevil/index.htm....

1, although I'm thinking the image1 not showing is simply a mistake in the sampler setting code (hence why we see image2 in the uncommented code) – Bahbar Oct 12 '10 at 14:28 Oh my oh my, you're right of course, that is why I'm seeing image1 every time, that was pretty silly of me. I've fixed that part and I do see different images in each slice, but not the right ones, I will edit the question to detail how I load the images. – Guy Oct 12 '10 at 15:16 An idea why I'm not seeing the right textures?

Anyone? I've looked at this code for so long I may be missing another one of those obvious mistakes, but I just can't see it. – Guy Oct 13 '10 at 6:29.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions