how to do multitexturing?
Posted: Sun Nov 10, 2013 1:16 am
hi anyone know how to do multitexturing in libnds/devkitarm?
for instance if i have the "texture" & the "normal". (for abit of bump mapping)
im using .pcx format textures. i know how to load 1 texture per model but..
for instance if i have the "texture" & the "normal". (for abit of bump mapping)
im using .pcx format textures. i know how to load 1 texture per model but..
Code: Select all
//texture
sImage watertexpcx;
loadPCX((u8*)watertex64_pcx, &watertexpcx);
image8to16(&watertexpcx);
glGenTextures( 1, &watertex64_texid ); glBindTexture( 0, watertex64_texid );
glTexImage2D(0, 0, GL_RGB, TEXTURE_SIZE_64, TEXTURE_SIZE_64, 0, TEXGEN_TEXCOORD, watertexpcx.image.data8);
imageDestroy(&watertexpcx);
//model
glPushMatrix();
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
get_glPolyFormats(); //from "lighting handler.h"
glTranslatef(0,0,160); //glRotateX(-90);
glScalef(10,10,10);
get_glMats(); //from "lighting handler.h"
glBindTexture( 0, watertex64_texid );
glCallList((u32*)mappieceflat64_bin);
glPopMatrix(1);