Hi Diclehan,
I have been working with OSG shadows for years and I can say almost all of the implementations are buggy. Recently I figured out that the Parallel Split Shadow Maps are working the best so far, however their shader implementation is encapsulated in the technique itself and there are no shader hooks to inject your own shader code there. I did some changes that are submitted to the master repo (not yet accepted) and you can find them in my fork
trajcenikolovnick/OpenSceneGraph: OpenSceneGraph git repository (github.com).
I went further and I havn't uploaded my changes yet, but you can enhance this Shadow Map Technique with user shader hooks and submit another change. The idea will be:
- In the header you put something like: void setUserFunctionVertexShader(const std::string& myShaderCode); Same for fragment shader
- make hooks of these strings and call them in the PSSM shaders
Easy. You might want first to give this PSSM a shot, and then try the hooks. If you still struggle, I will help with uploading my changes to my fork and post a PR again
Good luck and drop a line how it goes
Cheers!
Nick