Thanks for the help, have you successfully managed to use this effect in your own scenes?
He doesn't suggest it in that thread, or in any that I've seen, but it’s a good idea none the less.
I believe there are a couple of problems with this approach however:
Moving the shadow casting source very far away from the scene results in many shadowing artefacts, the shadows appear to become less crisp and more jittery between frames.
There currently isn’t a way I am aware of, to disable falloff for a light source. I believe I would need to change the existing shaders to support this, if I still want to use the current attenuated lighting sometimes I would need to add another context for this (is this correct?).
In my current project, I would like to have a spotlight close to the scene which casts shadows as if from a directional lightsource. This is unconventional, but will enable me to use a single light source to give lighting with attenuation, but also cast parallel shadows. It is roughly how light would enter a room from the sun through a porthole.
To achieve your suggested method and get the effect I want, without extra cost, you would have to do something like this I think:
Code:
mNodeVeryFarAway = Horde3D::addLightNode( RootNode, "Infinite Shadow", 0, "", "SHADOWMAP" );
mNodeCloseToScene = Horde3D::addLightNode( RootNode, "Close Spotlight", 0, "LIGHTING", "" );
However, this isn't supported, you can’t currently render the shadows from one light and use those shadows in a separate lighting pass.
I think it would be worthwhile to add directional shadow casting and lighting support to Horde, and should be straightforward, however I haven't yet been able to get my head around the UpdateShadowMap code.