GLSL source for fragment shader 2434: #version 120 #define SHADER_MODEL_2 #ifndef GL_ARB_half_float_pixel #define half float #define half2 vec2 #define half3 vec3 #define half4 vec4 #endif #define NG3D_PLATFORM_LINUX #define NG3D_ARB_texture_non_power_of_two #define samplerRT sampler2D #define textureRT texture2D #define NG3D_MAX_HW_BONES 48 #define _EMMISIVE #line 0 #extension GL_ARB_texture_rectangle : enable #pragma optionNV(fastmath on) #pragma optionNV(fastprecision on) half GetShadowMapFactor(vec4 vPositionWS); vec3 GetSpecularLighting(vec3 Normal, vec3 EyeDir, float specPower); uniform vec4 CameraPosition; uniform vec4 WorldOffset; uniform mat4 ViewMatrix; uniform vec4 FrustumPlanes; varying vec3 wPos; uniform samplerRT GBuffer0; uniform samplerRT GBuffer1; uniform samplerRT GBuffer2; uniform samplerRT GBuffer3; uniform samplerRT LinearDepth; void GBuffer_Set(vec3 Normal, vec3 Color, float SpecPower, float SpecFactor, vec3 Accum, float AO) { //float depth = abs((ViewMatrix * vec4(wPos, 1.0)).z) / FrustumPlanes.y; gl_FragData[0] = vec4(Normal, SpecPower); gl_FragData[1] = vec4(Color, SpecFactor); gl_FragData[2] = vec4(Accum, AO); } void GBuffer_Get(out vec3 Normal, out vec3 Color, out float SpecPower, out float SpecFactor, out vec3 Accum, out float AO) { vec4 GB0, GB1, GB2;//, GB3; GB0 = textureRT(GBuffer0, gl_TexCoord[0].xy); GB1 = textureRT(GBuffer1, gl_TexCoord[0].xy); GB2 = textureRT(GBuffer2, gl_TexCoord[0].xy); //GB3 = textureRT(GBuffer3, gl_TexCoord[0].xy); Normal = GB0.rgb; Color = GB1.rgb; SpecPower = GB0.a; SpecFactor = GB1.a; Accum = GB2.rgb; AO = GB2.a; } vec4 GBuffer_GetPositionES(vec2 texCoord, vec4 screenCoords) { float fDepth = textureRT(LinearDepth, texCoord).r; vec3 vPositionES = screenCoords.xyz * fDepth; return vec4(vPositionES, 1.0); } vec3 GBuffer_GetNormalWS(in vec2 texCoord) { return textureRT(GBuffer0, texCoord).rgb; } void GBuffer_CheckWriteMask(in vec2 texCoord) { if(textureRT(LinearDepth, texCoord).r >= 0.999999999) discard; } bool GBuffer_GetWriteMask(in vec2 texCoord) { return abs(textureRT(LinearDepth, texCoord).r) >= 0.999999999; } GLSL IR for shader 2434: ( (declare (uniform ) sampler2D LinearDepth) (declare (uniform ) sampler2D GBuffer3) (declare (uniform ) sampler2D GBuffer2) (declare (uniform ) sampler2D GBuffer1) (declare (uniform ) sampler2D GBuffer0) (declare (in ) vec3 wPos) (declare (uniform ) vec4 FrustumPlanes) (declare (uniform ) mat4 ViewMatrix) (declare (uniform ) vec4 WorldOffset) (declare (uniform ) vec4 CameraPosition) (declare (in ) vec4 gl_FragCoord) (declare (in ) bool gl_FrontFacing) (declare (out ) vec4 gl_FragColor) (declare (out ) float gl_FragDepth) (declare (in ) vec4 gl_Color) (declare (in ) vec4 gl_SecondaryColor) (declare (in ) float gl_FogFragCoord) (declare (uniform ) mat4 gl_ModelViewMatrix) (declare (uniform ) mat4 gl_ProjectionMatrix) (declare (uniform ) mat4 gl_ModelViewProjectionMatrix) (declare (uniform ) mat3 gl_NormalMatrix) (declare (uniform ) mat4 gl_ModelViewMatrixInverse) (declare (uniform ) mat4 gl_ProjectionMatrixInverse) (declare (uniform ) mat4 gl_ModelViewProjectionMatrixInverse) (declare (uniform ) mat4 gl_ModelViewMatrixTranspose) (declare (uniform ) mat4 gl_ProjectionMatrixTranspose) (declare (uniform ) mat4 gl_ModelViewProjectionMatrixTranspose) (declare (uniform ) mat4 gl_ModelViewMatrixInverseTranspose) (declare (uniform ) mat4 gl_ProjectionMatrixInverseTranspose) (declare (uniform ) mat4 gl_ModelViewProjectionMatrixInverseTranspose) (declare (uniform ) float gl_NormalScale) (declare (uniform ) gl_LightModelParameters gl_LightModel) (declare (uniform ) vec2 gl_BumpRotMatrix0MESA) (declare (uniform ) vec2 gl_BumpRotMatrix1MESA) (declare (uniform ) vec4 gl_FogParamsOptimizedMESA) (declare () int gl_MaxLights) (declare () int gl_MaxClipPlanes) (declare () int gl_MaxTextureUnits) (declare () int gl_MaxTextureCoords) (declare () int gl_MaxVertexAttribs) (declare () int gl_MaxVertexUniformComponents) (declare () int gl_MaxVaryingFloats) (declare () int gl_MaxVertexTextureImageUnits) (declare () int gl_MaxCombinedTextureImageUnits) (declare () int gl_MaxTextureImageUnits) (declare () int gl_MaxFragmentUniformComponents) (declare (uniform ) (array mat4 8) gl_TextureMatrix) (declare (uniform ) (array mat4 8) gl_TextureMatrixInverse) (declare (uniform ) (array mat4 8) gl_TextureMatrixTranspose) (declare (uniform ) (array mat4 8) gl_TextureMatrixInverseTranspose) (declare (uniform ) gl_DepthRangeParameters gl_DepthRange) (declare (uniform ) (array vec4 8) gl_ClipPlane) (declare (uniform ) gl_PointParameters gl_Point) (declare (uniform ) gl_MaterialParameters gl_FrontMaterial) (declare (uniform ) gl_MaterialParameters gl_BackMaterial) (declare (uniform ) (array gl_LightSourceParameters 8) gl_LightSource) (declare (uniform ) gl_LightModelProducts gl_FrontLightModelProduct) (declare (uniform ) gl_LightModelProducts gl_BackLightModelProduct) (declare (uniform ) (array gl_LightProducts 8) gl_FrontLightProduct) (declare (uniform ) (array gl_LightProducts 8) gl_BackLightProduct) (declare (uniform ) (array vec4 8) gl_TextureEnvColor) (declare (uniform ) (array vec4 8) gl_EyePlaneS) (declare (uniform ) (array vec4 8) gl_EyePlaneT) (declare (uniform ) (array vec4 8) gl_EyePlaneR) (declare (uniform ) (array vec4 8) gl_EyePlaneQ) (declare (uniform ) (array vec4 8) gl_ObjectPlaneS) (declare (uniform ) (array vec4 8) gl_ObjectPlaneT) (declare (uniform ) (array vec4 8) gl_ObjectPlaneR) (declare (uniform ) (array vec4 8) gl_ObjectPlaneQ) (declare (uniform ) gl_FogParameters gl_Fog) (declare (uniform ) (array vec4 33) gl_CurrentAttribVertMESA) (declare (uniform ) (array vec4 32) gl_CurrentAttribFragMESA) (declare (in ) (array vec4 0) gl_TexCoord) (declare () int gl_MaxDrawBuffers) (declare (out ) (array vec4 8) gl_FragData) (declare (in ) vec2 gl_PointCoord) (function GetShadowMapFactor (signature float (parameters (declare (in ) vec4 vPositionWS) ) ( )) ) (function GetSpecularLighting (signature vec3 (parameters (declare (in ) vec3 Normal) (declare (in ) vec3 EyeDir) (declare (in ) float specPower) ) ( )) ) (function GBuffer_Set (signature void (parameters (declare (in ) vec3 Normal) (declare (in ) vec3 Color) (declare (in ) float SpecPower) (declare (in ) float SpecFactor) (declare (in ) vec3 Accum) (declare (in ) float AO) ) ( (declare (temporary ) vec4 vec_ctor) (assign (xyz) (var_ref vec_ctor) (var_ref Normal) ) (assign (w) (var_ref vec_ctor) (var_ref SpecPower) ) (assign (xyzw) (array_ref (var_ref gl_FragData) (constant int (0)) ) (var_ref vec_ctor) ) (declare (temporary ) vec4 vec_ctor@4300) (assign (xyz) (var_ref vec_ctor@4300) (var_ref Color) ) (assign (w) (var_ref vec_ctor@4300) (var_ref SpecFactor) ) (assign (xyzw) (array_ref (var_ref gl_FragData) (constant int (1)) ) (var_ref vec_ctor@4300) ) (declare (temporary ) vec4 vec_ctor@4301) (assign (xyz) (var_ref vec_ctor@4301) (var_ref Accu[08/10/2012 17:26:37] [ShaderGL][shader_gl_parser.cpp(392)] Program (material.basic_ts_emmisive) info log: error: linking with uncompiled shader m) ) (assign (w) (var_ref vec_ctor@4301) (var_ref AO) ) (assign (xyzw) (array_ref (var_ref gl_FragData) (constant int (2)) ) (var_ref vec_ctor@4301) ) )) ) (function GBuffer_Get (signature void (parameters (declare (out ) vec3 Normal) (declare (out ) vec3 Color) (declare (out ) float SpecPower) (declare (out ) float SpecFactor) (declare (out ) vec3 Accum) (declare (out ) float AO) ) ( (declare () vec4 GB1) (declare () vec4 GB0) (declare (temporary ) vec4 texture2D_retval) (call texture2D (var_ref texture2D_retval) ((var_ref GBuffer0) (swiz xy (array_ref (var_ref gl_TexCoord) (constant int (0)) ) ))) (assign (xyzw) (var_ref GB0) (var_ref texture2D_retval) ) (declare (temporary ) vec4 texture2D_retval@4302) (call texture2D (var_ref texture2D_retval@4302) ((var_ref GBuffer1) (swiz xy (array_ref (var_ref gl_TexCoord) (constant int (0)) ) ))) (assign (xyzw) (var_ref GB1) (var_ref texture2D_retval@4302) ) (declare (temporary ) vec4 texture2D_retval@4303) (call texture2D (var_ref texture2D_retval@4303) ((var_ref GBuffer2) (swiz xy (array_ref (var_ref gl_TexCoord) (constant int (0)) ) ))) (assign (xyz) (var_ref Normal) (swiz xyz (var_ref GB0) )) (assign (xyz) (var_ref Color) (swiz xyz (var_ref GB1) )) (assign (x) (var_ref SpecPower) (swiz w (var_ref GB0) )) (assign (x) (var_ref SpecFactor) (swiz w (var_ref GB1) )) (assign (xyz) (var_ref Accum) (swiz xyz (var_ref texture2D_retval@4303) )) (assign (x) (var_ref AO) (swiz w (var_ref texture2D_retval@4303) )) )) ) (function texture2D (signature vec4 (parameters (declare (in ) sampler2D sampler) (declare (in ) vec2 P) ) ( )) ) (function GBuffer_GetPositionES (signature vec4 (parameters (declare (in ) vec2 texCoord) (declare (in ) vec4 screenCoords) ) ( (declare (temporary ) vec4 texture2D_retval) (call texture2D (var_ref texture2D_retval) ((var_ref LinearDepth) (var_ref texCoord) )) (declare (temporary ) vec4 vec_ctor) (assign (w) (var_ref vec_ctor) (constant float (1.000000)) ) (assign (xyz) (var_ref vec_ctor) (expression vec3 * (swiz xyz (var_ref screenCoords) )(swiz x (var_ref texture2D_retval) )) ) (return (var_ref vec_ctor) ) )) ) (function GBuffer_GetNormalWS (signature vec3 (parameters (declare (in ) vec2 texCoord) ) ( (declare (temporary ) vec4 texture2D_retval) (call texture2D (var_ref texture2D_retval) ((var_ref GBuffer0) (var_ref texCoord) )) (return (swiz xyz (var_ref texture2D_retval) )) )) ) (function GBuffer_CheckWriteMask (signature void (parameters (declare (in ) vec2 texCoord) ) ( (declare (temporary ) vec4 texture2D_retval) (call texture2D (var_ref texture2D_retval) ((var_ref LinearDepth) (var_ref texCoord) )) (if (expression bool >= (swiz x (var_ref texture2D_retval) )(constant float (1.000000)) ) ( (discard ) ) ()) )) ) (function GBuffer_GetWriteMask (signature bool (parameters (declare (in ) vec2 texCoord) ) ( (declare (temporary ) vec4 texture2D_retval) (call texture2D (var_ref texture2D_retval) ((var_ref LinearDepth) (var_ref texCoord) )) (declare (temporary ) float abs_retval) (call abs (var_ref abs_retval) ((swiz x (var_ref texture2D_retval) ))) (return (expression bool >= (var_ref abs_retval) (constant float (1.000000)) ) ) )) ) (function abs (signature float (parameters (declare (in ) float arg0) ) ( )) ) ) GLSL shader program 2432 failed to link GLSL shader program 2432 info log: error: linking with uncompiled shader [08/10/2012 17:26:37] [logger.cpp(72)] Shader material.basic_ts_emmisive link failed [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [logger.cpp(72)] GL_INVALID_OPERATION in glGetUniformLocation(program not linked) [08/10/2012 17:26:37] [ShaderGL][shader_gl_parser.cpp(1512)] Shader material.basic_ts_emmisive validation failed