Skip to main content
gamedev.net
🔒 Locked

multitexture lighting

Started by fatherjohn666 Jun 13, 2002 at 6:45 PM 3 replies 800+ views
Original Post
fatherjohn666
fatherjohn666
First of all: I have searched many places, google rules but I have tried lighting textures, lighting multitextures, multitexture lighting, multitexture lights, multilight textures....etc including other words like tutorials, opengl, and C++ I have used many search engines. BUT I must be blind, cause I cant see shit of an article on Lighting MULTITEXTURE SURFACES. on its own, my single textures reflect light like a torch, as soon as I enable the multitexture tex units, the lighting dissapears. I know this is simple, I know there is a command I need...... hmmmm...actually I aint tried opengl.org yet.... so in a nutshell: * I got my texture map etc working, now I am wondering why everything is dark, obviously I need to brighten the scene. However I cant seem to get any lighting to work, even with enable color_material etc... * I can light any normal texture but once I use multitexturing the lighting seems to dissapear..... god damn it, i am sick of spending this weeks programming time moving the same code around, reading heaps of other code.... wow, actually I'll check the nehe multitexture tutorial, I think that was with lights!..... but anyway, if I cant figure it out, can someone explain it? cheeeeeers [edited by - fatherjohn666 on June 16, 2002 10:20:46 PM] [edited by - fatherjohn666 on June 16, 2002 10:21:03 PM]
~~~~~~~~~~~~~~~~~~~~~~~~~http://on.to/oni
fatherjohn666
fatherjohn666
someone please!

Is there a rule (order) to how I should set up my textures,lights and multitexture units?

I have tried rendering color in my scene just to see if I can see any light:

// render light in init function
// push matrix
// glTranslatef to my spot
glColor4f(1.0f,1.0f,1.0f,1.0f);
glutSolidSphere(1,10,10);
// pop matrix

// render height map

all this does is display a BLACK sphere above my height map???

in the height map routine I call the texture units and set them up, at the end of the height mapping loop I have it kill the textures in the texture units (glBindTexture(GL_TEXTURE_2D,0); )

Is there a way I should be setting up texture units in specific areas? is there a rule for specific order to make things happen?

where should tex unit declaration normally be?
why would that matter (if it does!)?

using display lists for stuff like background and text display,can this effect my lighting?

My init function basically does the following:

// check multitexturing feature
// loads textures
// buildLists();
// enable smooth shading
// enable depth test
// cull faces
// set lighting
// set blending but disable
// set fog
// loadheight map

in the draw function I call movement functions then previous sphere code and then the display lists.

but I can get multitextured terrain, get the volume fog effect, the text, the background, but "untextured" objects are black...

I dont wont to annoy the select few who hate seeing liiiinnnnes of code, so anyone had this problem, im sure you have...

Í know its something simple
but what!!!!


~~~~~~~~~~~~~~~~~~~~~~~~~http://on.to/oni
White Rabbit
White Rabbit
You say nothing about normals, you might want to check them!

"Follow the white rabbit."
"Follow the white rabbit."
fatherjohn666
fatherjohn666
damn forgot to say that, normals are definately there
in the terrain map rendering
and the glutSolidSphere defines its own normals
its only when I add the multitexturing effect my lighting dissapears.

It took me a while to figure why some of my single textures where darker then normal, but that has to do with unbinding textures.

Butno lights even with normals




~~~~~~~~~~~~~~~~~~~~~~~~~http://on.to/oni
AIRmichael
AIRmichael
Heh i think i had the same prob, and also asked in this forum. Its for vertex light btw
glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);

Topic Locked

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

Sign in to reply to this topic.