bypass pixel shader for non alpha tested shadows

This commit is contained in:
turanszkij
2017-04-30 01:15:54 +02:00
parent 409b4a4cc0
commit ac46438116
3 changed files with 11 additions and 3 deletions
+1 -1
View File
@@ -242,7 +242,7 @@ struct Material
planar_reflections = false;
alphaRef = 0.75f;
alphaRef = 1.0f; // no alpha test by default
}
bool IsTransparent() const { return alpha < 1.0f; }
+9 -1
View File
@@ -3980,7 +3980,15 @@ void wiRenderer::RenderMeshes(const XMFLOAT3& eye, const CulledCollection& culle
}
PSTYPES realPS = GetPSTYPE(shaderType, material);
GetDevice()->BindPS(pixelShaders[realPS], threadID);
if (shaderType == SHADERTYPE_SHADOW && material->alphaRef > 1.0f - 1.0f/256.0f)
{
// bypass pixel shader for non alpha tested shadows
GetDevice()->BindPS(nullptr, threadID);
}
else
{
GetDevice()->BindPS(pixelShaders[realPS], threadID);
}
}
else
{
+1 -1
View File
@@ -7,7 +7,7 @@ namespace wiVersion
// minor features, major updates
const int minor = 11;
// minor bug fixes, alterations, refactors, updates
const int revision = 36;
const int revision = 37;
long GetVersion()