Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Couple q's about vertex programs & lights

  1. #1
    Junior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    New Zealand
    Posts
    147

    Couple q's about vertex programs & lights

    1) looking through the NVIDIA labs on vertex programs, and the first one, to do with per pixel lighting has material color. Now, say i want to have a 'red' light, then i just change the material color? I think that's right, because isn't that the way it is done with normal vertex lighting? I think i've prob answered my own question

    2) If i wanted more than one light (different colours) would i have to draw the scene each time for each light? or do i have multiple vertex programs operating on at a time?

    3) What is the easiest way to do bump-mapping and per pixel lighting together?

    thanks!
    I have no signature, so ill just write random nonsense here......

  2. #2
    Member Regular Contributor Julien Cayzac's Avatar
    Join Date
    Aug 2001
    Location
    Yokohama, Japan
    Posts
    251

    Re: Couple q's about vertex programs & lights

    Originally posted by robert:
    If i wanted more than one light (different colours) would i have to draw the scene each time for each light? or do i have multiple vertex programs operating on at a time?
    You can do it a single program. Vertex programs can use up to 96 constant registers. You can pass many lights' directions (or position) / colors to a program using these.

    3) What is the easiest way to do bump-mapping and per pixel lighting together?
    Using the core GL only, try looking at the combine textures abilities (it was called ARB_texture_env_combine in OpenGL 1.2). If you plan to make things faster (and driver dependent), look at NV_texture_shader (GeForce3/4Ti), NV_register_combiners(TN2, gf256, gf2/3/4), or ATI_fragment_shader(Radeon).

    Julien.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    New Zealand
    Posts
    147

    Re: Couple q's about vertex programs & lights

    You can do it a single program. Vertex programs can use up to 96 constant registers. You can pass many lights' directions (or position) / colors to a program using these.
    How would i do this in a vertex program? Say at one time i need two lights, at another i only need one. Would i have to write a vp that would work on three lights?

    Thanks
    I have no signature, so ill just write random nonsense here......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •