mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-24 17:13:54 +00:00
re-enable face culling for the terrain
This commit is contained in:
parent
7af95e6a8e
commit
d46f82ef1d
2 changed files with 15 additions and 4 deletions
|
|
@ -152,11 +152,17 @@ void TerrainCellMaterial::_updateDefaultAnisotropy()
|
|||
} // for ( U32 m=0; m < pass.materials.size(); m++ )
|
||||
|
||||
// Set the updated stateblock.
|
||||
desc.setCullMode( GFXCullCCW );
|
||||
pass.stateBlock = GFX->createStateBlock( desc );
|
||||
|
||||
//reflection
|
||||
desc.setCullMode( GFXCullCW );
|
||||
pass.reflectionStateBlock = GFX->createStateBlock(desc);
|
||||
|
||||
// Create the wireframe state blocks.
|
||||
GFXStateBlockDesc wireframe( desc );
|
||||
wireframe.fillMode = GFXFillWireframe;
|
||||
wireframe.setCullMode( GFXCullCCW );
|
||||
pass.wireframeStateBlock = GFX->createStateBlock( wireframe );
|
||||
|
||||
} // for ( U32 p=0; i < (*iter)->mPasses.size(); p++ )
|
||||
|
|
@ -668,15 +674,17 @@ bool TerrainCellMaterial::_createPass( Vector<MaterialInfo*> *materials,
|
|||
if ( prePassMat )
|
||||
desc.addDesc( RenderPrePassMgr::getOpaqueStenciWriteDesc( false ) );
|
||||
|
||||
// Shut off culling for prepass materials (reflection support).
|
||||
if ( prePassMat )
|
||||
desc.setCullMode( GFXCullNone );
|
||||
desc.setCullMode( GFXCullCCW );
|
||||
pass->stateBlock = GFX->createStateBlock(desc);
|
||||
|
||||
pass->stateBlock = GFX->createStateBlock( desc );
|
||||
//reflection stateblock
|
||||
desc.setCullMode( GFXCullCW );
|
||||
pass->reflectionStateBlock = GFX->createStateBlock(desc);
|
||||
|
||||
// Create the wireframe state blocks.
|
||||
GFXStateBlockDesc wireframe( desc );
|
||||
wireframe.fillMode = GFXFillWireframe;
|
||||
wireframe.setCullMode( GFXCullCCW );
|
||||
pass->wireframeStateBlock = GFX->createStateBlock( wireframe );
|
||||
|
||||
return true;
|
||||
|
|
@ -776,6 +784,8 @@ bool TerrainCellMaterial::setupPass( const SceneRenderState *state,
|
|||
|
||||
if ( sceneData.wireframe )
|
||||
GFX->setStateBlock( pass.wireframeStateBlock );
|
||||
else if ( state->isReflectPass( ))
|
||||
GFX->setStateBlock( pass.reflectionStateBlock );
|
||||
else
|
||||
GFX->setStateBlock( pass.stateBlock );
|
||||
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ protected:
|
|||
|
||||
GFXStateBlockRef stateBlock;
|
||||
GFXStateBlockRef wireframeStateBlock;
|
||||
GFXStateBlockRef reflectionStateBlock;
|
||||
|
||||
GFXShaderConstHandle *modelViewProjConst;
|
||||
GFXShaderConstHandle *worldViewOnly;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue