PDA

View Full Version : Multitexturing with Vertex Arrays & Shaders (Quake III renderer)



tfpsly
03-07-2001, 10:18 AM
I've a little problem with my engine.
It use shaders that are based on Quake III's for rendering state of faces. Each renderer may have texture distorsion, like texture coordinates translation/rotation/scaling... For this I alter the texture matrice.

Now all works perfectly without multitexturing. But can I use 2 texture matrice, one for each of the 2 texturing passes when I use multitexturing? Because when I activate my multitexturing code, both texturing pass gets altered.

Seems that there is only one texture matrice, common for the 2 multitexturing unit.

Am I right? Then the only solution would be to alter texture coordinate in my engine before sending them to OpenGL...


[This message has been edited by tfpsly (edited 03-07-2001).]

zed
03-07-2001, 11:34 AM
taken from the 1.2.1 spec (link first page)


Setting
the matrix mode to TEXTURE causes the already described matrix operations
to apply to the texture matrix.
There is also a corresponding texture matrix stack for each texture unit.
To change the stack a
ected by matrix operations, set the active texture
unit selector by calling
void ActiveTextureARB( enum texture );
The selector also a
ects calls modifying texture environment state, texture
coordinate generation state, texture binding state, and queries of all these
state values as well as current texture coordinates and current raster texture
coordinates.

tfpsly
03-08-2001, 12:12 AM
Exactly what I wanted!
Thx a lot