mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-21 15:43:45 +00:00
Corrects OpenGL projection matrix
Corrects OpenGL glPolygonOffset values Corrects Direct3D11 DepthBias values
This commit is contained in:
parent
ad612e218b
commit
54970b0ad6
3 changed files with 43 additions and 39 deletions
|
|
@ -139,16 +139,19 @@ void GFXGLStateBlock::activate(const GFXGLStateBlock* oldState)
|
|||
if(STATE_CHANGE(zFunc))
|
||||
glDepthFunc(GFXGLCmpFunc[mDesc.zFunc]);
|
||||
|
||||
if(STATE_CHANGE(zBias))
|
||||
if (STATE_CHANGE(zBias))
|
||||
{
|
||||
if (mDesc.zBias == 0)
|
||||
{
|
||||
glDisable(GL_POLYGON_OFFSET_FILL);
|
||||
} else {
|
||||
F32 bias = mDesc.zBias * 10000.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
//this assumes 24bit depth
|
||||
const F32 depthMul = F32((1 << 24) - 1);
|
||||
glEnable(GL_POLYGON_OFFSET_FILL);
|
||||
glPolygonOffset(bias, bias);
|
||||
}
|
||||
glPolygonOffset(mDesc.zSlopeBias, mDesc.zBias * depthMul);
|
||||
}
|
||||
}
|
||||
|
||||
if(STATE_CHANGE(zWriteEnable))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue