SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLNodeLOD.h
Go to the documentation of this file.
1 /**
2  * \file SLNodeLOD.h
3  * \date July 2021
4  * \authors Jan Dellsperger, Marcus Hudritsch
5  * \copyright http://opensource.org/licenses/GPL-3.0
6  * \remarks Please use clangformat to format the code. See more code style on
7  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
8 */
9 
10 #ifndef SLNODELOD_H
11 #define SLNODELOD_H
12 
13 #include <SLNode.h>
14 
15 //-----------------------------------------------------------------------------
16 //! Level of detail (LOD) group node based on screen space coverage
17 /*! An LOD group node can be used to improve the rendering performance for a
18  mesh is very detailed and has thousands for vertices and triangles. Such a
19  details mesh doesn't need to be detailed in full resolution if the mesh is
20  displayed far away from the camera because you can see all triangles anyway.
21  We therefore need to create multiple levels of details with lower no. of
22  triangles and vertices. You have to create these lower resolution version of
23  an original mesh in an external program such as Blender that has multiple
24  decimation algorithms for this purpose.\n
25  See the method addChildLOD for more information how to add the levels.
26  */
27 class SLNodeLOD : public SLNode
28 {
29 public:
30  explicit SLNodeLOD(const SLstring& name = "NodeLOD") : SLNode(name) { ; }
31 
32  void addChildLOD(SLNode* child,
33  SLfloat minLodLimit,
34  SLubyte levelForSM = 0);
35  virtual void cullChildren3D(SLSceneView* sv);
36 };
37 //-----------------------------------------------------------------------------
38 #endif
float SLfloat
Definition: SL.h:173
unsigned char SLubyte
Definition: SL.h:167
string SLstring
Definition: SL.h:158
SLNode represents a node in a hierarchical scene graph.
Definition: SLNode.h:147
SLubyte levelForSM()
Definition: SLNode.h:317
Level of detail (LOD) group node based on screen space coverage.
Definition: SLNodeLOD.h:28
void addChildLOD(SLNode *child, SLfloat minLodLimit, SLubyte levelForSM=0)
Adds an LOD node with forced decreasing min LOD coverage.
Definition: SLNodeLOD.cpp:32
virtual void cullChildren3D(SLSceneView *sv)
Culls the LOD children by evaluating the the screen space coverage.
Definition: SLNodeLOD.cpp:55
SLNodeLOD(const SLstring &name="NodeLOD")
Definition: SLNodeLOD.h:30
const SLstring & name() const
Definition: SLObject.h:38
SceneView class represents a dynamic real time 3D view onto the scene.
Definition: SLSceneView.h:69