mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-14 04:03:46 +00:00
from @rextimmy: shifts sybox rendering to last (kils a bit of overdraw)
This commit is contained in:
parent
f0924c8dcd
commit
f75a9ccd24
4 changed files with 14 additions and 7 deletions
|
|
@ -602,6 +602,7 @@ void SkyBox::_initMaterial()
|
|||
desc.setCullMode( GFXCullNone );
|
||||
desc.setBlend( true );
|
||||
desc.setZReadWrite( true, false );
|
||||
desc.zFunc = GFXCmpLessEqual;
|
||||
mMatInstance->addStateBlockDesc( desc );
|
||||
|
||||
// Also disable lighting on the skybox material by default.
|
||||
|
|
|
|||
|
|
@ -1659,7 +1659,10 @@ void VertPositionGLSL::processVert( Vector<ShaderComponent*> &componentList,
|
|||
|
||||
meta->addStatement( new GenOp( " @ = tMul(@, vec4(@.xyz,1));\r\n",
|
||||
outPosition, modelview, inPosition ) );
|
||||
|
||||
if (fd.materialFeatures[MFT_SkyBox])
|
||||
{
|
||||
meta->addStatement(new GenOp(" @ = @.xyww;\r\n", outPosition, outPosition));
|
||||
}
|
||||
output = meta;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1691,6 +1691,11 @@ void VertPositionHLSL::processVert( Vector<ShaderComponent*> &componentList,
|
|||
meta->addStatement( new GenOp( " @ = mul(@, float4(@.xyz,1));\r\n",
|
||||
outPosition, modelview, inPosition ) );
|
||||
|
||||
if (fd.materialFeatures[MFT_SkyBox])
|
||||
{
|
||||
meta->addStatement(new GenOp(" @ = @.xyww;\r\n", outPosition, outPosition));
|
||||
}
|
||||
|
||||
output = meta;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,12 +45,8 @@ function initRenderManager()
|
|||
// provided in $inTex
|
||||
resolveEffect = "AL_FormatCopy";
|
||||
};
|
||||
DiffuseRenderPassManager.addManager( new RenderPassStateBin() { renderOrder = 0.001; stateToken = AL_FormatToken; } );
|
||||
|
||||
// We really need to fix the sky to render after all the
|
||||
// meshes... but that causes issues in reflections.
|
||||
DiffuseRenderPassManager.addManager( new RenderObjectMgr(SkyBin) { bintype = "Sky"; renderOrder = 0.015; processAddOrder = 0.015; } );
|
||||
|
||||
DiffuseRenderPassManager.addManager( new RenderPassStateBin() { renderOrder = 0.001; stateToken = AL_FormatToken; } );
|
||||
|
||||
DiffuseRenderPassManager.addManager( new RenderProbeMgr(ProbeBin) { bintype = "Probes"; renderOrder = 0.019; processAddOrder = 0.02; } );
|
||||
//DiffuseRenderPassManager.addManager( new RenderVistaMgr() { bintype = "Vista"; renderOrder = 0.15; processAddOrder = 0.15; } );
|
||||
|
||||
|
|
@ -81,6 +77,8 @@ function initRenderManager()
|
|||
|
||||
// Note that the GlowPostFx is triggered after this bin.
|
||||
DiffuseRenderPassManager.addManager( new RenderGlowMgr(GlowBin) { renderOrder = 1.5; processAddOrder = 1.5; } );
|
||||
// Render the sky last
|
||||
DiffuseRenderPassManager.addManager( new RenderObjectMgr(SkyBin) { bintype = "Sky"; renderOrder = 1.55; processAddOrder = 1.55; } );
|
||||
|
||||
// We render any editor stuff from this bin. Note that the HDR is
|
||||
// completed before this bin to keep editor elements from tone mapping.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue