Shader compile Error


Im Programming a simple racing game using the jMonkeyEngine (Alpha 4) and recentrly bought a new PC. So I tried to continue Programming on the new Hardware but I always get an Error when I try to run my Project:

com.jme3.renderer.RendererException: compile error in:ShaderSource[name=Common/MatDefs/Shadow/PostShadowPSSM15.frag, defines, type=Fragment] error:0(90) : error C1115: unable to find compatible overloaded function “textureGather(sampler2DShadow, vec2, float)”

I searched through this Forum and came to the conclusion that it could have something to do with my Graphics-Card. Im using a GTX580. Im Programming on Windows 7 64bit. I’m also using the latest drivers.

Could it be that I have to wait for a driver update or can I possibly fix this on my own?

Thanks in advance!

Well the easy way would be to rid yourself of the PSSM filter as a whole for the time being, but did you update to the latest nightly build yet?

Looking into the frag file a bit more, it appears this piece is used when HARDWARE_SHADOWS is on, you may try setting comparemode (a setting for PSSMShadowRenderer) to software, although I may speak complete rubbish here, it’s nearly 3 AM for me and I need some sleep…

Another thing you may try to get around this problem would be to open up PostShadowPSSM.j3md (In Common.MatDefs.Shadow) and remove lines 22 up to 42, these:

[java]Technique {

VertexShader GLSL150: Common/MatDefs/Shadow/PostShadowPSSM.vert

FragmentShader GLSL150: Common/MatDefs/Shadow/PostShadowPSSM15.frag

WorldParameters {




Defines {

HARDWARE_SHADOWS : HardwareShadows

FILTER_MODE : FilterMode



RenderState {

Blend Modulate



Right under this bit of code is nearly the same piece again but using the GLSL100 mode instead of the GLSL150, it’s possible that your gfx card does not support a function that is assumed to be there when using GLSL150, so just leave that second piece. Just see what happens next, as the filter will work with older functions instead then.

Sooo, that’s 3 thing you may try before I wake up today, try them preferably in that order. Shout again if stuff still fails :wink:


Thanks for your reply!

I tried editing PostShadowPSSM.j3md and now shadows are working!

Thanks a lot