T3D 1.1 Beta 3 - Forest Objects visible through terrain as silhouettes when AdvancedLightmapSupport is enabled - CONFIRMED - FIXED
by Steve Acaster · in Torque 3D Professional · 09/20/2010 (12:57 pm) · 8 replies
T3D 1.1 beta 3 - tested in FPS Example -> Deathball Desert
win7
Lighting - Terrain - World Editor
Issue:
Terrain becomes transparent to Forest objects when AdvancedLightmapSupport is enabled (in dynamic/normal lighting) - terrain also becomes very bright.
Repeat:
Boot up Deathball Desert (or any mission with Forest objects and a terrain), whilst in advanced lighting enable AdvancedLightmapSupport via the world editor -> theLevelInfo object, wait for it to initialize, check out the suddenly bright terrain which you can now see objects through.
Suggest:
Fix the transparency issues for terrain vs Forest objects and dampen the brightness of the terrain in Advanced Lighting when AdvancedLightmapSupport is set ... or put a disclaimer not to use the value when you have a terrain in level.
08 APRIL 2011 - FIXED IN 1.1 PREVIEW
win7
Lighting - Terrain - World Editor
Issue:
Terrain becomes transparent to Forest objects when AdvancedLightmapSupport is enabled (in dynamic/normal lighting) - terrain also becomes very bright.
Repeat:
Boot up Deathball Desert (or any mission with Forest objects and a terrain), whilst in advanced lighting enable AdvancedLightmapSupport via the world editor -> theLevelInfo object, wait for it to initialize, check out the suddenly bright terrain which you can now see objects through.
Suggest:
Fix the transparency issues for terrain vs Forest objects and dampen the brightness of the terrain in Advanced Lighting when AdvancedLightmapSupport is set ... or put a disclaimer not to use the value when you have a terrain in level.
08 APRIL 2011 - FIXED IN 1.1 PREVIEW
About the author
One Bloke ... In His Bedroom ... Making Indie Games ...
#3
09/20/2010 (8:08 pm)
Yeah, I remember that and rechecked 1.1beta2 and it only happens with Forest Objects there too ... so maybe there's a typemask needing to be added somewhere ...
#4
09/21/2010 (5:52 pm)
Bug confirmed and thread title updated.
#5
In engine\source\terrain\terrCellMaterial.cpp around line 20:
... then further down in TerrainCellMaterial::_createPass() around line 281:
Then right after that around line 304:
That should do it... let me know if anyone has any further trouble with this.
02/15/2011 (2:13 pm)
Here is the fix.In engine\source\terrain\terrCellMaterial.cpp around line 20:
#include "sceneGraph/sceneState.h"
#include "materials/sceneData.h"
#include "gfx/util/screenspace.h"
#include "lighting/advanced/advancedLightBinManager.h" // ADDED!
AFTER_MODULE_INIT( MaterialManager )
{... then further down in TerrainCellMaterial::_createPass() around line 281:
// How about parallax?
const bool disableParallaxMaps = GFX->getPixelShaderVersion() < 3.0f ||
MATMGR->getExclusionFeatures().hasFeature( MFT_Parallax );
// BEGIN ADDED!
// Has advanced lightmap support been enabled for prepass.
bool advancedLightmapSupport = false;
if ( prePassMat )
{
// This sucks... but it works.
AdvancedLightBinManager *lightBin;
if ( Sim::findObject( "AL_LightBinMgr", lightBin ) )
advancedLightmapSupport = lightBin->MRTLightmapsDuringPrePass();
}
// END ADDED!
// Loop till we create a valid shader!
while( true )
{ Then right after that around line 304:
if ( prePassMat )
{
features.addFeature( MFT_EyeSpaceDepthOut );
features.addFeature( MFT_PrePassConditioner );
if ( advancedLightmapSupport ) // ADDED!
features.addFeature( MFT_RenderTarget1_Zero ); // ADDED!
}
elseThat should do it... let me know if anyone has any further trouble with this.
#6
02/15/2011 (2:32 pm)
Yay! That seems to work fine and lightmaps look a lot better and the terrain isn't day-glow. Nice fix, Tom. :)
#7
02/15/2011 (5:22 pm)
Appears to be cool - nice work and thanx Tom :)
Associate David Montgomery-Blake
David MontgomeryBlake