abc9804
03-14-2008, 07:09 AM
Hello,everyone
I get the depth peeling code from NV demos (C. Everitt).I'm not familier with shader programming. Can you please try to interpret this fragment code?
char _fp_peel[] =
"!!ARBfp1.0\n"
"OPTION ARB_fragment_program_shadow;\n"
"TEMP R0;\n"
"TEX R0.x, fragment.position, texture[0], SHADOWRECT;\n"
"ADD R0.x, R0.x, -0.5;\n"
"KIL R0.x;\n"
"MOV result.color, fragment.color;\n"
"END\n";
Also,I have three problem:how to understand TEX sentence? if fragment.position changes into fragment.texcoord[0],is there any differences? The last one,why R0.x need subtract 0.5?
Many thanks,
I get the depth peeling code from NV demos (C. Everitt).I'm not familier with shader programming. Can you please try to interpret this fragment code?
char _fp_peel[] =
"!!ARBfp1.0\n"
"OPTION ARB_fragment_program_shadow;\n"
"TEMP R0;\n"
"TEX R0.x, fragment.position, texture[0], SHADOWRECT;\n"
"ADD R0.x, R0.x, -0.5;\n"
"KIL R0.x;\n"
"MOV result.color, fragment.color;\n"
"END\n";
Also,I have three problem:how to understand TEX sentence? if fragment.position changes into fragment.texcoord[0],is there any differences? The last one,why R0.x need subtract 0.5?
Many thanks,