3D using light and texture together
3D using light and texture together
Is it possible to use light and texture together? I can't see the differences of light implementation...
Re: 3D using light and texture together
Yes it is possible. Make sure you not setting the vertex color after you send the required normal commands as this will override the color calculated by the normal command. Also, did you set the ambient, diffuse, and specular color materials?
Re: 3D using light and texture together
will it work if i use calllist? all my objects are exported from 3dsmax (3ds format into bin)
Re: 3D using light and texture together
yes, though the same issues apply.
Re: 3D using light and texture together
can you pls give me some example? It didn't work in my place... is it because I use RGB16 instead of RGBA?
Re: 3D using light and texture together
this is the code I use:
per frame I call:
per object that will use lighting I turn on the light and set the colors
then for each point of each triangle I send the normal, the texcoord, and then the vertex - in that order.
per frame I call:
Code: Select all
glLight(0, RGB15(31,31,31) , floattov10(r_vright[0]), floattov10(r_vright[1]), floattov10(r_vright[2]));
Code: Select all
glPolyFmt(POLY_ALPHA(31) | POLY_CULL_FRONT | POLY_ID(6) | POLY_FORMAT_LIGHT0 | (1 << 13));
glColor3b(shadelight,shadelight,shadelight);
glMaterialf(GL_AMBIENT, RGB8(ambientlight,ambientlight,ambientlight));
glMaterialf(GL_DIFFUSE, RGB8(shadelight,shadelight,shadelight));
glMaterialf(GL_SPECULAR, RGB8(shadelight,shadelight,shadelight));
Re: 3D using light and texture together
Thx for your help.
Who is online
Users browsing this forum: No registered users and 3 guests