Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoShadowGroup.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2024 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : R.ALBOU (Sep 2001)
22**=======================================================================*/
23#ifndef _SO_SHADOW_GROUP_
24#define _SO_SHADOW_GROUP_
25
26
27#include <Inventor/nodes/SoGroup.h>
28#include <Inventor/fields/SoSFBool.h>
29#include <Inventor/fields/SoSFEnum.h>
30#include <Inventor/fields/SoSFFloat.h>
31#include <Inventor/fields/SoSFInt32.h>
32#include <Inventor/SbMatrix.h>
33#include <Inventor/SbPImpl.h>
34
35class SoGLShadowMapping ;
36class SoCache ;
37class SoGLTexture;
38
39SO_PIMPL_PUBLIC_DECLARATION(SoShadowGroup)
40
41
180class SoShadowGroup : public SoGroup
181{
182 SO_NODE_HEADER(SoShadowGroup);
183 SO_PIMPL_PUBLIC_HEADER(SoShadowGroup)
184
185public:
196
203 LONGEST_BBOX_EDGE_FACTOR
204 } ;
205
214 #ifndef HIDDEN_FROM_DOC
215 LAST_METHOD
216 #endif
217 };
218
223
227 SoShadowGroup(int nChildren);
228
234
241
254
262
269
286
292
293
301
313
323
331
339
340
341private:
343 virtual void GLRender(SoGLRenderAction *action);
344
345 /*----------------------------------------------------------------------------*/
346
347private:
348 typedef std::vector<int> StackIndexVector;
349
350 static void initClass() ;
351 static void exitClass() ;
352
354 const SbMatrix& getLightViewProjectionMatrix() const;
355
357 int getLightIndex() const;
358
360 static int getShadowMapTextureUnit(SoGLRenderAction* action);
361
363 void invalidateLightCaches();
364
367 bool isCacheValid(SoState* state, SoCache* &cache, const StackIndexVector& elemsToCheck);
368
369
371 bool isShadowActive(SoState* state) const;
372
374 float getQuality(SoState* state) const;
375
379 virtual void notify(SoNotList *list);
380
382 SbVec2i32 getShadowMapSize();
383
384private:
385 virtual ~SoShadowGroup();
386
390 void destroy() override;
391
392private:
393
394#if 1 SoDEPRECATED
400 SoSFBool isShapesBefore;
401#endif
404 void addElementsToCache(SoState* state, SoCache* cache) const;
405
407 void chooseShadowingMethod();
408
410 inventor::impl::SoShadowGroupImpl* createImplementation() const;
411
412 void commonInit();
413
415 static int s_defaultTextureUnit;
416};
417/*----------------------------------------------------------------------------*/
418#endif // _SO_SHADOW_GROUP_
419
420
4x4 matrix class.
Definition SbMatrix.h:309
2D vector class.
Definition SbVec.h:517
Renders a scene graph using Open Inventor's Render Engine.
Base class for all group nodes.
Definition SoGroup.h:122
Field containing a single Boolean value.
Definition SoSFBool.h:79
Field containing an enumerated value.
Definition SoSFEnum.h:89
Field containing a floating-point value.
Definition SoSFFloat.h:78
Field containing a int32_t integer.
Definition SoSFInt32.h:80
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Shadow casting g...
SoSFFloat visibilityRadius
Shadows are only computed within "visibility radius" distance from the camera position.
SoSFFloat precision
Specifies the precision of the shadow.
SoSFEnum visibilityFlag
Specifies how visibilityRadius is interpreted.
SoShadowGroup()
Default constructor.
SoSFFloat quality
Specifies the quality of the shadow.
SoShadowGroup(int nChildren)
Constructor that takes approximate number of children.
SoSFFloat lightBleedingReduction
In some cases, a halo may appear around shadows intersecting each other.
SoSFInt32 smoothFactor
Set the smoothness of shadows.
SoSFBool isActive
Activates/deactivates the shadowing.
SoSFEnum method
Specifies the shadowing technique to use.
static SbBool isSupported(SoShadowGroup::ShadowingMethod method=SoShadowGroup::VARIANCE_SHADOW_MAP)
Indicates if shadow casting is supported by your graphic board.
SoSFBool shadowCachingEnabled
Indicates if a cache should be used for computing the shadows.
VisibilityFlag
visibilityRadius interpretation
@ ABSOLUTE_RADIUS
visibilityRadius is interpreted as an absolute value.
SoSFFloat intensity
Specifies the intensity of the shadow.
ShadowingMethod
Shadowing techniques.
@ VARIANCE_SHADOW_MAP
Shadows with soft edges.
SoSFFloat minVariance
Increasing this value will decrease possible self-shadowing artifacts but will make shadows fade away...
Traversal state.
Definition SoState.h:74
int SbBool
Boolean type.
Definition SbBase.h:87