PDA

View Full Version : Help with multitextring



WintersNight
04-17-2003, 04:00 PM
I've generated a terrain using a *.raw file as a height map, calculated texture coordinates and it looks great. Its also multi-textured using glActiveTextureARB(), but I've come to light the thing and...

Oh what a surprise, nothing happens. If I don't even turn ON lighting, you can see the whole terrain. I've mucked about with it for ages, but nothing seems to work.

What are the things I need to make lighting work?

Please help!

.wn

shinpaughp
04-17-2003, 05:23 PM
You have to enable lighting, enable at least 1 light, and set the parameters for the light, and provide material settings for the objects or enable color material




//example
glLightModel(...);//if you don't like default
glLight(GL_LIGHT0, ...);// etc, etc, etc
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);

//DO THIS
glMaterial(...);
draw stuff...

//OR DO THIS

glColorMaterial(...);
glEnable(GL_COLOR_MATERIAL);
glColor(...);
draw stuff...

Perspective
04-17-2003, 05:44 PM
you also might want to consider declaring normals for all the poly's in your terrain.

shinpaughp
04-17-2003, 06:19 PM
I did forget that part, didn't I. Thanks for the perspective... http://www.opengl.org/discussion_boards/ubb/biggrin.gif