1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-18 02:41:29 +02:00

fix alpha test for shadows

This commit is contained in:
XProger
2018-06-21 06:02:34 +03:00
parent 62b21b47d9
commit cef172976e
3 changed files with 4 additions and 1 deletions

View File

@@ -86,6 +86,7 @@ struct ShaderCache {
compile(Core::passShadow, Shader::ENTITY, fx, rsShadow);
compile(Core::passShadow, Shader::ENTITY, fx, rsShadow | RS_DISCARD);
compile(Core::passShadow, Shader::MIRROR, fx, rsShadow);
compile(Core::passShadow, Shader::MIRROR, fx, rsShadow | RS_DISCARD);
}
void prepareWater(int fx) {

View File

@@ -379,7 +379,7 @@ struct Level : IGame {
virtual void setRoomParams(int roomIndex, Shader::Type type, float diffuse, float ambient, float specular, float alpha, bool alphaTest = false) {
if (Core::pass == Core::passShadow) {
setShader(Core::pass, type);
setShader(Core::pass, type, false, alphaTest);
return;
}

View File

@@ -394,6 +394,8 @@ uniform vec4 uFogParams;
#ifdef PASS_COMPOSE
vec3 rv = reflect(-normalize(vViewVec.xyz), normalize(vNormal.xyz));
color = textureCube(sEnvironment, normalize(rv));
#else
color = vec4(1.0);
#endif
#else
#if defined(PASS_COMPOSE) && !defined(TYPE_SPRITE)