Buggy transparent shadows.
Transparent textures might glow.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user