Results 1 to 3 of 3

Thread: Lighting, texture - How to do it?-- Help

  1. #1
    Guest

    Lighting, texture - How to do it?-- Help

    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

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: Lighting, texture - How to do it?-- Help

    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

  3. #3
    Senior Member Regular Contributor
    Join Date
    Jan 2002
    Posts
    292

    Re: Lighting, texture - How to do it?-- Help

    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...

Similar Threads

  1. Lighting and Texture in WebGL
    By Phinehas in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-25-2011, 03:22 AM
  2. Correct lighting of second texture
    By Andy2709 in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 02-02-2010, 07:58 AM
  3. lighting texture
    By woodi in forum COLLADA
    Replies: 3
    Last Post: 03-19-2007, 12:28 PM
  4. Lighting&Texture Mapping
    By Sam Kovalev in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 11-08-2004, 07:43 AM
  5. lighting with texture 3d
    By krol in forum OpenGL: Advanced Coding
    Replies: 43
    Last Post: 10-07-2002, 12:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean