sinbad wrote:Rather than using the projection matrix, you can use the viewspace depth and the scene_depth_range / shadow_scene_depth_range parameters to normalise it.
Ah yes, I thought about that. But then for the shadow receiver, I need a way to get the shadow's view matrix on its own. But the only auto parameter I can find relating to the shadow's matrices is:
There doesn't seem to be a:
So I can't do the same calculation with the shadow receiver as I did with the shadow caster
Nevermind I went with the delegate thing in the end and it's working nicely. I'm thinking about creating the vertex/fragment program definitions dynamically either directly in my C++ code or with a Python script which will generate a .program file for me. Because it gets a bit difficult to define all the different shader combinations when you have a lot of #if #end statements in your shaders. Not just because of the D3D, OpenGL thing but also when you start having slightly different shadow algorithms to support different hardware you basically need to double the size of your .program file each time you add another variation.
I read about some plans to improve the script parsing in Shoggoth, does this try to address some of these issues?