I currently have a shader effect which I'd like to pass two different textures into. I also want to use TEXCOORD0 and TEXCOORD1 to specify the different texture co-ordinates for each texture. I only want to render a small quad from the first texture (which is 512x512 pixels) so the co-ordinates are something like (64,64), (128, 64), (128, 128), (64,128). I want to wrap the second texture so the co-ordinates end up being in a completely different space. It's a 128x128 pixel image and the co-ordinates for this one might be (100, 100), (500, 100), (500, 500), (100, 500).
By the time my co-ordinates get to the pixel shader they been mapped to the range (0..1) rather than (0..texsize). The trouble is this mapping only seems to be based on the first texture so TEXCOORD0 is fine but TEXCOORD1 gets completely distorted.
I'm passing both textures as constants to the shader. Is there any way to specify how this mapping occurs or do I just need to add some constant parameters to perform the transformation myself.
Cheers,
Dave