Second UV map from model

Hi!

I have made some models with 2 UV maps in Blender.
I use 3ds files and load them into a openGL library (GLScene) I am using which deals with loading of models.
Now I would like to access that second UV map in the shader.
Is it possible? Is that what gl_MultiTexCoord1 does?

Thanks in advance!
Daniel

Yes.

If you’re using the legacy (fixed-function) API, texture coordinates can be specified by glTexCoord, glMultiTexCoord or glTexCoordPointer. Which set of texture coordinates are affected is determined by glActiveTexture for glTexCoord, the target parameter for glMultiTexCoord, and glClientActiveTexture for glTexCoordPointer.

Within shaders, the various texture coordinates can be accessed through the gl_MultiTexCoord* variables.

With 3+ core profile, you use e.g. glVertexAttribPointer to associate an array of texture coordinates with a generic vertex shader input (attribute).

Which approach you need to use depends upon what the loading library is doing, i.e. whether it’s using legacy attributes or generic attributes. If it’s just handing you the arrays, it’s up to you which approach you take to pass that data to the shader.