Hi Justo, On Sat, Aug 27, 2011 at 12:17 AM, Justo Ureña <[email protected]> wrote:
> I´ve tried the ViewDependentShadowMap and although it works great, I still > have the same problem with the stiching due to the "missing tessels"... Good to hear it's work well for you. The aliasing artifact you are still seeing is expected, it's a trait that all shadow technique will have, but if the vertex and fragment shaders are properly setup this issue will disappear, you can still still the artifact with ViewDepententShadowMap as the shaders have been kept deliberately simple. > Robert, you´re right about that in a "normal" illumination, these surfaces > should be set to the ambient colour, cause their normals are pendicular with > the light direction. But as my scene is an outside static scene, and I don´t > want to illuminate a big portion of the scene with the ambient light because > it looks "flat", I´m trying to implement some kind of "hemispheric lighting" > (from the glsl orange book), but without renouncing to the shadow effect. So, > I need this perpendicular surfaces to be lit, and to show the shadows... There is no reason why you can't use different lighting models when doing shadow mapping. The key element to solve the artifact you are seeing is computing the the diffuse+specular element of lighting separate the ambient component and not combining them until you've take the result from the shadow map. Typically the ambient and diffuse+specular components are all combined in the vertex shaders and passed as a single colour to the fragment shader, but instead you'll want to pass these as two colours to the fragment shader and have the fragment shader do the shadow map test, then if you the fragment is the shadow you'll want to just use the ambient contribution, but if it's not in shadow you'll want to add the diffuse+specular component. If this is done correctly then when the normal is perpendicular to the light source the diffuse+specular component will be zero so the end result will be the equal to the ambient component whether you are in the shadow or not. Robert. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

