Jump to content
  • Advertisement
Sign in to follow this  
Lopez

Baking Light and shadows in GLSL

This topic is 4452 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

Hi there, My current renderineg engine uses lightmaps that are generated in 3d studio max, using texture baking, and are applied to the scene using a second set of uvw coords. I had an idea, and i just need to know if it's possible... My current setup only allows for static light maps generated in studio max offline, which cannot be altered in realtime. Using the uvw's I assign when unwrapping the mesh in max, is it possible to unwrap the mesh in the shader after it has been lit, and then save this to a texture? I was thinking that if I rendered all the lit triangles to a pixel buffer using the tex coords, I could pack 4 lights to each texture, and by using the 4 color buffers available og my 6600gt, that gives me a total of 16 lights. I was thinking of only storing luminance values in the texture, and passing the colors to the shader as constants.

Share this post


Link to post
Share on other sites
Advertisement
Sorry if this is a little OT, but are you using .3ds as the file format? I've just written a simple loader that reads .3ds files, but I was not aware that more than one uv set can be stored with the mesh.
Could you please tell me how the .3ds stores them (if you actually use .3ds)? I would be interested to know that. Thank you!

Share this post


Link to post
Share on other sites
I am using .3ds. Atm, I save off one mesh with diffuse tex coords, and then I save off a second mesh containing the radiosity maps which have been unwrapped, with a second set of texture coordinates.

I recombine these two files when loading the mesh into a vertex buffer, so i have 2 uvw's for each vertex.

Share this post


Link to post
Share on other sites
Quote:
Original post by Lopez
I am using .3ds. Atm, I save off one mesh with diffuse tex coords, and then I save off a second mesh containing the radiosity maps which have been unwrapped, with a second set of texture coordinates.

I recombine these two files when loading the mesh into a vertex buffer, so i have 2 uvw's for each vertex.


Well...nice trick! ;-) Thank you!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!