On 1/18/06, Marcus Lindblom <[EMAIL PROTECTED]> wrote: > Xavier Larrode wrote: > > > Andreas Zieringer a écrit : > > > >> Hi, > >> > >> it is coded for all three light types, but you need a light position > >> and a direction to do the shadow mapping, so it works best for > >> spotlights. For a pointlight it looks always to the center of the > >> scene. Well the directionallight implementation looks buggy. > >> > >> Andreas > >> > > Well it seems not working with directionnal light. but i only have the > > OpenSG1.6.0 and not the last CVS version... > > Anyway, is there anything else on OpenSG to get shadow? > > > Isn't it a bit difficult to do shadowmapping with directional lights in > general? You'd need a orthographic shadow projection matrix and thus > define where to apply the shadow. With spotlights, it's more intuitively > defined from the properties of the light itself.
It's a little odd, but not all that difficult. You just need to associate a position with your directional light. Your orthographic shadow projection matrix is rotated to point in the direction of your directional light and translated to this new position. I have done this a couple times without any trouble. It's just weird because a directional light is never thought of as having a position. But the required projection frustum is finite and most definitely needs a position to be useful. > > Can you get away by putting a spot light "sufficitenty far away" from > the objects being lit/shadowed and define proper near/far planes. That > should case a shadow which is close to the directional light (which is a > pointlight at infinity anyway). Just an idea that might work. I've only > used "regular" shadowmaps so far... > > Regards > /Marcus > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642 > _______________________________________________ > Opensg-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/opensg-users > -- Terry Welsh - mogumbo 'at' gmail.com www.reallyslick.com | www.infiscape.com | www.vrsource.org ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
