Error at positions 41 near "ARB_fragment_program_shadow"

Error at positions 41 near "ARB_fragment_program_shadow"

Discuss everything related to running Spring on your chosen distribution of Linux.

Moderator: Moderators

Post Reply
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Error at positions 41 near "ARB_fragment_program_shadow"

Post by PauloMorfeo »

When i tried to launch Spring (0.78.? + XTA 9.58 + AI libRAI), it gave me the error:

Code: Select all

Error at positions 41 near "ARB_fragment_program_shadow;
" when loading fragment program file groundFPshadow.fp
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Re: Error at positions 41 near "ARB_fragment_program_shadow"

Post by PauloMorfeo »

Well, this explains it, i bet:

Code: 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
Must enable the proprietary drivers of my NVidia so i can have 3D hardware acceleration...
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Error at positions 41 near "ARB_fragment_program_shadow"

Post by hoijui »

yep, thats it! :-)

about your other problem, with too old spring version..
i dont know who maintains the repository for ubuntu 8.04, either Yokozar or clericvash, i think.
maybe you somehow got ot the wrong repository url, or there really is not latest version of it around. then you could still try to compile form source. once you get all the relevant source packages installed over synaptic, you would have to download and compile boost 1.35 or later, as ubuntu LTS does unly have 1.34, and current release spring needs 1.35+.
that, together with the info at:
http://springrts.com/wiki/Building_Spring_on_Linux
should get you ready.
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Re: Error at positions 41 near "ARB_fragment_program_shadow"

Post by PauloMorfeo »

When i "make install" that, will it place the resulting files in the same places? I installed spring with all the default options.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Error at positions 41 near "ARB_fragment_program_shadow"

Post by hoijui »

no, should be an other location by default. the package install should be in /usr, the source build should install under /usr/local.
fylfot
Posts: 1
Joined: 01 Sep 2009, 19:21

Re: Error at positions 41 near "ARB_fragment_program_shadow"

Post by fylfot »

Error at position 41 near "ARB_fragment_program_shadow;
" when loading fragment program file groundFPshadow.fp: 1004: 'ARB_fragment_program_shadow': invalid program option
I have same problem on my EEE PC 900.
Computer tryed to say what mine videocard dont support this "shadow" shader extension. So, I have change "groundFPshadow.fp" (on /usr/share/games/spring/base/springcontent.sdz (is zip archive) \shaders\groundFPshadow.fp ) by pattern:

Code: Select all

http://www.nvidia.com/dev_content/nvopenglspecs/GL_ARB_fragment_program_shadow.txt

Code: 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;
...
Then I got file:

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;
END
Then I repack archive with new file and normally start game (but graphic maybe awful...).

P.S. Sorry about my baaaaaad english.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Error at positions 41 near "ARB_fragment_program_shadow"

Post by hoijui »

the only thing you shoudl do is disabling shadows. in your ~/.springrc file:

Code: Select all

Shadows=-1
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Error at positions 41 near "ARB_fragment_program_shadow"

Post by lurker »

We still haven't had anyone change spring to catch that error and disable shadows for the game?

What does that change to the shader do, does it give you shadows?

I'll make a diff of it in a bit if no one beats me to it.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Error at positions 41 near "ARB_fragment_program_shadow"

Post by hoijui »

hmm.. i actually did this, the auto disable.. i though :/
maybe he needs to disable decalls?
Post Reply

Return to “Linux”