PDA

View Full Version : Lighting, texture - How to do it?-- Help



08-21-2002, 05:04 AM
I developed a small simulation(a room with air ducts). The task is to check air ducts. the camera goes inside the room and duct. (Using MS VC++)

problems:
1. when i enter into the room, the window is full of wall color. This is because i haven't defined lighting. how to define it?

2. Normally air ducts are made of tin sheets. Is it possible to create that color or texture? how?

3. when the camera enters into the duct(no lighting inside the duct), a spot light moves with the camera. this means after a certain distance the duct should be dark(means no light). I want to create this kind of effect. Theoritically this means no light in duct and the camera is fitted with a spot light. How to do this.

thanks a lot, in advance
simon

nexusone
08-21-2002, 05:17 AM
1. Nehe has a lighting tutor on his site, nehe.gamedev.net

2. You can do a search for texture files on the net, and find some nice metal textures.
also look at how to use GL material settings.

3. Look at lighting examples on nehe site and others.


Originally posted by simonH:
I developed a small simulation(a room with air ducts). The task is to check air ducts. the camera goes inside the room and duct. (Using MS VC++)

problems:
1. when i enter into the room, the window is full of wall color. This is because i haven't defined lighting. how to define it?

2. Normally air ducts are made of tin sheets. Is it possible to create that color or texture? how?

3. when the camera enters into the duct(no lighting inside the duct), a spot light moves with the camera. this means after a certain distance the duct should be dark(means no light). I want to create this kind of effect. Theoritically this means no light in duct and the camera is fitted with a spot light. How to do this.

thanks a lot, in advance
simon

Miguel_dup1
08-22-2002, 08:07 AM
Well, for a spot light you could use this:

//glLightfv(GL_LIGHT0 + lightID, GL_SPOT_DIRECTION, newLight.light_Direction);
//glLightf( GL_LIGHT0 + lightID, GL_SPOT_CUTOFF, 60.0f );
//glLightf( GL_LIGHT0 + lightID, GL_SPOT_EXPONENT, 90.0f );
//glLightf( GL_LIGHT0 + lightID, GL_CONSTANT_ATTENUATION, 1.0f);
//glLightf( GL_LIGHT0 + lightID, GL_LINEAR_ATTENUATION, 0.0f );
//glLightf( GL_LIGHT0 + lightID, GL_QUADRATIC_ATTENUATION, 0.0f);


The problem is that specular lighting does not affect textures... Meaning that you wont get the tin shiny looking effect right of the bat... You could use two pass where you draw the ducts without texture and apply lighting to it and then blend it with the duct with the texture... That will give you a shiny spot light...