Results 1 to 6 of 6

Thread: LiGhtninG and textures

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2005
    Posts
    7

    LiGhtninG and textures

    I've got a free form object and texture puttinG on it. And one liGht source. How can i make my texture to chanGe it pixels liGhtness accordinG to the location of the liGht source.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jul 2005
    Location
    Germany
    Posts
    306

    Re: LiGhtninG and textures

    uh you should fix your g key
    i can only guess what you want to do but you're probably talking about normal mapping. you will need to write shaders for that. here you can find tutorials on this technique: http://www.ultimategameprogramming.com/

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2005
    Posts
    7

    Re: LiGhtninG and textures

    Oh, thank you.
    I will try it right now.

  4. #4
    Junior Member Newbie
    Join Date
    Sep 2005
    Posts
    7

    Re: LiGhtninG and textures

    Sorry, i have to do this without shaders.
    Maybe i should repeat my question more simple.
    I have an object with texture and light source. Light source has no effect on texture. How can i do that?

  5. #5
    Guest

    Re: LiGhtninG and textures

    You need to calculate the normals for each vertex in your model, and then you'll be able light your object from any angle.

    Read this for starters:

    http://nehe.gamedev.net/data/lessons....asp?lesson=07

  6. #6
    Senior Member Frequent Contributor
    Join Date
    Feb 2004
    Location
    Long Island, New York
    Posts
    569

    Re: LiGhtninG and textures

    Also, you need to make sure that your texturing environment is set up as GL_MODULATE.

    I think the default is GL_DECAL which does a straight replace of the fragment color with the texture sample. This will obliterate any lighting calculations since lighting is done first.

Similar Threads

  1. Need help with lightning
    By art-ganseforth in forum OpenGL: GLSL
    Replies: 1
    Last Post: 06-26-2018, 07:23 PM
  2. Lightning
    By Ievgen in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-23-2009, 06:04 PM
  3. Textures and Lightning
    By Rodrix in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-28-2005, 09:30 PM
  4. Lightning - Nothing happens
    By lsdi in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-22-2002, 12:56 PM
  5. lightning
    By lsdi in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-25-2002, 10:41 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