// interested in recording depth. Also only need back faces when rendering the shadow maps
// Load PSSM shader.
final ContextCapabilities caps = ContextManager.getCurrentContext().getCapabilities();
if (caps.isGLSLSupported()) {
_pssmShader = new GLSLShaderObjectsState();
try {
_pssmShader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(
ParallelSplitShadowMapPass.class, "com/ardor3d/extension/shadow/map/pssm.vert"));
if (filter == Filter.None) {
_pssmShader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(
ParallelSplitShadowMapPass.class, "com/ardor3d/extension/shadow/map/pssm.frag"));
} else if (filter == Filter.Pcf) {
_pssmShader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(
ParallelSplitShadowMapPass.class, "com/ardor3d/extension/shadow/map/pssmPCF.frag"));
}
} catch (final IOException ex) {
logger.logp(Level.SEVERE, getClass().getName(), "init(Renderer)", "Could not load shaders.", ex);
}
_mainShader = _pssmShader;
_pssmDebugShader = new GLSLShaderObjectsState();
try {
_pssmDebugShader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(
ParallelSplitShadowMapPass.class, "com/ardor3d/extension/shadow/map/pssmDebug.vert"));
_pssmDebugShader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(
ParallelSplitShadowMapPass.class, "com/ardor3d/extension/shadow/map/pssmDebug.frag"));