Revert "Indentation style changed to Horstmann"
This reverts commit f2259f712d.
Conflicts:
src/GameWorld.cpp
src/Systems/PhysicsSystem.cpp
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
uniform vec4 Color;
|
||||
|
||||
in VertexData
|
||||
{ vec3 Position;
|
||||
{
|
||||
vec3 Position;
|
||||
vec3 Normal;
|
||||
vec2 TextureCoord;
|
||||
vec3 ShadowCoord;
|
||||
@@ -12,6 +13,7 @@ in VertexData
|
||||
out vec4 FragmentColor;
|
||||
|
||||
void main()
|
||||
{ //FragmentColor = vec4(1.0 - gl_Color.r, 1.0 - gl_Color.g, 1.0 - gl_Color.b, 0.0);
|
||||
{
|
||||
//FragmentColor = vec4(1.0 - gl_Color.r, 1.0 - gl_Color.g, 1.0 - gl_Color.b, 0.0);
|
||||
FragmentColor = Color;
|
||||
}
|
||||
@@ -17,7 +17,8 @@ uniform float quadraticAttenuation[maxNumberOfLights];
|
||||
uniform float spotExponent[maxNumberOfLights];
|
||||
|
||||
in VertexData
|
||||
{ vec3 Position;
|
||||
{
|
||||
vec3 Position;
|
||||
vec3 Normal;
|
||||
vec2 TextureCoord;
|
||||
vec3 ShadowCoord;
|
||||
@@ -52,10 +53,12 @@ void main()
|
||||
//bias = clamp(bias, 0.0, 0.01);
|
||||
float visibility = 1.0;
|
||||
if (Input.ShadowCoord.x >= 0.0 && Input.ShadowCoord.x <= 1.0 && Input.ShadowCoord.y >= 0.0 && Input.ShadowCoord.y <= 1.0)
|
||||
{ float bias = 0.00005;
|
||||
{
|
||||
float bias = 0.00005;
|
||||
vec4 shadowMapValue = texture(shadowMap, Input.ShadowCoord.xy);
|
||||
if (shadowMapValue.z < clamp(Input.ShadowCoord.z - bias, 0, 1))
|
||||
{ visibility = 0.3;
|
||||
{
|
||||
visibility = 0.3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +67,8 @@ void main()
|
||||
float attenuation;
|
||||
|
||||
for(int i = 0; i < numberOfLights && i < maxNumberOfLights; i++)
|
||||
{ // Light
|
||||
{
|
||||
// Light
|
||||
//vec3 lightPosition = vec3(0, 0, 2);
|
||||
vec3 Ls = specular[i]; // Specular light
|
||||
vec3 Ld = diffuse[i]; // Diffuse light
|
||||
|
||||
@@ -5,5 +5,6 @@ uniform mat4 MVP;
|
||||
out vec4 FragmentColor;
|
||||
|
||||
void main()
|
||||
{ FragmentColor = vec4(1.0, 1.0, 1.0, 1.0);
|
||||
{
|
||||
FragmentColor = vec4(1.0, 1.0, 1.0, 1.0);
|
||||
}
|
||||
@@ -6,20 +6,24 @@ layout(triangles) in;
|
||||
layout(line_strip, max_vertices = 6) out;
|
||||
|
||||
in VertexData
|
||||
{ vec3 Position;
|
||||
{
|
||||
vec3 Position;
|
||||
vec3 Normal;
|
||||
vec2 TextureCoord;
|
||||
} Input[3];
|
||||
|
||||
out VertexData
|
||||
{ vec3 Position;
|
||||
{
|
||||
vec3 Position;
|
||||
vec3 Normal;
|
||||
vec2 TextureCoord;
|
||||
} Output;
|
||||
|
||||
void main()
|
||||
{ for (int i = 0; i < gl_in.length(); i++)
|
||||
{ gl_Position = MVP * vec4(Input[i].Position, 1.0);
|
||||
{
|
||||
for (int i = 0; i < gl_in.length(); i++)
|
||||
{
|
||||
gl_Position = MVP * vec4(Input[i].Position, 1.0);
|
||||
EmitVertex();
|
||||
gl_Position = MVP * vec4(Input[i].Position + Input[i].Normal, 1.0);
|
||||
EmitVertex();
|
||||
|
||||
@@ -5,5 +5,6 @@ uniform mat4 MVP;
|
||||
layout(location = 0) out float FragmentDepth;
|
||||
|
||||
void main()
|
||||
{ FragmentDepth = gl_FragCoord.z;
|
||||
{
|
||||
FragmentDepth = gl_FragCoord.z;
|
||||
}
|
||||
@@ -7,13 +7,15 @@ layout(location = 1) in vec3 Normal;
|
||||
layout(location = 2) in vec2 TextureCoord;
|
||||
|
||||
out VertexData
|
||||
{ vec3 Position;
|
||||
{
|
||||
vec3 Position;
|
||||
vec3 Normal;
|
||||
vec2 TextureCoord;
|
||||
} Output;
|
||||
|
||||
void main()
|
||||
{ gl_Position = MVP * vec4(Position, 1.0);
|
||||
{
|
||||
gl_Position = MVP * vec4(Position, 1.0);
|
||||
|
||||
Output.Position = Position;
|
||||
Output.Normal = Normal;
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
uniform samplerCube CubemapTexture;
|
||||
|
||||
in VertexData
|
||||
{ vec3 TextureCoord;
|
||||
{
|
||||
vec3 TextureCoord;
|
||||
} Input;
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{ FragColor = texture(CubemapTexture, Input.TextureCoord);
|
||||
{
|
||||
FragColor = texture(CubemapTexture, Input.TextureCoord);
|
||||
//FragColor = vec4(1.0, 1.0, 1.0, 0.0);
|
||||
}
|
||||
@@ -5,10 +5,12 @@ uniform mat4 MVP;
|
||||
layout(location = 0) in vec3 Position;
|
||||
|
||||
out VertexData
|
||||
{ vec3 TextureCoord;
|
||||
{
|
||||
vec3 TextureCoord;
|
||||
} Output;
|
||||
|
||||
void main()
|
||||
{ gl_Position = MVP * vec4(Position, 1.0);
|
||||
{
|
||||
gl_Position = MVP * vec4(Position, 1.0);
|
||||
Output.TextureCoord = Position;
|
||||
}
|
||||
@@ -8,14 +8,16 @@ layout(location = 1) in vec3 Normal;
|
||||
layout(location = 2) in vec2 TextureCoord;
|
||||
|
||||
out VertexData
|
||||
{ vec3 Position;
|
||||
{
|
||||
vec3 Position;
|
||||
vec3 Normal;
|
||||
vec2 TextureCoord;
|
||||
vec3 ShadowCoord;
|
||||
} Output;
|
||||
|
||||
void main()
|
||||
{ gl_Position = MVP * vec4(Position, 1.0);
|
||||
{
|
||||
gl_Position = MVP * vec4(Position, 1.0);
|
||||
|
||||
Output.Position = Position;
|
||||
Output.Normal = Normal;
|
||||
|
||||
@@ -3,20 +3,23 @@
|
||||
layout(binding = 0) uniform sampler2D DepthTexture;
|
||||
|
||||
in VertexData
|
||||
{ vec3 Position;
|
||||
{
|
||||
vec3 Position;
|
||||
vec2 TextureCoord;
|
||||
} Input;
|
||||
|
||||
out vec4 FragmentColor;
|
||||
|
||||
float LinearizeDepth(float z)
|
||||
{ float n = 0.1; // camera z near
|
||||
{
|
||||
float n = 0.1; // camera z near
|
||||
float f = 800.0; // camera z far
|
||||
return (2.0 * n) / (f + n - z * (f - n));
|
||||
}
|
||||
|
||||
void main()
|
||||
{ float z = texture(DepthTexture, Input.TextureCoord).x;
|
||||
{
|
||||
float z = texture(DepthTexture, Input.TextureCoord).x;
|
||||
vec4 color = vec4(z, z, z, 0);
|
||||
|
||||
FragmentColor = color;
|
||||
|
||||
@@ -4,12 +4,14 @@ layout(location = 0) in vec3 Position;
|
||||
layout(location = 2) in vec2 TextureCoord;
|
||||
|
||||
out VertexData
|
||||
{ vec3 Position;
|
||||
{
|
||||
vec3 Position;
|
||||
vec2 TextureCoord;
|
||||
} Output;
|
||||
|
||||
void main()
|
||||
{ gl_Position = vec4(Position, 1.0);
|
||||
{
|
||||
gl_Position = vec4(Position, 1.0);
|
||||
|
||||
Output.Position = Position;
|
||||
Output.TextureCoord = TextureCoord;
|
||||
|
||||
Reference in New Issue
Block a user