mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-08 03:28:03 +03:00
Improved shadow maps
This commit is contained in:
parent
51ae05d120
commit
e37dc2c69c
3 changed files with 4 additions and 6 deletions
|
@ -105,8 +105,7 @@ float4 PS(PixelShaderInput input) : SV_TARGET
|
||||||
|
|
||||||
// If clip space z value greater than shadow map value then pixel is in shadow
|
// If clip space z value greater than shadow map value then pixel is in shadow
|
||||||
if (shadowMapDepth < realDepth)
|
if (shadowMapDepth < realDepth)
|
||||||
return float4(0, 0, 0, 1);
|
return float4(output.xyz * colorMul.xyz / 2.0f, 1.0f);
|
||||||
//doLights = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7285,8 +7285,8 @@ bool Renderer11::drawShadowMap()
|
||||||
Matrix view = Matrix::CreateLookAt(lightPos,
|
Matrix view = Matrix::CreateLookAt(lightPos,
|
||||||
itemPos,
|
itemPos,
|
||||||
Vector3(0.0f, -1.0f, 0.0f));
|
Vector3(0.0f, -1.0f, 0.0f));
|
||||||
Matrix projection = Matrix::CreatePerspectiveFieldOfView(90.0f * RADIAN, 1.0f, 128.0f,
|
Matrix projection = Matrix::CreatePerspectiveFieldOfView(90.0f * RADIAN, 1.0f, 64.0f,
|
||||||
(m_shadowLight->Type == LIGHT_TYPE_POINT ? m_shadowLight->Out : m_shadowLight->Range));
|
(m_shadowLight->Type == LIGHT_TYPE_POINT ? m_shadowLight->Out : m_shadowLight->Range) * 1.2f);
|
||||||
|
|
||||||
m_stCameraMatrices.View = view.Transpose();
|
m_stCameraMatrices.View = view.Transpose();
|
||||||
m_stCameraMatrices.Projection = projection.Transpose();
|
m_stCameraMatrices.Projection = projection.Transpose();
|
||||||
|
|
|
@ -105,8 +105,7 @@ float4 PS(PixelShaderInput input) : SV_TARGET
|
||||||
|
|
||||||
// If clip space z value greater than shadow map value then pixel is in shadow
|
// If clip space z value greater than shadow map value then pixel is in shadow
|
||||||
if (shadowMapDepth < realDepth)
|
if (shadowMapDepth < realDepth)
|
||||||
return float4(0, 0, 0, 1);
|
return float4(output.xyz * colorMul.xyz / 2.0f, 1.0f);
|
||||||
//doLights = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue