Commit Graph

94 Commits

Author SHA1 Message Date
Robert Osfield
284f410436 Added ShadowSettings::s/getMaximumShadowMapDistance(double) property, usage of these property in ViewDependentShadowMap,
and setting of it with --max-shadow-distance <double> in the osgshadow example.
2012-08-15 12:40:48 +00:00
Robert Osfield
52861ecbb0 Added a mutex to protect the removal and addition of Uniform and Program to StateSet to avoid parents being invalidated when multi-threading. 2012-08-14 20:15:00 +00:00
Robert Osfield
fb83c2b061 Introduced --near-far-mode into osgshadow and ShadowSettings::setComputeNearFarModeOverride(..) to allow user control of how the cull traversal is optimized for computing the depth range of the shadow map. 2012-08-03 16:14:14 +00:00
Robert Osfield
b4d397cfd7 Moved mask settings into ShadowSettings 2012-07-10 15:50:46 +00:00
Robert Osfield
14a563dc9f Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Robert Osfield
92ed903a7f Added prelimanary support for parallel split shadow maps into ViewDependentShadowMap. 2011-11-22 21:55:30 +00:00
Robert Osfield
bdb0dfe27d Improvements to osgShadow::ViewDependentShadowMap and ShadowSettings 2011-10-17 14:40:29 +00:00
Robert Osfield
83524f958e Added handling the ShadowSettings::LightNum for selecting which light to use. 2011-09-07 20:05:25 +00:00
Robert Osfield
3a79bc343d Moved ViewDependetShadowMap parameter settings into a dedicated ShadowSettings object in prep for making it possible to scale the API to handle multiple lights and multiple shadow maps per light. 2011-09-07 15:55:54 +00:00
Robert Osfield
f83722d62b Added s/getPerspectiveShadowMapCutOffAngle() and use of this when setting up light space to avoid sigularaties when
the light and view directions are co-incident.
2011-09-06 10:12:45 +00:00
Robert Osfield
15ad6eda63 Added support for setting whether ViewDependentShadowMap should provide it's own vertex and fragment shaders. 2011-09-05 12:36:47 +00:00
Robert Osfield
52c2bc3ff5 Added s/getTextureSize() method for setting the shadow map texture size. 2011-09-02 10:16:16 +00:00
Robert Osfield
47db350da1 Added fallback base texture 2011-08-29 10:26:05 +00:00
Robert Osfield
2d71a390d3 Added support for setting the MinimumShadowMapNearFarRatio. 2011-08-29 09:59:47 +00:00
Robert Osfield
0f14f53698 Added releaseGLObjects/resizeGLObjectBuffers support 2011-08-26 10:52:25 +00:00
Robert Osfield
966981f100 Improved the handling of depth partitioning and orthographic datasets 2011-08-25 17:21:38 +00:00
Robert Osfield
0d3169f645 Added support for user defined setting of the shadow texture unit 2011-08-24 19:38:58 +00:00
Robert Osfield
26e2106636 Changed new ViewDependentShadowMap to default to a perspective shadow map with automatic detection of a spot light/perspetive light projection
matrix to prevent inappropriate usage of perspective shadow map.
2011-08-24 13:57:15 +00:00
Robert Osfield
3a70830e89 Quitended down debug messages and added passing of RenderStage to LispSM code 2011-08-19 12:42:51 +00:00
Robert Osfield
1d54065646 intermin check-in of work on new LispSM implementation 2011-08-17 16:09:17 +00:00
Robert Osfield
b15317481c Added public interface for selecting use of perspective and light space perspective shadow maps. Implementation
of backends not implemented yet so will follow.
2011-08-12 20:29:14 +00:00
Robert Osfield
6b7175baac Implemented first pass at shaders for new ViewDepedentShadow map class 2011-08-12 14:53:40 +00:00
Robert Osfield
675a61ea87 Implemented ViewDependentShadowMap::setDebugDraw(bool) to allow osgshadow to enable/disable the debug display via the
standard --debugHUD option.
2011-08-09 15:57:37 +00:00
Robert Osfield
4aa16bc8e3 Implemented caching of Camera, Texture and TexGen 2011-08-09 13:39:57 +00:00
Robert Osfield
e4a73d121e Added replacement of the placeholder StateSet in the StateGraph with custom StateSet implemented just for the
needs of that particular frame.
2011-08-09 06:54:44 +00:00
Robert Osfield
4238629ebf Further work on basic ViewDependentShadowMaps, adding implementation of RTT camera and texgen setup. 2011-08-08 17:00:55 +00:00
Robert Osfield
cbb6f1c92c Preliminary work on new ViewDependentShadowMap base class 2011-08-07 15:51:54 +00:00
Robert Osfield
d3d0859b4c From Piotr Gwiazdowski, "So there's config setting OSG_DISABLE_MSVC_WARNINGS which should
disable pragmas that turn off specific warnings for MSVC.
Unfortunately it's presence is only checked in osg/Export header,
making other Export headers disable warnings no matter what, which is
kind of incoherent.

My fix adds #include <osg/Config> to every Export header. I've also
unified checking whether to disable warnings to current osg/Export
way:
#if defined(_MSC_VER) && defined(OSG_DISABLE_MSVC_WARNINGS).

Attachment contains all changed Export files in their original locations."
2011-03-09 14:15:04 +00:00
Robert Osfield
a7fd352b40 Removed TrapezoidalShadowMap due to discovery of patent on algorithm. 2011-02-24 11:54:44 +00:00
Robert Osfield
a25c4e4ab2 From Wojciech Lewandowski, intial cut at new TrapezoidalShadowMap ShadowTechnique 2011-02-23 16:46:34 +00:00
Robert Osfield
9cfb248b46 From Wojciech Lewandowski, various tweaks to osgShadow shadow mapping classes to improve consistency and enable more debug info output 2011-02-23 16:45:44 +00:00
Robert Osfield
e2a315ee49 From Wojciech Lewandowski, "1: fix for a issue with MinimalShadowMap and LightSpacePerspectiveShadowMapVB techniques ignoring minLightMargin parameter.
2: minor tweak for a DebugHUD drawn improperly case when multiple slave views  shared one window. It now uses slave view viewport to correctly position DebugHUD.
3: deactivated ConvexPolyhedron notifications (they were accidentaly activated when you replaced osg::notify calls with OSG_NOTIFY macro). These warnings are useful only for shadow map developer working on shadow volume optimizations. So there is no sense in having them active all the time."
2010-11-24 10:09:04 +00:00
Robert Osfield
68a1ed2dcf Fixes for building OSG with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF.
Fixed copy and paste error in Camera::getImplicitBufferAttachmentResolveMask().
2010-05-12 11:37:27 +00:00
Robert Osfield
92a6b0020d Changed the AbmientBias type from Vec2d to Vec2 as use of double is inappropriate. 2010-04-20 10:35:33 +00:00
Robert Osfield
a8c4fd8761 From Wang Rui, "The new osgShadow and osgFX serializers are attached, and some
modifications of the osgShadow header naming styles as well. The
osgDB::Serializer header is also changed to add new Vec2 serializer
macros because of the needs of osgShadow classes. It should compile
fine on both Windows and Linux. But I have only done a few tests to
generate .osgb, .osgt and .osgx formats with these new wrappers."
2010-04-20 10:29:04 +00:00
Robert Osfield
c765a35650 From Wojcoech Lewandowski, "Attched are aimShadowCastingCamera() call changes, I have described in former post. Basically now MinimalShadowMap overrides first variant and keeps second. So both variants of aimShadowCastingCamera are clearly defined in MinimalShadowMap::ViewData scope. This way compilers have no problem and code looks less obscure. Changes made against the trunk." 2010-03-05 16:17:12 +00:00
Robert Osfield
ba3971bb45 Added a ShadowTechnique::computeOrthogonalVector(const osg::Vec3& direction) const method for helping compute an appropriate
up vector to setViewMatrixAsLookAt(..) codes in osgShadow.  This will addresses previous issues that occured when look vectors
co-incided with the hard coded up vectors.
2010-03-01 13:00:04 +00:00
Robert Osfield
42a050e87c From Wojciech Lewandowski, "Here comes a list of small fixes in StandardShadowMap and derived classes affecting LispSM techniques. Changes made against SVN trunk.
Fixes in StandardShadowMap.cpp & MinimalShadowMap.cpp were made for spotlight issues. There were cases when further located spotlights were not shadowing properly.

Small tweak in DebugShadowMap & StandardShadowMap.cpp to not limit shadow maps to texture2D (which should also allow texture2D arrays and cube maps). I simply replaced ptr to osg::Texture2D with pointer to osg::Texture. Interpretation of this member could be now changed with change of shaders in derived classes. This may be useful for guys who override LispSM or MinimalBoundsShadowMaps techniques. Could be useful for implementation of PerspectiveCascadedShadowMaps technique for example.

ConvexPolyhedron.cpp & DebugShadowMap.cpp contain debug HUD tweaks.

Change in ConvexPolyhedron.cpp overcomes the regression problem with color per primitive binding which caused that shadow volume outlines stopped to draw. I simply changed PER_PRIMITIVE to PER_PRIMITIVE_SET and it works again.

Other adition is dump method I added to DebugShadowMap which can be used in shadow debugging mode to dump current frame shadow volumes & scene to osg file. It could be then loaded into viewer and freely examined from different angles (which is difficult inside the application if shadow adopts to view and projection). "
2010-03-01 11:52:44 +00:00
Robert Osfield
9404abfef5 Added className() implementation to help wiht debugging. 2010-02-16 17:38:49 +00:00
Robert Osfield
c7744b15a3 Converted viewer camera references to use observer_ptr<> rather than ref_ptr<> or C pointers to avoid issues with circular references/dangling pointers. 2009-01-27 14:11:37 +00:00
Robert Osfield
e0c279bf3d Added forward declaration of callbacks to headers to avoid scoping issues of classes with same names. 2009-01-23 15:50:05 +00:00
Robert Osfield
a5c32da4ff Warning fixes 2008-12-17 11:00:16 +00:00
Robert Osfield
ad2cb03a68 From Csaba Halasz, adding missing export directives 2008-11-06 14:04:26 +00:00
Robert Osfield
b28612bce2 Various warning fixes 2008-10-27 13:09:43 +00:00
Robert Osfield
c47d63ba1c Added friend struct ViewData to try and avoid compile issues under HP-UX 2008-10-08 12:29:43 +00:00
Robert Osfield
ff8c6aa32b From Mathias Froehlich, build fixes 2008-10-07 12:31:42 +00:00
Robert Osfield
7e43decf4c From Wojciech Lewandowski, build fixes for handling Matrix::value_type == float 2008-10-06 14:18:27 +00:00
Robert Osfield
df12c7bc68 Ran dos2unix 2008-10-06 14:15:27 +00:00
Robert Osfield
236832f669 Ran dos2unix on headers 2008-10-06 08:53:54 +00:00
Robert Osfield
bf15614df6 From Wojciech Lewandowski, a range of new ShadowMap implementations include View Dependent Shadow Maps - LispSM
From Robert Osfield, refactored Wojciech's submission to integrated with osgShadow and use coding sytle more consistent with rest of OSG.
2008-09-19 19:51:27 +00:00