Open Inventor Release 2025.2.0
 
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-2025 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
194class SoShadowGroup : public SoGroup
195{
196 SO_NODE_HEADER(SoShadowGroup);
197 SO_PIMPL_PUBLIC_HEADER(SoShadowGroup)
198
199public:
219
228 #ifndef HIDDEN_FROM_DOC
229 LAST_METHOD
230 #endif
231 };
232
237
241 SoShadowGroup(int nChildren);
242
248
255
268
276
283
300
306
307
315
327
337
345
353
354
355private:
357 virtual void GLRender(SoGLRenderAction *action);
358
359 /*----------------------------------------------------------------------------*/
360
361private:
362 typedef std::vector<int> StackIndexVector;
363
364 static void initClass() ;
365 static void exitClass() ;
366
367 const std::vector<SbMatrix>& getLightViewMatrices() const;
368
369 const std::vector<SbMatrix>& getLightViewProjectionMatrices() const;
370
371 const std::vector<SbVec2f>& getLightsNearFar() const;
372
373 const std::vector<SbVec2i32>& getLightMatricesOffsetsAndNums() const;
374
375 const std::vector<float>& getLightShadowIntensities() const;
376
377 int getLightMatrixIndex() const;
378
380 static int getShadowMapTextureUnit(SoGLRenderAction* action);
381
383 void invalidateLightCaches();
384
387 bool isCacheValid(SoState* state, SoCache* &cache, const StackIndexVector& elemsToCheck);
388
389
391 bool isShadowActive(SoState* state) const;
392
394 float getQuality(SoState* state) const;
395
399 virtual void notify(SoNotList *list);
400
402 SbVec2i32 getShadowMapSize() const;
403
404private:
405 virtual ~SoShadowGroup();
406
410 void destroy() override;
411
412private:
413
414#if 1 SoDEPRECATED
420 SoSFBool isShapesBefore;
421#endif
422
424 void addElementsToCache(SoState* state, SoCache* cache) const;
425
427 void chooseShadowingMethod();
428
430 inventor::impl::SoShadowGroupImpl* createImplementation() const;
431
432 void commonInit();
433
435 static int s_defaultTextureUnit;
436};
437/*----------------------------------------------------------------------------*/
438#endif // _SO_SHADOW_GROUP_
439
440
2D vector class.
Definition SbVec.h:517
Renders a scene graph using Open Inventor's Render Engine.
SoGroup()
Creates an empty group node.
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.
@ LONGEST_BBOX_EDGE_FACTOR
The longest edge of the scene bounding box will be multiplied by the value of visibilityRadius.
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