PSSM broken (?) with GLSL 1.50 and Direct Light problem

well PostShadowPSSM15.frag is supposed to work with glsl 1.5 (opengl 3.2), I guess the GL_ARB_texture_gather is here because the textureGather is not part of the 1.5 spec, and is activated through an extension.



The problem here I think is that enabling this extension on your card has not the same effect as on mine for example (ATI 5970).

This is where we should look for a fix



Your workaround is not that incorrect, but won’t work on most of lower hardware than yours.

A better workaround would be to remove the 1.50 shader definition in this file

http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/core-data/Common/MatDefs/Shadow/PostShadowPSSM.j3md

line 23 to 41

You’ll fall back to glsl 1.0 shadow implementation, maybe it will be a bit slower, but will work anywhere.

nehon said:
Your workaround is not that incorrect, but won’t work on most of lower hardware than yours.
A better workaround would be to remove the 1.50 shader definition in this file
You'll fall back to glsl 1.0 shadow implementation, maybe it will be a bit slower, but will work anywhere.

But, if I keep my GLSL 1.00 + GLSL 4.00 configuration, then my hardware will keep using the 4.00 version, and harware which is lower than mine will fall back to version 1.00, won't it? So it's the same that you're proposing, except that some high-end 4.00-compatible cards will use the optimized version.

By the way, maybe just create 3 Techinques?
4.00-compatible with GL_ARB_texture_gather disabled
1.50-compatible with GL_ARB_texture_gather enabled
1.00-compatible without texture_gather
medved said:
But, if I keep my GLSL 1.00 + GLSL 4.00 configuration, then my hardware will keep using the 4.00 version, and harware which is lower than mine will fall back to version 1.00, won't it? So it's the same that you're proposing, except that some high-end 4.00-compatible cards will use the optimized version.

Right!

medved said:
By the way, maybe just create 3 Techinques?
4.00-compatible with GL_ARB_texture_gather disabled
1.50-compatible with GL_ARB_texture_gather enabled
1.00-compatible without texture_gather

Yes at some point we'll do that, but 1.5 with GL_ARB_texture_gather enabled should work on opengl 3.2 capable cards. If it doesn't we must fix the issue.