Includes now use the key #include. Fixed a bug where it would crash if the file is not found. Fixed a bug where null terminators where included from the included file, causing it to stop reading after the first included file.

This commit is contained in:
Tleety
2016-02-26 17:46:18 +01:00
parent b3038ef713
commit b1a59e0ed2
3 changed files with 15 additions and 14 deletions
+1 -8
View File
@@ -2,8 +2,6 @@
#define MIN_AMBIENT_LIGHT 0.3
#GLSL "Shaders/Util/CommonUniforms.glsl"
uniform mat4 M;
uniform mat4 V;
uniform mat4 P;
@@ -118,12 +116,7 @@ LightResult CalcDirectionalLightSource(vec4 direction, vec4 color, float intensi
return result;
}
vec4 CalcNormalMappedValue(vec3 normal, vec3 tangent, vec3 bitangent, vec2 textureCoordinate, sampler2D normalMap)
{
mat3 TBN = mat3(tangent, bitangent, normal);
vec3 NormalMap = texture(normalMap, textureCoordinate).xyz * 2.0 - vec3(1.0);
return vec4(TBN * normalize(NormalMap), 0.0);
}
#include "Shaders/Util/CommonUniforms.glsl"
void main()
{
+6 -1
View File
@@ -1 +1,6 @@
#define testtest1234;
vec4 CalcNormalMappedValue(vec3 normal, vec3 tangent, vec3 bitangent, vec2 textureCoordinate, sampler2D normalMap)
{
mat3 TBN = mat3(tangent, bitangent, normal);
vec3 NormalMap = texture(normalMap, textureCoordinate).xyz * 2.0 - vec3(1.0);
return vec4(TBN * normalize(NormalMap), 0.0);
}