Custom Lightmaps for TGEA Interiors
by Ryan Mounts · 06/17/2008 (4:51 pm) · 3 comments
Custom Lightmaps for TGEA Interiors
This resource builds upon the previous map2dif_plus v1.1 resource. The previous resource allows you to place custom lightmaps into your DIFs and includes the engine code changes needed to make these new "custom lightmapped DIFs" useful in TGE 1.5.2. This resource consists of the engine code changes needed to get your custom lightmaps into TGEA 1.7.1. The map2dif_plus v1.1 executable has not changed, so any custom lightmap DIFs created using the old resource will work in TGEA after implementing this resource. Of course you'll have to create the proper "materials.cs" file to port your interior over from TGE to TGEA. :)
I have to admit, this code hasn't been tested thoroughly. I've been on travel and only have access to my old work laptop, which doesn't play very nicely with TGEA (~3 fps). But I thought I'd go ahead and release this so others can play with it since there seemed to be some interest generated after the release of the TGE version. Also with the debut of TGEA 1.7.1, my next project might be to modify the new map2dif_plus_tgea to allow custom lightmaps.
Issues:
- Adding per pixel specular to interior materials doesn't render the way you'd expect.
- "UseAmbient" overrides all Torque light ambient values... need to change that to just override the sun.
Here's a couple of images showing one use of custom lightmaps in TGEA 1.7.1 (the interior was created by the talented Benjamin Naulls).
Before Relight

You can see two churches. The one of the left has a blank internal lightmap (that's why it's black). The one on the right has ambient occlusion and bounced light "baked" into its internal lightmap using map2dif_plus v1.1.
After Relight

Looking from the back of the churches, you can see the default TGEA lighting on the previously black church on the right. The one on the left has "UseAmbient" checked with an ambient override color of "0 0 0 1" to allow the custom lightmap to show through in the shadowed areas. Refer to the map2dif_plus v1.1 tutorial to see how to use these features.
This resource builds upon the previous map2dif_plus v1.1 resource. The previous resource allows you to place custom lightmaps into your DIFs and includes the engine code changes needed to make these new "custom lightmapped DIFs" useful in TGE 1.5.2. This resource consists of the engine code changes needed to get your custom lightmaps into TGEA 1.7.1. The map2dif_plus v1.1 executable has not changed, so any custom lightmap DIFs created using the old resource will work in TGEA after implementing this resource. Of course you'll have to create the proper "materials.cs" file to port your interior over from TGE to TGEA. :)
I have to admit, this code hasn't been tested thoroughly. I've been on travel and only have access to my old work laptop, which doesn't play very nicely with TGEA (~3 fps). But I thought I'd go ahead and release this so others can play with it since there seemed to be some interest generated after the release of the TGE version. Also with the debut of TGEA 1.7.1, my next project might be to modify the new map2dif_plus_tgea to allow custom lightmaps.
Issues:
- Adding per pixel specular to interior materials doesn't render the way you'd expect.
- "UseAmbient" overrides all Torque light ambient values... need to change that to just override the sun.
Here's a couple of images showing one use of custom lightmaps in TGEA 1.7.1 (the interior was created by the talented Benjamin Naulls).
Before Relight

You can see two churches. The one of the left has a blank internal lightmap (that's why it's black). The one on the right has ambient occlusion and bounced light "baked" into its internal lightmap using map2dif_plus v1.1.
After Relight

Looking from the back of the churches, you can see the default TGEA lighting on the previously black church on the right. The one on the left has "UseAmbient" checked with an ambient override color of "0 0 0 1" to allow the custom lightmap to show through in the shadowed areas. Refer to the map2dif_plus v1.1 tutorial to see how to use these features.
About the author
Torque 3D Owner ando