Hi Guys,

I've am quite new in using osg. I've got a problem when i try to attach 
fragment shader to my scene.

Here is the shader source:

uniform sampler2DShadow shadow;
void main()      
{
    vec4 tmp = shadow2D(shadow, gl_FragCoord.stp);
    if (tmp.x - gl_FragCoord.z <= 0.0)   
        gl_FragColor = gl_Color;    
    else        
        discard;
}


And the following is the error got from the info log:

Fragment info
-------------
Internal error: assembly compile error for fragment shader at offset 658:
-- error message --
line 22, column 13:  error: variable not valid as a source register
-- internal assembly text --
!!ARBfp1.0
OPTION NV_fragment_program2;
# cgc version 1.6.0000, build date Jun  1 2006 17:44:39
# command line args: 
#vendor NVIDIA Corporation
#version 1.6.0.0
#profile fp40
#program main
#semantic shadow
#var float4 gl_Color : $vin.COLOR0 : COL0 : -1 : 1
#var float4 gl_FragCoord : $vin.WPOS : WPOS : -1 : 1
#var float4 gl_FragColor : $vout.COLOR : COL : -1 : 1
#var sampler2DSHADOW shadow :  : texunit 0 : -1 : 1
#var <none>4 $kill_0000 : $vout.$kill : $kill : -1 : 0
PARAM c[1] = { program.local[0] };
TEMP R0;
TEMP RC;
TEMP HC;
OUTPUT oCol = result.color;
TEX   R0.x, fragment.position, texture[0], 2D;
SLERC HC.x, R0, fragment.position.z;
MOVR  oCol, oCol;
MOVR  oCol(GT.x), fragment.color.primary;
KIL   EQ.x;
END
# 5 instructions, 1 R-regs, 0 H-regs

thanks.

Cheers,
Andy



_______________________________________
 YM - 離線訊息
 就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。
 http://messenger.yahoo.com.hk
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to