Jump to content

Lightmapping in Torque3D


saindd
 Share

Recommended Posts

Although the realtime lighting in T3D looks OK, it really shows some age compared to other open-source rendering engines like Ogre and Panda. This could be "easily" fixed by introducing lightmapping, instead of refactoring the engine into supporting a modern approach like PBR and realtime GI (as seen in Tesseract).


Right now, i'm lightmapping my scenes in Blender. This has the disadvantage that i have to build all the scenes in Blender and export everything as a single mesh. And i can't use terrains. Is there any plans of adding a lightmapping solution to T3D? Maybe using an open-source offline rendering solution like:


https://github.com/tunabrain/tungsten

http://www.mitsuba-renderer.org/

Link to comment
Share on other sites

For what it's worth, I'll simply note two things in case someone with the time wants to hop on the notion:

1) Those .ml files spit out by basic lighting represent an extremely old version of lightmapping, so that might be a point to drill into.

2) Head already supports lightmapping usage, (UV2) just not generation. (As does PBR. so not an either/or situation.)

Link to comment
Share on other sites

  • 7 months later...

You should be able to put the lightmaps that you generate yourself from Blender into the same material lightmap slots. There's no support currently for generating UV2's or baking lightmaps directly inside of Torque3D. We had planned once on integrating pureLIGHT directly into the Torque3D editor but those talks fell apart years ago.


I don't remember all the details of how the Torque3D lightmapping works, its been many years since I last looked at it. There were flags to indicate which lights were included in the lightmaps to avoid double-lighting meshes. I don't know if much has changed since then.


I did experiment once with changing the way Torque3D internally stores its lightmaps. It wasn't too hard to make them assignable per mesh and point them at a part of a larger lightmap atlas instead of a separate texture like it currently requires. I believe I still have the code for doing that kicking around on my computer, though that would have been for a version of Torque3D many years old by now.

Link to comment
Share on other sites

@ThomasPittman


Not breaking purelight was one of the self-set priorities this end when doin the work thusfar (I wasn't about to be the one to tell folks they blew 500 bucks on nothing with no alternate), so hasn't been much change there. The render target in the backend's been bumped up a from a floating 2nd to a (once we get pbr in) fixed 3rd, and cubemaps assigned to mats on the pbr end multiply into em, but the secondary UV lookup, represented in lightmap ect ect are all still there. Even kept around the hooks for the basic lighting partial lightmapping generators (though don't believe those .ml *results* have been hooked up for quite a while now). By all means, knock yourself out,

Edited by Azaezel
Link to comment
Share on other sites

  • 3 weeks later...
You should be able to put the lightmaps that you generate yourself from Blender into the same material lightmap slots. There's no support currently for generating UV2's or baking lightmaps directly inside of Torque3D. We had planned once on integrating pureLIGHT directly into the Torque3D editor but those talks fell apart years ago.


I don't remember all the details of how the Torque3D lightmapping works, its been many years since I last looked at it. There were flags to indicate which lights were included in the lightmaps to avoid double-lighting meshes. I don't know if much has changed since then.


I did experiment once with changing the way Torque3D internally stores its lightmaps. It wasn't too hard to make them assignable per mesh and point them at a part of a larger lightmap atlas instead of a separate texture like it currently requires. I believe I still have the code for doing that kicking around on my computer, though that would have been for a version of Torque3D many years old by now.

 

If you've still got the code, I wouldn't at all mind having a gander at it. I've been mulling on getting baked lighting back into the fold for 4.0-ish, so anything that'd jumpstart on that would be incredibly useful.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...