I just found a bug, that took me many hours to find:
The nvidia opengl driver doesnt work under those circumstances:
- u use a german linux. (LANG=UTF8_DE... or something)
- you have constant float values in your shader. (e.g. 0.5, 1.0 works)
then you get this error when linking vertex and pixel shader:
Fragment info
-------------
Internal error: assembly compile error for fragment shader at offset 828:
-- error message --
line 24, column 27: error: expected '}'
-- internal assembly text --
!!ARBfp1.0
OPTION NV_fragment_program2;
# cgc version 1.6.0011, build date Dec 15 2006 10:27:43
# command line args:
#vendor NVIDIA Corporation
#version 1.6.0.11
#profile fp40
#program main
#semantic DiffuseMap
#semantic BumpMap
#var float4 gl_TexCoord[0] : $vin.TEX0 : TEX0 : -1 : 1
#var float4 gl_TexCoord[1] : : : -1 : 0
#var float4 gl_TexCoord[2] : : : -1 : 0
#var float4 gl_TexCoord[3] : : : -1 : 0
#var float4 gl_TexCoord[4] : : : -1 : 0
#var float4 gl_TexCoord[5] : : : -1 : 0
#var float4 gl_TexCoord[6] : : : -1 : 0
#var float4 gl_TexCoord[7] : : : -1 : 0
#var float4 gl_FragColor : $vout.COLOR : COL : -1 : 1
#var sampler2D DiffuseMap : : texunit 0 : -1 : 1
#var sampler2D BumpMap : : texunit 1 : -1 : 1
#var float3 toLight : $vin.TEX1 : TEX1 : -1 : 1
#const c[0] = 1 0,5 2 0
PARAM c[1] = { { 1, 0,5, 2, 0 } };
TEMP R0;
TEMP R1;
TEMP RC;
TEMP HC;
OUTPUT oCol = result.color;
DP3R R0.x, fragment.texcoord[1], fragment.texcoord[1];
RSQR R0.w, R0.x;
MULR R1.xyz, R0.w, fragment.texcoord[1];
TEX R0.xyz, fragment.texcoord[0], texture[1], 2D;
ADDR R0.xyz, R0, -c[0].y;
MULR R0.xyz, R0, R1;
DP3R R0.x, R0, c[0].z;
MAXR R1.xyz, R0.x, c[0].w;
TEX R0.xyz, fragment.texcoord[0], texture[0], 2D;
MOVR R1.w, c[0].x;
MOVR R0.w, c[0].x;
MULR oCol, R1, R0;
END
# 12 instructions, 2 R-regs, 0 H-regs
The problem is here:
PARAM c[1] = { { 1, 0,5, 2, 0 } };
The GLSL compiler outputs "," instead of "." when converting floats to strings, when language is german.
A workaround is to type "export LANG=C" before launching the program.
Can someone confirm this? Anyway, I want to warn all germans here about that wierd problem.:)
Edit: The command line cgc compiler might have the same problem.