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 4 123 ... LastLast
Results 1 to 10 of 31

Thread: Glow in the Dark Textures

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    17

    Glow in the Dark Textures

    Is there a way to use OpenGL to get the effects of glow-in-the-dark textures? What I mean by this is like in Quake a soldier could stand in a dark corner but you could still see his bright-red triangle on his gun. Lighting was not a factor for that pixel color/value/index.

    I intend to use OpenGL T&L and not have to write my own lighting system. I have a system that works with the 8 lights that are gauranteed to be available as per an implementation. This feature could be used to simulate many neat effects in our space sim.

    Thanks,
    Bw

  2. #2
    Junior Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Roseville, CA
    Posts
    159

    Re: Glow in the Dark Textures

    This is called an emission map. All you have to do is add the value in the emission map after doing your lighting. Thus, you might do this per fragment to get your final color K:

    K = C0 * T0 + T1

    where C0 is the primary color, T0 is your ordinary texture map, and T1 is the emission map. This can easily be done with conventional texture blending, GL_ARB_texture_env_combine, or GL_NV_register_combiners.

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    17

    Re: Glow in the Dark Textures

    Thanks!!!!!

  4. #4
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    17

    Re: Glow in the Dark Textures

    Wait a minute.

    Is there a way to do this without having to use extensions? I want the game to work with as many cards as possible.

    The fact is im not using my own lighting engine, I am using OpenGL lights. I do store per-pixel or per-vertex lighting information nor do I calculate it.

    I would like to basically ensure that one or more colors are unaffected by lighting and thus, if there were no lights in the scene or if they were totally dim that the colors would show but the rest of the texture would be pitch black.

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Dec 2001
    Location
    Wellington, New Zealand
    Posts
    544

    Re: Glow in the Dark Textures

    Well, ARB_texture_env add is supported by all accelerators I know of...

    But yeah, just draw the scene once normally with lighting, then draw the emissive bits again with no lighting.

  6. #6
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,411

    Re: Glow in the Dark Textures

    You can also do it by rendering the glowy bits using a separate material, and turn off lighting for those (or at least turn up ambient rather high).
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

  7. #7
    Junior Member Regular Contributor
    Join Date
    Jun 2003
    Location
    Virginia
    Posts
    212

    Re: Glow in the Dark Textures

    As I remember it, Quake 1's software renderer could render 'overbright' textures, while the original OpenGL renderer could not. This was a pain in games like TF, where certain sneaky units (snipers) had an overbrighted red dot that helped you see them in shadows. OpenGL users couldn't benefit from it, and there was a bunch of complaining. Later OpenGL clients, released after the source was made public, have proper support for overbrighted textures. You should go look at their source.

  8. #8
    Senior Member OpenGL Pro
    Join Date
    Feb 2002
    Location
    Bonn, Germany
    Posts
    1,633

    Re: Glow in the Dark Textures

    Originally posted by bw359:
    Wait a minute.

    Is there a way to do this without having to use extensions? I want the game to work with as many cards as possible.
    If you don't even want to depend on multitexturing, you can do two passes. Render the first pass as usual, for the second pass disable lighting and use additive blending (glBlendFunc(GL_ONE,GL_ONE); ).

    FWIW, I wouldn't consider any hardware without basic multitexturing support to be a worthwhile target. Even a TNT/Vanta can do it single pass ...

  9. #9
    Intern Newbie
    Join Date
    Feb 2002
    Location
    Dallas, TX
    Posts
    33

    Re: Glow in the Dark Textures

    For portability, I would do it one of two ways:

    1. Create an emissive material (already suggested, and good).
    2. Turn off lighting for that polygon.

    These are both simple, and not necessarily pretty solutions, but if you just need to do it and move on, they should work.

  10. #10
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    17

    Re: Glow in the Dark Textures

    Excellent suggestions. Thanks!

    The material sounds best and if not i'll use multi-texturing.

    Thanks to all.

Posting Permissions

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