<div dir="ltr">Trajce,<div><br></div><div>I wrote that code but its old enough to not remember details. But from what I remember original LispSM paper provided some formula to compute Perspecive Matrix which I implemented and their sample code used different formula and also have found later version of code which used another formula again. I was testing all those formulas and finally used one of them but indeed there were differences. In my testing environment (flight sims) one of them worked better for infinite directional lights and one of them worked better for local lights. So I left all of them in the code for reference. But in practice depending on the scene and projection it may turn out that one of them works better than other. Its just lies in the nature of the problem that you cannot have one linear transform which will provide 1:1 distribution between scene pixels and shadow map texels. In my opinion it would be best to look at the papers and try to compute the formula yourself. Various perspective shadow maping algorithms differ by metric used to compute optimized projection matrix. AFAIK LispSM attempts to keep the same ratio (of shadow texel size to scene pixel size) at points in near plane center and far plane center, while Trapezoidal Shadow Map attempt to reach 1:1 ratio at center of projection volume (I could be wrong though, see the papers). I believe other metrics could be invented too. And depending on the metric, solution of optimal perspective matrix will bring different formulas. </div><div><br></div><div>Because of above I believe the best for you would be deriving your own technique and substituting default one with the best choice that works for you.</div><div><br></div><div>Cheers,</div><div>Wojtek<br><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-03 14:38 GMT+02:00 Robert Osfield <span dir="ltr"><<a href="mailto:robert.osfield@gmail.com" target="_blank">robert.osfield@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Nick,<br>
<br>
I'm not the author of the LightSpacePerspectiveShadowMap.cpp so can't<br>
comment too specifically about it.<br>
<br>
This close to a stable release I don't want to go complicating the<br>
build and source code.<br>
<br>
Robert.<br>
<br>
On 3 May 2015 at 13:35, Trajce Nikolov NICK<br>
<div><div class="h5"><<a href="mailto:trajce.nikolov.nick@gmail.com">trajce.nikolov.nick@gmail.com</a>> wrote:<br>
> Hi again Robert,<br>
><br>
> I am seeing your work in the mentioned shadow map technique and as you know<br>
> there are three versions of the algorithm available through #defines. I<br>
> found the one that is not default to work the best for me, but this means I<br>
> have to edit the code every time I update.<br>
><br>
> Any ideas how to make this configurable? Via CMake? Or separate the versions<br>
> of the algorithm across different files? What are your thoughts?<br>
><br>
><br>
> Cheers,<br>
> Nick<br>
><br>
> --<br>
> trajce nikolov nick<br>
><br>
</div></div>> _______________________________________________<br>
> osg-users mailing list<br>
> <a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
> <a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
><br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br></div>