I’m creating a application that basically can use 6 textures to compute a fragcolor in the fragment program.
Problem is that this application also needs to work on video cards with 4 texture units.
So my idea is to use multi pass rendering.
I draw a polygon witht the 1st 3 textures enabled. and then draw again with the other 3. The final color is a combination of all 6 textures.
1st color algorithm:
From the maintexture, using look up texture gives new Frag value (apply a display filter).
This new Frag value is used to look into a colorset texture to get the correct color ( apply colorset texture).
I got the above working.
But now I want to overlay this maintexture (using mix()) with another texture created exactly like the above. Should I be using FBO’s?
Am I explaining my problem correct? If so do any of you know how to do this?
The thing is actually very weard and I haven’t all the answer to it.
For a look time now graphics card have more that 4 texture units… but glGetIntegerv(GL_MAX_TEXTURE_UNIT, ); return 4 on my GeForce 8800… however I successfully bind more that 4 textures.
If someone have clues on this I will appreciate but anyway in your case, just bind 6 textures, it works!
Both the vertex shader and fragment processing combined cannot use more
than MAX COMBINED TEXTURE IMAGE UNITS texture image units. If both
the vertex shader and the fragment processing stage access the same texture
image unit, then that counts as using two texture image units against the
MAX COMBINED TEXTURE IMAGE UNITS limit.