shader compilation failures

For test results, bug reports, announcements of new builds etc.

Moderators: another_commander, winston, Getafix

Post Reply
dybal
Deadly
Deadly
Posts: 204
Joined: Mon Feb 10, 2020 12:47 pm
Location: São Paulo, Brasil

shader compilation failures

Post by dybal »

Have been getting a few of those lately:

Code: Select all

  22:20:29.671 [shader.compile.failure]: ***** ERROR: GLSL fragment shader compilation failed for oolite-default-shader.fragment:
>>>>> GLSL log:
0(430) : warning C1503: undefined variable "eyeVector"
0(430) : error C1008: undefined variable "eyeVector"


22:20:29.671 [shader.load.failed]: ***** ERROR: Could not build shader oolite-tangent-space-vertex.vertex/oolite-default-shader.fragment.
22:20:29.671 [material.synthesize.loop]: Synthesis loop for material aquatics_barracuda.png.

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5594
Joined: Wed Feb 28, 2007 7:54 am

Re: shader compilation failures

Post by another_commander »

Do you happen to have any stray copies of oolite-default-shader.vertex/.fragment in any of your OXP folders? eyeVector is supposed to always be defined and was used in the old lighting model too.

Edit: I think I can see what's happening. eyeVector is not defined if the NEED_EYEVECTOR macro in the shader is also not defined. For it to not be defined, the macros OOSTD_SPECULAR and OOSTD_NORMAL_AND_PARALLAX_MAP must both not be defined. Theoretically, a ship without any specular defaults could trigger this but I think default specular values are always applied. Will need to investigate because I can't get it to appear so far no matter what I disable. For now, a possible solution could be to move the #define OODIFFUSE_ORENNAYAR 1 line before the #define NEED_EYEVECTOR [...] one and change NEED_EYEVECTOR to

Code: Select all

#define NEED_EYE_VECTOR (OOSTD_SPECULAR || OOSTD_NORMAL_AND_PARALLAX_MAP || OODIFFUSE_ORENNAYAR)
.

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5594
Joined: Wed Feb 28, 2007 7:54 am

Re: shader compilation failures

Post by another_commander »

Reproduced it with the barracuda. The fix above works. Should be getting committed soon. Thanks for the catch.

Post Reply