Hi. I see. After I made shadowViewProjectionMatrix = V * P * translate(1, 1, 1) * scale(0.5, 0.5, 0.5) I finally got almost correct shadows: http://youtu.be/8KOCxiUkNsQ The final fragment shader is: http://goo.gl/cSYYfN Although, there are 3 problems: * there's wrong shadow at the left wall; * there's a strange stain at toruses' bottom which is altered by the main camera; * the shadow, as seen under the lowest torus, is altered by the main camera, too.
What am I doing wrong? Thanks. 2013/10/21 Robert Osfield <robert.osfi...@gmail.com> > HI Michael, > > On 21 October 2013 03:30, michael kapelko <korn...@gmail.com> wrote: > >> Hi. >> Why is it the other way around? >> > > History :-) > > The OSG uses row major because it was the predominant convention used at > the time of the OSG's inception, row major has the advantage that one > doesn't need to transpose the vector before multiplying and data in the > matrix is laid out how you would expect it. > > Then OpenGL adopted column major, despite still storing the matrices in > row major order, now this was OK till OpenGL Shader Language came along and > cemented the column major convention, but this time we already a big > community using the OSG and code written to the row major convention. > > If I were to write a new scene graph today I'd choose column major simply > to be compatible with GLSL, but with the existing OSG and community code > switching would be far from t rival to switch over. > > Robert. > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > >
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org