Transparent objects working.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#version 430
|
||||
|
||||
//uniform vec3 La;
|
||||
|
||||
layout (binding=0) uniform sampler2D DiffuseTexture;
|
||||
|
||||
in VertexData
|
||||
{
|
||||
vec3 Position;
|
||||
vec2 TextureCoord;
|
||||
} Input;
|
||||
|
||||
out vec4 FragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 DiffuseTexel = texture(DiffuseTexture, Input.TextureCoord);
|
||||
//vec4 LightingTexel = texture(LightingTexture, Input.TextureCoord);
|
||||
|
||||
//FragmentColor = LightingTexel + vec4(LightingTexel.a, LightingTexel.a, LightingTexel.a, 0.0);
|
||||
//FragmentColor = DiffuseTexel;
|
||||
|
||||
FragmentColor = DiffuseTexel;
|
||||
//FragmentColor = vec4(pow(_FragmentColor.rgb, vec3(1.0 / Gamma)), _FragmentColor.a);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#version 430
|
||||
|
||||
layout(location = 0) in vec3 Position;
|
||||
|
||||
out VertexData
|
||||
{
|
||||
vec3 Position;
|
||||
vec2 TextureCoord;
|
||||
} Output;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = vec4(Position, 1.0);
|
||||
Output.Position = Position;
|
||||
Output.TextureCoord = (vec2(Position) + 1) / 2;
|
||||
}
|
||||
@@ -5,7 +5,6 @@ uniform float Gamma;
|
||||
|
||||
layout (binding=0) uniform sampler2D DiffuseTexture;
|
||||
layout (binding=1) uniform sampler2D LightingTexture;
|
||||
layout (binding=2) uniform sampler2D ShadowTexture;
|
||||
|
||||
in VertexData
|
||||
{
|
||||
@@ -19,12 +18,10 @@ void main()
|
||||
{
|
||||
vec4 DiffuseTexel = texture(DiffuseTexture, Input.TextureCoord);
|
||||
vec4 LightingTexel = texture(LightingTexture, Input.TextureCoord);
|
||||
vec4 ShadowTexel = texture(ShadowTexture, Input.TextureCoord);
|
||||
|
||||
//FragmentColor = LightingTexel + vec4(LightingTexel.a, LightingTexel.a, LightingTexel.a, 0.0);
|
||||
//FragmentColor = DiffuseTexel;
|
||||
|
||||
FragmentColor = DiffuseTexel * (vec4(La, 0.0) + vec4(LightingTexel.rgb, 0.0)) + vec4(LightingTexel.a, LightingTexel.a, LightingTexel.a, 0.0);
|
||||
//FragmentColor = vec4(pow(_FragmentColor.rgb, vec3(1.0 / Gamma)), _FragmentColor.a);
|
||||
|
||||
}
|
||||
@@ -10,11 +10,11 @@ in VertexData {
|
||||
vec2 TextureCoord;
|
||||
} Input;
|
||||
|
||||
out vec4 fragmentColor;
|
||||
out vec4 frag_Diffuse;
|
||||
|
||||
void main() {
|
||||
// Texture
|
||||
vec4 texel = texture(texture0, Input.TextureCoord);
|
||||
|
||||
fragmentColor = texel * Color;
|
||||
frag_Diffuse = texel;
|
||||
}
|
||||
Reference in New Issue
Block a user