<div dir="ltr">Hi Wojtek,<div><br></div><div>thanks for the very techy reply :-). I was more into organizing these three available algorithms at present available through #defines into more structured form (into three separate .cpp files? CMake options). My target is also flight sim and the work you have done there is really great - actually I found your work the best from all the shadow mapping techniques available in the OSG project. So again, maybe we all users of this code think how to better organize it, maybe you propose since you are the author. For a user to switch to another available algorithm after every code update they have to change the #define at the header of the file every time. What do you propose?</div><div><br></div><div>And thanks again !</div><div><br></div><div>Cheers,</div><div>Trajce</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 3, 2015 at 11:55 PM, Wojciech Lewandowski <span dir="ltr"><<a href="mailto:w.p.lewandowski@gmail.com" target="_blank">w.p.lewandowski@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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="HOEnZb"><div class="h5"><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><<a href="mailto:trajce.nikolov.nick@gmail.com" target="_blank">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" target="_blank">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" target="_blank">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>
</div></div><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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">trajce nikolov nick<br></div>
</div>