Code: Select all
Error at positions 41 near "ARB_fragment_program_shadow;
" when loading fragment program file groundFPshadow.fpModerator: Moderators
Code: Select all
Error at positions 41 near "ARB_fragment_program_shadow;
" when loading fragment program file groundFPshadow.fpCode: Select all
$ glxinfo |grep render
direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)
OpenGL renderer string: Mesa GLX Indirect
I have same problem on my EEE PC 900.Error at position 41 near "ARB_fragment_program_shadow;
" when loading fragment program file groundFPshadow.fp: 1004: 'ARB_fragment_program_shadow': invalid program option
Code: Select all
http://www.nvidia.com/dev_content/nvopenglspecs/GL_ARB_fragment_program_shadow.txtCode: Select all
...
(8) How would an existing fragment program be ported to use the
program option ARB_fragment_program_shadow?
RESOLVED: Fairly simply, but with a caveat on undefined behavior.
!!ARBfp1.0
# A simple example of shadow map (R <= Dt)
#
# SHOULD make sure that the 2D texture bound to texture unit 0:
# texture format of DEPTH_COMPONENT (for highest quality comparison)
# TEXTURE_MAG_FILTER is NEAREST
# TEXTURE_MIN_FILTER is NEAREST or NEAREST_MIPMAP_NEAREST
# Assumes DEPTH_TEXTURE_MODE is LUMINANCE or INTENSITY
#
TEMP Result;
ALIAS Dt = Result;
TEX Dt, fragment.texcoord[0], texture[0], 2D;
SGE Result, Dt.x, fragment.texcoord[0].z; # R <= Dt
!!ARBfp1.0
OPTION ARB_fragment_program_shadow;
# A simple example of shadow map (R<= Dt)
#
# MUST make sure that the 2D texture bound to texture unit 0:
# texture format of DEPTH_COMPONENT and a
# TEXTURE_COMPARE_MODE of COMPARE_R_TO_TEXTURE
# Otherwise, the Result is undefined.
#
# Remember also that to get R <= Dt to set:
# TEXTURE_COMPARE_FUNC of LEQUAL
#
# A single compare equivalent to the above example will result if:
# TEXTURE_MAG_FILTER is NEAREST
# TEXTURE_MIN_FILTER is NEAREST or NEAREST_MIPMAP_NEAREST
# Otherwise, percent closer filtering may be applied.
#
TEMP Result;
TEX Result, fragment.texcoord[0], texture[0], SHADOW2D;
...
Code: Select all
!!ARBfp1.0
OPTION ARB_fog_linear;
#OPTION ARB_fragment_program_shadow;
TEMP temp;
TEMP shadow,tempColor,shadeColor,shadeTex;
#Newest with "OPTION ARB_fragment_program_shadow;"
#TEX shadow, fragment.texcoord[4], texture[4], SHADOW2D;
#Oldest without extension. May be work
#ALIAS dt = shadow;
#TEX dt,fragment.texcoord[4], texture[4], 2D;
#SGE shadow, dt.x, fragment.texcoord[4].z; # shadow <= dt
##
ALIAS dt = shadow;
TEX dt,fragment.texcoord[4], texture[4], 2D;
SGE shadow, dt.x, fragment.texcoord[4].z; # shadow <= dt
##
ADD shadow.x, 1,-shadow.x;
MUL shadow.x, shadow.x,program.env[11].w;
TEX shadeTex, fragment.texcoord[1], texture[1], 2D;
MUL shadow.x, shadow.x,shadeTex.w;
ADD shadow.x, 1,-shadow.x;
LRP shadeColor, shadow.x, shadeTex, program.env[10];
TEX tempColor, fragment.texcoord[0], texture[0], 2D;
TEX temp, fragment.texcoord[2], texture[2], 2D;
MAD temp, temp, {2,2,2,2},{-1,-1,-1,-1};
ADD tempColor, tempColor,temp;
MUL result.color, tempColor,shadeColor;
MAD result.color.w,fragment.texcoord[2].z,0.1,1;
ENDCode: Select all
Shadows=-1