[[1, 4, 7, 2, 5, 8, 3, 6],
[2, 5, 8, 3, 6, 1, 4, 7],
[2, 5, 8, 3, 6, 1, 4, 7],
[3, 6, 1, 4, 7, 2, 5, 8],
[4, 7, 2, 5, 8, 3, 6, 1], <-- 5
[4, 7, 2, 5, 8, 3, 6, 1],
[5, 8, 3, 6, 1, 4, 7, 2],
[6, 1, 4, 7, 2, 5, 8, 3],
[6, 1, 4, 7, 2, 5, 8, 3],
[7, 2, 5, 8, 3, 6, 1, 4],
[8, 3, 6, 1, 4, 7, 2, 5],
[8, 3, 6, 1, 4, 7, 2, 5]]
^
|
3
This means that for the pixel at position (3, 5) I need to get the color from stage 2.
Now my question is: how can I make a shader like this? Is this possible with a pixel shader? I can't enter my matrix because only 4x4 matrices are supported and I use the full 8 texture stages so having a lookup-table in a texture isn't possible...
I must say that the textures are all the same rendered 3D scenes with a different camera position. I use render to textures to make this work in my program.
If someone is more interested in the details I've made a PDF with some more details. http://www.poison.be/pixelshader/X3D.pdf
Thank you very much in advance!!!!!
Nicolas
Pixel shader question
I have a question about pixel shaders:
I have set 8 texture stages (0 - 7) in my program. I want to have a final texture on the screen that displays image data of all the 8 textures, a bit scrambled.
I have a 8x12 lookup matrix that tells me for a specific position where I need to get the color from.
The matrix is the following:
Somebody might be able to come up with a clever way to accomplish what you are trying to do on the GPU, but it seems to me that it would be easier to do it on the CPU.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement