[GEM-dev] more on multitexturing

james tittle tigital at mac.com
Tue Dec 20 01:40:45 CET 2005


On Dec 19, 2005, at 6:06 PM, chris clepper wrote:

> I spent today trying to get actual multitexturing working using
> arb_fragment.  In order to use shaders with texture units other than
> the first one the texcoords need to be passed to the remaining units.
> So if I have a luma/chroma key shader, I need to put a texture on unit
> 0 and also on unit1.  Just enabling them doesn't actually texture them
> properly though.
>   I added the following to SetVertex() in GemShape:
>
> if (state->numTexCoords) {
>       glTexCoord2f(state->texCoordX(curCoord), state->texCoordY 
> (curCoord));
> 	  glMultiTexCoord2fARB(GL_TEXTURE1_ARB,state->texCoordX(curCoord),
> state->texCoordY(curCoord));
> 	  }
>     else {
> 		glTexCoord2f(tx, ty);
> 		glMultiTexCoord2fARB(GL_TEXTURE1_ARB,tx,ty);
> 		}
>
> Doesn't look so bad right?  Well, in order to cover every one of the
> texture units available, they have to be textured onto properly.  So
> for an eight texture unit GPU that's GL_TEXTURE[0..7]_ARB and so on.
> Is this something that I should go ahead and do?

...definitely add it if it works ;-)  But I'm not really  
understanding how this would be accessed:  are you using  
pix_multitexture to assign to texture unit, then passing this state  
onto geos?  How do the geos know that there are multiple texture  
units being addressed, or where to stop?

jamie





More information about the GEM-dev mailing list