Cubemaps working

This commit is contained in:
Tleety
2016-02-24 14:16:49 +01:00
parent 6f9ce8a0c1
commit 607e83134d
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -136,7 +136,7 @@ void main()
//vec4 normal = normalize(V * vec4(Input.Normal, 0.0));
vec4 viewVec = normalize(-position);
vec3 I = normalize(vec3(M * vec4(Input.Position, 1.0)) - CameraPosition);
vec3 R = reflect(I, Input.Normal);
vec3 R = reflect(-I, Input.Normal);
//R = vec3(P * vec4(R, 1.0));
vec4 reflectionColor = texture(CubeMap, R);
@@ -170,7 +170,7 @@ void main()
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
float specularResult = (specularTexel.r + specularTexel.g + specularTexel.b)/3.0;
//color_result = color_result * clamp(1/specularTexel, 0, 1) + reflectionColor * clamp(specularTexel, 0, 1);
color_result = color_result * clamp(1/specularTexel, 0, 1) + reflectionColor * clamp(specularTexel, 0, 1);
//vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color;
+3 -3
View File
@@ -26,9 +26,9 @@ void main()
mat4 TIM = transpose(inverse(M));
Output.Position = Position;
Output.TextureCoordinate = TextureCoords;
Output.Normal = vec3(TIM) * Normal;
Output.Tangent = vec3(TIM) * Tangent;
Output.BiTangent = vec3(TIM) * BiTangent;
Output.Normal = vec3(TIM * vec4(Normal, 0.0));
Output.Tangent = vec3(TIM * vec4(Tangent, 0.0));
Output.BiTangent = vec3(TIM * vec4(BiTangent, 0.0));
Output.ExplosionColor = vec4(1.0);
Output.ExplosionPercentageElapsed = 0.0;
}