Skip to main content
GameDev.net gamedev.net
🔒 Locked

OpenGL-Multitexture

Started by zqueezy Feb 22, 2008 at 1:43 PM 2 replies 800+ views
Original Post
zqueezy
zqueezy
hey folks, do you know weather mutlitexturing allows for multiple texture matrices to be set? can i switch the texture matrix between those calls? glLoadIdentity(); glTranslatef(1.0f, 1.0f, 0.5f); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, s0, t0); glMatrixMode(GL_TEXTURE); glLoadIdentity(); glScalef(2.0f, 2.0f, 2.0f); glMultiTexCoord4fARB(GL_TEXTURE1_ARB, s1, t1, r1, q1); will there be different texture matrices in the shader? I tried to implement a modelloader for 3ds and the texture-coodinates are always between 0..1 and the textures gets scaled. or is it better to have different texture-coordinate-arrays to look up with modified texcoords? thanx zqueezy
dpadam450
dpadam450
Then in your loader change the texture coordinates. Texture coords are supposed to be from 0 to 1. What does "textured gets scaled" mean. It goes from 512x512 to 1024x1024??? If so that doesnt make any sense, but regardless of texture size, it will still map the same texture coordinates.
NBA2K, Madden, Maneater, Killing Floor, Sims 
zqueezy
zqueezy
the texture in 3ds has options like u-scale, v-scale for tiling and/or mirroring also.
i could preprocess the texture coordinates in opengl or i give the scling to a shader but each different texture-layer can have different u,v-scaling (and also translation) so i don't know if its wise to give so much data per texture to the shader...
zqueezy
zqueezy
for example a plane (quad) has the texture coordinates (1.0, 0.0)... stuff
in 3ds max there's tiling on for texture layer 1. let's say 4x4 so that actually the texture coordinates for the quad need to be (4.0,0.0)...
but for texture layer 2 there's no tiling (1.0, 0.0) and I need the original texture coordinates...
I'd like to use glDrawElements for the final rendering but when I specify glTexCoordPointer and use the index-list given for gldrawelements, then I'd need two texture-arrays of course that's not the problem but the indices mean that both arrays need to have the same size to work correctly and if my model has multiple materials (which each have 2-4 texture layers) I'd need to store many many different texture-coord arrays of the same size (!!!) lot of them unneeded.

is it bad to have so many texture-coord arrays or is the performance overhead almost equal zero?
thanx

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.