Lightmapping in Torque3D

Materials, textures, lighting, postfx
  • 1
  • 2
12 posts Page 1 of 2
saindd
Posts: 220
Joined: Wed Apr 15, 2015 3:20 am
by saindd » Mon Sep 28, 2015 8:03 pm
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/
Azaezel
Posts: 363
Joined: Tue Feb 03, 2015 9:50 pm
 
by Azaezel » Mon Sep 28, 2015 11:00 pm
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.)
saindd
Posts: 220
Joined: Wed Apr 15, 2015 3:20 am
by saindd » Tue Sep 29, 2015 4:46 am
Azaezel
Posts: 363
Joined: Tue Feb 03, 2015 9:50 pm
 
by Azaezel » Tue Sep 29, 2015 5:15 am
https://github.com/GarageGames/Torque3D ... n.cpp#L228 for the material entry
https://github.com/GarageGames/Torque3D ... o.cpp#L157 for flipping on the render target it draws to then blends in. (off by default in head)
saindd
Posts: 220
Joined: Wed Apr 15, 2015 3:20 am
by saindd » Tue Sep 29, 2015 5:37 am
Each individual material has a lightmap entry? That seems odd.
Azaezel
Posts: 363
Joined: Tue Feb 03, 2015 9:50 pm
 
by Azaezel » Tue Sep 29, 2015 5:52 am
Extremely. But that is apparently what http://www.garagegames.com/products/purelight plugs into, so a bit hesitant to do much beyond ensuring that the sample @
User avatar
Steve_Yorkshire
was kind enough to throw my way to make sure that end didn't break, what with all the other little things on the present personal plate.
saindd
Posts: 220
Joined: Wed Apr 15, 2015 3:20 am
by saindd » Tue May 17, 2016 1:38 am
No ideas on how to plugin Blender lightmapping into this? Would be really useful to understand how Torque handles lightmaps from external tools.
ThomasPittman
Posts: 2
Joined: Fri May 20, 2016 9:13 pm
by ThomasPittman » Fri May 20, 2016 9:33 pm
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.
Duion
Posts: 670
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sat May 21, 2016 12:53 am
So Torque had internal lightmapping support once?
Azaezel
Posts: 363
Joined: Tue Feb 03, 2015 9:50 pm
 
by Azaezel » Sat May 21, 2016 5:44 am
@
User avatar
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,
Last edited by Azaezel on Sat May 21, 2016 6:41 am, edited 1 time in total.
  • 1
  • 2
12 posts Page 1 of 2

Who is online

Users browsing this forum: No registered users and 1 guest