I’m trying to figure out a demo of cass everitt on depth peeling.
I find this fragment shader code.
const char peel_fp[] =
"!!ARBfp1.0
"
"OPTION ARB_fragment_program_shadow;
"
"PARAM offset = program.env[0];
"
"TEMP R0;
"
"MOV R0, fragment.position;
"
"ADD R0.x, R0.x, -offset;
"
"TEX R0.x, R0, texture[0], SHADOWRECT;
"
"ADD R0.x, R0.x, -0.5;
"
"KIL R0.x;
"
"MOV result.color, fragment.color;
"
"END
";
fp_peel.bind();
fp_peel.load(peel_fp);
GL_ERRORS;
const char nopeel_fp[] =
"!!ARBfp1.0
"
"MOV result.color, fragment.color.primary;
"
"END
";
I do not understand what it does. Someone can explain this code. Can it be translated into a shader GLSL?
Thanks.