Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Sid_Marcus

OpenGL Precompiled lightmaps in OpenGL

This topic is 6104 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The question is: How to store a lightmap? As a matrix? Then building the surface is needed. As an image? Then how? In D3D everything was simple - I drew lightmaps on a DD surface, which was a texture. How to do it in OGL?

Share this post


Link to post
Share on other sites
Advertisement
In OpenGL it is exactly the same!
The LightMap is stored as an Image,
then you build a texture form the Lightmap-Image,
and draw it onto a Quad or something.

For the ''Light''-Effect you have to use Multitexturing...

Hope this helps...

Share this post


Link to post
Share on other sites
I got a question too. I got the multi-texturing of my lightmap working, but then how do I "disable" the multi texturing effect so I can go back to normal texturing.

Share this post


Link to post
Share on other sites
Well,

1. you choose the ''Texturechannel" with the lightmaps
2. glDisable(GL_TEXTURE_2D);

When you want to disable something in multitexturing,
choose the TMU and then use glDisable.

Share this post


Link to post
Share on other sites
Err. I mean heres the scenario.
Enable Texture0 Multi stuff( world texture ).
Enable Texture1 Multi stuff( lm texture ).
Draw them.
Now I want to draw my console like I always have, but the multi texture code is still going through and messing up my console.

Share this post


Link to post
Share on other sites
with gl if u turn something on it stays on until u turn it off

glActiveTexture( GL_TEXTURE1_ARB );
glEnable( GL_TEXTURE_2D );
.. texture unit 1 is now on to turn it off + to only use texture unit0 use

glActiveTexture( GL_TEXTURE1_ARB );
.. texture unit1 is now the one to be acted upon thus any code following will act on this unit, ie to disable it go
glDisable( GL_TEXTURE_2D );
glActiveTexture( GL_TEXTURE0_ARB );
.. unit 0 is now the active one



Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!