Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Fast Lighting?

  1. #1
    Member Regular Contributor
    Join Date
    May 2000
    Location
    Batavia, NY, 14020
    Posts
    259

    Fast Lighting?

    I've been looking, but haven't found. Can anyone enlighten me or at least point me in the direction of resources on speeding up lighting for OpenGL.

    I currently take a huge hit in framerate when I enable lighting for my app.

    Somewhere to the effect of 50%-80% frame rate loss.

    If I can get down to 10%-20%, I'd be happy.

    Please note: Poly Counts of 70,000 - 500,000 are easily realizable, so I'm shooting for a solid 15 fps if possible.

    Thanks

    Siwko
    - I am not opensource! -

  2. #2
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: Fast Lighting?

    I guess you would opt for a hw T&L for that.

  3. #3
    Member Regular Contributor
    Join Date
    May 2000
    Location
    Batavia, NY, 14020
    Posts
    259

    Re: Fast Lighting?

    Originally posted by Humus:
    I guess you would opt for a hw T&L for that.
    I can't. I'm limited to PCI video cards, and they have to be consumer level to boot. Sorry, no CAD cards allowed.
    - I am not opensource! -

  4. #4
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: Fast Lighting?

    I guess you have to reduce the polycount ...

  5. #5
    Member Regular Contributor
    Join Date
    May 2000
    Location
    Batavia, NY, 14020
    Posts
    259

    Re: Fast Lighting?

    I already have reduced polys. Generally a 70% reduction. I can't go any lower or I'd be losing too much resolution.
    - I am not opensource! -

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    London
    Posts
    562

    Re: Fast Lighting?

    How about precalculating vertex colours for your static geometry, instead of lighting on the fly?

  7. #7
    Intern Contributor
    Join Date
    May 2000
    Location
    Ottawa, Ontario, Canada
    Posts
    77

    Re: Fast Lighting?

    IF you are displaying your lights with quadrics with material properties of GL_EMISSION that for sure takes a performance hit.

  8. #8
    Member Regular Contributor
    Join Date
    May 2000
    Location
    Batavia, NY, 14020
    Posts
    259

    Re: Fast Lighting?

    I'm using base primitives. Mostly triangle fans and strips. I'm not using any quadrics or anything fancy. In fact, I'm not even scaling, so I believe I've turned off GL_NORMALIZE.

    The other thing is that I'm getting a strange effect with the light. On a cylindrical model, if I rotate the part about the y-axis (just turn the faces), the lighting spot moves to the point where it is out of sight. It implies to be that the light is moving, but it shouldn't be. Ideas?

    (Its not really as important as fast lighting though)
    - I am not opensource! -

  9. #9
    Intern Contributor
    Join Date
    Feb 2000
    Location
    Italy
    Posts
    79

    Re: Fast Lighting?

    Apparently, the light position is in the object space of the cylinder, so it's being transformed by the modelview.
    Also, remember to update the spot direction (it is transformed by the inverse of the modelview matrix current at the time of calling glLightf).

    [This message has been edited by paolom (edited 05-25-2000).]
    --
    Paolo M.

  10. #10
    Member Regular Contributor
    Join Date
    Apr 2000
    Location
    Redlands, CA, USA
    Posts
    292

    Re: Fast Lighting?

    to Glenn Upton:

    > IF you are displaying your lights with quadrics with material properties of GL_EMISSION that for sure takes a performance hit.

    Can you explain it, please?
    I always thought, that the GL_EMISSION is a simplest & fastest part of lighting calculations.

Posting Permissions

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