hi, all
I see the following code in Cg Refercence Manual -> cg Profile -> glslv :
glslv void main(float4 position : POSITION,
out float4 opos : POSITION)
{
opos = mul(gl_ModelViewMatrix, position);
}
My question is, does it mean that I can wirte glsl code in .cg/.cgfx file?
Then I write the following code in my .cgfx file:
glslv void main(
uniform float pointRadius,
uniform float pointScale,
uniform vec4 eyePos
)
{
vec4 wpos = vec4(gl_Vertex.xyz, 1.0);
gl_Position = gl_ModelViewProjectionMatrix * wpos;
// calculate window-space point size
vec4 eyeSpacePos = gl_ModelViewMatrix * wpos;
float dist = length(eyeSpacePos.xyz);
gl_PointSize = pointRadius * (pointScale / dist);
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_TexCoord[1] = eyeSpacePos;
gl_FrontColor = gl_Color;
}
But there are serveal errors when i compile this code in FxComposer.
Error error C5059 stdlib "gl_" variables are not accessible
Error error C5059 stdlib "gl_" variables are not accessible
It seems that the variables which contain prefix "gl_" are not recognised by the compiler.
so, can I wirte glsl code in .cg/.cgfx file?
Thank you.



