Buggy transparent shadows.

Transparent textures might glow.
This commit is contained in:
FakeShemp
2016-02-28 18:00:23 +01:00
parent 14b0a64720
commit 6dd7f1a657
8 changed files with 43 additions and 15 deletions
+2 -2
View File
@@ -327,8 +327,8 @@ void main()
totalLighting.Specular += light_result.Specular;
}
totalLighting.Diffuse *= (1.5 + vec4(AmbientColor.rgb, 1.0)) - vec4(vec3(shadowFactor), 0.0);
totalLighting.Specular *= (1.5 + vec4(AmbientColor.rgb, 1.0)) - vec4(vec3(shadowFactor), 0.0);
totalLighting.Diffuse *= (1.0 + vec4(AmbientColor.rgba)) - vec4(vec3(shadowFactor), 0.0);
totalLighting.Specular *= (1.0 + vec4(AmbientColor.rgba)) - vec4(vec3(shadowFactor), 0.0);
//LightResult getInformation;
+15 -1
View File
@@ -1,10 +1,24 @@
#version 430
layout(location = 0 ) out float ShadowMap;
#define ALPHA_CUTOFF 0.3
layout (binding = 12) uniform sampler2D DiffuseTexture;
uniform float Alpha;
in VertexData{
vec2 TextureCoordinate;
}Input;
layout (location = 0) out float ShadowMap;
void main()
{
vec4 diffuseTexel = texture(DiffuseTexture, Input.TextureCoordinate) * Alpha;
if (diffuseTexel.a < ALPHA_CUTOFF)
{
discard;
}
}
+7 -1
View File
@@ -4,9 +4,15 @@ uniform mat4 M;
uniform mat4 V;
uniform mat4 P;
layout(location = 0) in vec3 Position;
layout (location = 0) in vec3 Position;
layout (location = 4) in vec2 TextureCoords;
out VertexData{
vec2 TextureCoordinate;
}Output;
void main()
{
gl_Position = P * V * M * vec4(Position, 1.0);
Output.TextureCoordinate = TextureCoords;
}