Inget funkar, broken commit, dont use.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#version 430
|
||||
|
||||
//uniform vec3 La;
|
||||
|
||||
layout (binding=0) uniform sampler2D DiffuseTexture;
|
||||
|
||||
@@ -15,11 +14,11 @@ 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 = 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);
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
#version 430
|
||||
|
||||
uniform vec3 La;
|
||||
uniform float Gamma;
|
||||
|
||||
layout (binding=0) uniform sampler2D DiffuseTexture;
|
||||
layout (binding=1) uniform sampler2D LightingTexture;
|
||||
@@ -12,7 +11,7 @@ in VertexData
|
||||
vec2 TextureCoord;
|
||||
} Input;
|
||||
|
||||
out vec4 FragmentColor;
|
||||
out vec4 frag_Diffuse;
|
||||
|
||||
void main()
|
||||
{
|
||||
@@ -21,7 +20,11 @@ void main()
|
||||
|
||||
//FragmentColor = LightingTexel + vec4(LightingTexel.a, LightingTexel.a, LightingTexel.a, 0.0);
|
||||
//FragmentColor = DiffuseTexel;
|
||||
//FragmentColor = DiffuseTexel;
|
||||
//frag_Diffuse = vec4(LightingTexel.rgb, 0.0);
|
||||
|
||||
//frag_Diffuse = DiffuseTexel * ((vec4(LightingTexel.rgb, 0.0) + vec4(LightingTexel.a, LightingTexel.a, LightingTexel.a, 0.0)));
|
||||
frag_Diffuse = DiffuseTexel * (vec4(La, 0.0) * (vec4(LightingTexel.rgb, 0.0) + vec4(LightingTexel.a, LightingTexel.a, LightingTexel.a, 0.0)));
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -24,6 +24,7 @@ const vec3 ks = vec3(1.0, 1.0, 1.0);
|
||||
const vec3 kd = vec3(1.0, 1.0, 1.0);
|
||||
const vec3 ka = vec3(1.0, 1.0, 1.0);
|
||||
const float kshine = 1.0;
|
||||
const vec3 La = vec3(0.3, 0.3, 0.3);
|
||||
|
||||
|
||||
in VertexData
|
||||
@@ -32,7 +33,7 @@ in VertexData
|
||||
vec2 TextureCoord;
|
||||
} Input;
|
||||
|
||||
out vec4 FragColor;
|
||||
out vec4 frag_Light;
|
||||
|
||||
vec4 phong(vec3 position, vec3 normal, vec3 specular)
|
||||
{
|
||||
@@ -67,6 +68,8 @@ void main()
|
||||
vec4 NormalTexel = texture(NormalsTexture, TextureCoord);
|
||||
vec4 SpecularTexel = texture(SpecularTexture, TextureCoord);
|
||||
|
||||
FragColor = phong(vec3(PositionTexel), vec3(NormalTexel), vec3(SpecularTexel));
|
||||
frag_Light = phong(vec3(PositionTexel), vec3(NormalTexel), vec3(SpecularTexel));
|
||||
//FragColor = DiffuseTexel * vec4(1.0/La, 0.0) * (vec4(La, 0.0) + vec4(LightTexel.rgb, 0.0) + vec4(LightTexel.a, LightTexel.a, LightTexel.a, 0.0));
|
||||
//FragColor = DiffuseTexel * (vec4(La, 0.0) + vec4(LightTexel.rgb, 0.0)) + vec4(LightTexel.a, LightTexel.a, LightTexel.a, 0.0);
|
||||
//FragColor = NormalTexel;
|
||||
}
|
||||
@@ -4,6 +4,7 @@ layout (binding=0) uniform sampler2D PositionTexture;
|
||||
layout (binding=1) uniform sampler2D NormalsTexture;
|
||||
layout (binding=2) uniform sampler2D SpecularTexture;
|
||||
|
||||
|
||||
uniform vec2 ViewportSize;
|
||||
uniform mat4 MVP;
|
||||
uniform mat4 M;
|
||||
@@ -16,10 +17,12 @@ const vec3 ks = vec3(1.0, 1.0, 1.0);
|
||||
const vec3 kd = vec3(1.0, 1.0, 1.0);
|
||||
const vec3 ka = vec3(1.0, 1.0, 1.0);
|
||||
const float kshine = 1.0;
|
||||
const vec3 SunDiffuseLight = vec3(0.3, 0.3, 0.3);
|
||||
const vec3 SunDiffuseLight = vec3(1.0, 1.0, 1.0);
|
||||
const vec3 SunSpecularLight = vec3(1.0, 1.0, 1.0);
|
||||
const vec3 SunPos = directionToSun*vec3(100);
|
||||
const float specularExponent = 5;
|
||||
const float specularExponent = 100;
|
||||
const vec3 La = vec3(0.3, 0.3, 0.3);
|
||||
|
||||
|
||||
|
||||
in VertexData
|
||||
@@ -28,7 +31,7 @@ in VertexData
|
||||
vec2 TextureCoord;
|
||||
} Input;
|
||||
|
||||
out vec4 FragColor;
|
||||
out vec4 frag_Light;
|
||||
|
||||
vec4 phong(vec3 position, vec3 normal, vec3 specular)
|
||||
{
|
||||
@@ -56,6 +59,8 @@ void main()
|
||||
vec4 NormalTexel = texture(NormalsTexture, TextureCoord);
|
||||
vec4 SpecularTexel = texture(SpecularTexture, TextureCoord);
|
||||
|
||||
FragColor = phong(vec3(PositionTexel), vec3(normalize(NormalTexel)), vec3(SpecularTexel));
|
||||
|
||||
frag_Light = phong(vec3(PositionTexel), vec3(NormalTexel), vec3(SpecularTexel));
|
||||
//FragColor = DiffuseTexel * (vec4(La, 0.0) * (vec4(LightTexel.rgb, 0.0) + vec4(LightTexel.a, LightTexel.a, LightTexel.a, 0.0)));
|
||||
//FragColor = NormalTexel;
|
||||
}
|
||||
Reference in New Issue
Block a user