Merge branch 'master' into Movement

# Conflicts:
#	include/Engine/Network/Client.h
#	resources/DefaultConfig.ini
#	resources/Schema/Entities/OverwatchCamera.xml
#	resources/Schema/Types/Entity.xsd
This commit is contained in:
2016-03-13 22:22:36 +01:00
47 changed files with 13403 additions and 10818 deletions
+1 -4
View File
@@ -1,14 +1,11 @@
#version 430
uniform mat4 M;
uniform mat4 V;
uniform mat4 P;
uniform vec4 Color;
uniform sampler2D texture0;
in VertexData{
vec3 Position;
vec4 ViewSpacePosition;
vec3 Normal;
vec2 TextureCoordinate;
vec4 DiffuseColor;
+5 -1
View File
@@ -2,6 +2,7 @@
#define MAX_SPLITS 4
uniform mat4 PVM;
uniform mat4 M;
uniform mat4 V;
uniform mat4 P;
@@ -23,6 +24,7 @@ uniform float ColorDistanceScalar;
in VertexData{
vec3 Position;
vec4 ViewSpacePosition;
vec3 Normal;
vec3 Tangent;
vec3 BiTangent;
@@ -34,6 +36,7 @@ in VertexData{
out VertexData{
vec3 Position;
vec4 ViewSpacePosition;
vec3 Normal;
vec3 Tangent;
vec3 BiTangent;
@@ -101,6 +104,7 @@ void PassThingsThrough(int index)
// pass through vertex data
Output.Normal = Input[index].Normal;
Output.Position = Input[index].Position;
Output.ViewSpacePosition = Input[index].ViewSpacePosition;
Output.TextureCoordinate = Input[index].TextureCoordinate;
Output.Tangent = Input[index].Tangent;
Output.BiTangent = Input[index].BiTangent;
@@ -175,7 +179,7 @@ void main()
}
// convert to window space
gl_Position = P * V * M * vec4(ExplodedPosition, 1.0);
gl_Position = PVM * vec4(ExplodedPosition, 1.0);
EmitVertex();
}
}
+3 -5
View File
@@ -2,8 +2,6 @@
#define MIN_AMBIENT_LIGHT 0.3
#define MAX_SPLITS 4
uniform mat4 VM;
uniform mat4 M;
uniform mat4 V;
uniform mat4 P;
@@ -65,6 +63,7 @@ layout (std430, binding = 4) buffer LightIndexBuffer
in VertexData{
vec3 Position;
vec4 ViewSpacePosition;
vec3 Normal;
vec3 Tangent;
vec3 BiTangent;
@@ -302,11 +301,10 @@ void main()
vec4 diffuseTexel = texture2D(DiffuseTexture, Input.TextureCoordinate * DiffuseUVRepeat);
vec4 glowTexel = texture2D(GlowMapTexture, Input.TextureCoordinate * GlowUVRepeat);
vec4 specularTexel = texture2D(SpecularMapTexture, Input.TextureCoordinate * SpecularUVRepeat);
vec4 position = VM * vec4(Input.Position, 1.0);
vec4 normal = V * CalcNormalMappedValue(Input.Normal, Input.Tangent, Input.BiTangent, Input.TextureCoordinate * NormalUVRepeat, NormalMapTexture);
normal = normalize(normal);
//vec4 normal = normalize(V * vec4(Input.Normal, 0.0));
vec4 viewVec = normalize(-position);
vec4 viewVec = normalize(-Input.ViewSpacePosition);
vec3 I = normalize(vec3(M * vec4(Input.Position, 1.0)) - CameraPosition);
vec3 R = reflect(-I, Input.Normal);
//R = vec3(P * vec4(R, 1.0));
@@ -333,7 +331,7 @@ void main()
LightResult light_result;
//These if statements should be removed.
if(light.Type == 1) { // point
light_result = CalcPointLightSource(V * light.Position, light.Radius, light.Color, light.Intensity, viewVec, position, normal, light.Falloff);
light_result = CalcPointLightSource(V * light.Position, light.Radius, light.Color, light.Intensity, viewVec, Input.ViewSpacePosition, normal, light.Falloff);
} else if (light.Type == 2) { //Directional
int DepthMapIndex = getShadowIndex(FarDistance);
light_result = CalcDirectionalLightSource(V * light.Direction, light.Color, light.Intensity, viewVec, normal);
+3
View File
@@ -1,5 +1,6 @@
#version 430
uniform mat4 PVM;
uniform mat4 VM;
#define MAX_SPLITS 4
uniform mat4 TIM;
@@ -17,6 +18,7 @@ layout(location = 4) in vec2 TextureCoords;
out VertexData{
vec3 Position;
vec4 ViewSpacePosition;
vec3 Normal;
vec3 Tangent;
vec3 BiTangent;
@@ -31,6 +33,7 @@ void main()
gl_Position = PVM * vec4(Position, 1.0);
//mat4 TIM = transpose(inverse(M));
Output.Position = Position;
Output.ViewSpacePosition = VM * vec4(Position, 1.0);
Output.TextureCoordinate = TextureCoords;
Output.Normal = vec3(TIM * vec4(Normal, 0.0));
Output.Tangent = vec3(TIM * vec4(Tangent, 0.0));
@@ -65,6 +65,7 @@ layout (std430, binding = 4) buffer LightIndexBuffer
in VertexData{
vec3 Position;
vec4 ViewSpacePosition;
vec3 Normal;
vec3 Tangent;
vec3 BiTangent;
@@ -141,11 +142,10 @@ void main()
vec4 diffuseTexel = texture2D(DiffuseTexture, Input.TextureCoordinate * DiffuseUVRepeat);
vec4 glowTexel = texture2D(GlowMapTexture, Input.TextureCoordinate * GlowUVRepeat);
vec4 specularTexel = texture2D(SpecularMapTexture, Input.TextureCoordinate * SpecularUVRepeat);
vec4 position = VM * vec4(Input.Position, 1.0);
vec4 normal = V * CalcNormalMappedValue(Input.Normal, Input.Tangent, Input.BiTangent, Input.TextureCoordinate * NormalUVRepeat, NormalMapTexture);
normal = normalize(normal);
//vec4 normal = normalize(V * vec4(Input.Normal, 0.0));
vec4 viewVec = normalize(-position);
vec4 viewVec = normalize(-Input.ViewSpacePosition);
vec3 I = normalize(vec3(M * vec4(Input.Position, 1.0)) - CameraPosition);
vec3 R = reflect(-I, Input.Normal);
//R = vec3(P * vec4(R, 1.0));
@@ -170,7 +170,7 @@ void main()
LightResult light_result;
//These if statements should be removed.
if(light.Type == 1) { // point
light_result = CalcPointLightSource(V * light.Position, light.Radius, light.Color, light.Intensity, viewVec, position, normal, light.Falloff);
light_result = CalcPointLightSource(V * light.Position, light.Radius, light.Color, light.Intensity, viewVec, Input.ViewSpacePosition, normal, light.Falloff);
} else if (light.Type == 2) { //Directional
light_result = CalcDirectionalLightSource(V * light.Direction, light.Color, light.Intensity, viewVec, normal);
}
@@ -3,6 +3,7 @@
#define MAX_SPLITS 4
uniform mat4 PVM;
uniform mat4 VM;
uniform mat4 TIM;
uniform mat4 M;
uniform mat4 V;
@@ -21,6 +22,7 @@ layout(location = 6) in vec4 BoneWeights;
out VertexData{
vec3 Position;
vec4 ViewSpacePosition;
vec3 Normal;
vec3 Tangent;
vec3 BiTangent;
@@ -34,16 +36,15 @@ void main()
{
mat4 boneTransform = mat4(1);
if(BoneWeights[0] > 0.0f){
boneTransform = BoneWeights[0] * Bones[int(BoneIndices[0])]
+ BoneWeights[1] * Bones[int(BoneIndices[1])]
+ BoneWeights[2] * Bones[int(BoneIndices[2])]
+ BoneWeights[3] * Bones[int(BoneIndices[3])];
}
gl_Position = PVM*boneTransform * vec4(Position, 1.0);
Output.Position = (boneTransform * vec4(Position, 1.0)).xyz;
Output.ViewSpacePosition = VM * vec4(Position, 1.0);
Output.TextureCoordinate = TextureCoords;
Output.Normal = vec3(M * boneTransform * vec4(Normal, 0.0));
Output.Tangent = vec3(M * vec4(Tangent, 0.0));
@@ -2,8 +2,6 @@
#define MIN_AMBIENT_LIGHT 0.3
#define MAX_SPLITS 4
uniform mat4 VM;
uniform mat4 M;
uniform mat4 V;
uniform mat4 P;
@@ -82,6 +80,7 @@ layout (std430, binding = 4) buffer LightIndexBuffer
in VertexData{
vec3 Position;
vec4 ViewSpacePosition;
vec3 Normal;
vec3 Tangent;
vec3 BiTangent;
@@ -362,13 +361,12 @@ void main()
GlowUVRepeat1, GlowUVRepeat2, GlowUVRepeat3);
vec4 specularTexel = CalcBlendedTexel(splatTexel, SpecularMapTexture1, SpecularMapTexture2, SpecularMapTexture3,
SpecularUVRepeat1, SpecularUVRepeat2, SpecularUVRepeat3);
vec4 position = VM * vec4(Input.Position, 1.0);
//vec4 normal = V * CalcNormalMappedValue(Input.Normal, Input.Tangent, Input.BiTangent, Input.TextureCoordinate, SplatMapTexture);
vec4 normal = V * CalcBlendedNormal(splatTexel, NormalMapTexture1, NormalMapTexture2, NormalMapTexture3,
NormalUVRepeat1, NormalUVRepeat2, NormalUVRepeat3);
normal = normalize(normal);
//vec4 normal = normalize(V * vec4(Input.Normal, 0.0));
vec4 viewVec = normalize(-position);
vec4 viewVec = normalize(-Input.ViewSpacePosition);
vec2 tilePos;
tilePos.x = int(gl_FragCoord.x/TILE_SIZE);
@@ -391,7 +389,7 @@ void main()
LightResult light_result;
//These if statements should be removed.
if(light.Type == 1) { // point
light_result = CalcPointLightSource(V * light.Position, light.Radius, light.Color, light.Intensity, viewVec, position, normal, light.Falloff);
light_result = CalcPointLightSource(V * light.Position, light.Radius, light.Color, light.Intensity, viewVec, Input.ViewSpacePosition, normal, light.Falloff);
} else if (light.Type == 2) { //Directional
int DepthMapIndex = getShadowIndex(FarDistance);
light_result = CalcDirectionalLightSource(V * light.Direction, light.Color, light.Intensity, viewVec, normal);
@@ -2,8 +2,6 @@
#define MIN_AMBIENT_LIGHT 0.3
#define MAX_SPLITS 4
uniform mat4 VM;
uniform mat4 M;
uniform mat4 V;
uniform mat4 P;
@@ -80,6 +78,7 @@ layout (std430, binding = 4) buffer LightIndexBuffer
in VertexData{
vec3 Position;
vec4 ViewSpacePosition;
vec3 Normal;
vec3 Tangent;
vec3 BiTangent;
@@ -193,13 +192,12 @@ void main()
GlowUVRepeat1, GlowUVRepeat2, GlowUVRepeat3);
vec4 specularTexel = CalcBlendedTexel(splatTexel, SpecularMapTexture1, SpecularMapTexture2, SpecularMapTexture3,
SpecularUVRepeat1, SpecularUVRepeat2, SpecularUVRepeat3);
vec4 position = VM * vec4(Input.Position, 1.0);
//vec4 normal = V * CalcNormalMappedValue(Input.Normal, Input.Tangent, Input.BiTangent, Input.TextureCoordinate, SplatMapTexture);
vec4 normal = V * CalcBlendedNormal(splatTexel, NormalMapTexture1, NormalMapTexture2, NormalMapTexture3,
NormalUVRepeat1, NormalUVRepeat2, NormalUVRepeat3);
normal = normalize(normal);
//vec4 normal = normalize(V * vec4(Input.Normal, 0.0));
vec4 viewVec = normalize(-position);
vec4 viewVec = normalize(-Input.ViewSpacePosition);
vec2 tilePos;
tilePos.x = int(gl_FragCoord.x/TILE_SIZE);
@@ -220,7 +218,7 @@ void main()
LightResult light_result;
//These if statements should be removed.
if(light.Type == 1) { // point
light_result = CalcPointLightSource(V * light.Position, light.Radius, light.Color, light.Intensity, viewVec, position, normal, light.Falloff);
light_result = CalcPointLightSource(V * light.Position, light.Radius, light.Color, light.Intensity, viewVec, Input.ViewSpacePosition, normal, light.Falloff);
} else if (light.Type == 2) { //Directional
light_result = CalcDirectionalLightSource(V * light.Direction, light.Color, light.Intensity, viewVec, normal);
}
@@ -17,12 +17,10 @@ out VertexData{
void main()
{
mat4 boneTransform = mat4(1);
if(BoneWeights[0] > 0.0f){
boneTransform = BoneWeights[0] * Bones[int(BoneIndices[0])]
+ BoneWeights[1] * Bones[int(BoneIndices[1])]
+ BoneWeights[2] * Bones[int(BoneIndices[2])]
+ BoneWeights[3] * Bones[int(BoneIndices[3])];
}
gl_Position = PVM*boneTransform * vec4(Position, 1.0);
Output.Position = (boneTransform * vec4(Position, 1.0)).xyz;
+2 -4
View File
@@ -1,8 +1,6 @@
#version 430
uniform mat4 M;
uniform mat4 V;
uniform mat4 P;
uniform mat4 PVM;
layout (location = 0) in vec3 Position;
layout (location = 4) in vec2 TextureCoords;
@@ -13,6 +11,6 @@ out VertexData{
void main()
{
gl_Position = P * V * M * vec4(Position, 1.0);
gl_Position = PVM * vec4(Position, 1.0);
Output.TextureCoordinate = TextureCoords;
}
+2 -6
View File
@@ -1,8 +1,6 @@
#version 430
uniform mat4 M;
uniform mat4 V;
uniform mat4 P;
uniform mat4 PVM;
uniform mat4 Bones[100];
layout (location = 0) in vec3 Position;
@@ -17,13 +15,11 @@ out VertexData{
void main()
{
mat4 boneTransform = mat4(1);
if(BoneWeights[0] > 0.0f){
boneTransform = BoneWeights[0] * Bones[int(BoneIndices[0])]
+ BoneWeights[1] * Bones[int(BoneIndices[1])]
+ BoneWeights[2] * Bones[int(BoneIndices[2])]
+ BoneWeights[3] * Bones[int(BoneIndices[3])];
}
gl_Position = P * V * M * boneTransform * vec4(Position, 1.0);
gl_Position = PVM * boneTransform * vec4(Position, 1.0);
Output.TextureCoordinate = TextureCoords;
}