VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtIndirectLodProgram.h
Go to the documentation of this file.
1 /*****************************************************************************
2 * Copyright (c) 2023 MAK Technologies, Inc.
3 * All rights reserved.
4 *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
14 #include <vrvMath/DtVector3.h>
16 
18 
19 #include <atomic>
20 
21 namespace makVrv
22 {
23  class DtDe;
24  class DtOsgShaderFilesCache;
25  class DtIndirectViewParameters;
26  class DtGlBuffer;
27  class DtGlProgram;
28 
31  {
32  public:
33  // CTOR
35 
38 
39  private:
42 
45 
46  public:
48  virtual void init(const DtGlProgram* program) override;
49 
50  protected:
52  virtual void reset(void) override;
53 
54  public:
55  // these are uniforms ids!
61 
62  protected:
66  static const char* LodManagerDistScaleUniformName;
68  };
69 
73  {
74  public:
76  virtual ~DtIndirectLodProgram();
77 
79  static DtIndirectLodProgram* instance(DtDe& de);
80  protected:
83  private:
85  DtIndirectLodProgram() = delete;
89  DtIndirectLodProgram& operator=(const DtIndirectLodProgram&) = delete;
90 
91  public:
92 
94  virtual void runProcessLodsComputeShader(const DtIndirectViewParameters& viewParameters
95  , unsigned int maxNumInstances);
96 
98  virtual void deleteShaders();
99 
101  virtual void incrementNumUsers();
102 
104  virtual void decrementNumUsers();
105 
106  protected:
108  virtual void initializeShadersIfNecessary();
109 
110  protected:
112 
114 
115  std::atomic<int> myNumUsers;
116 
118 
120 
123 
126  };
127 }
DtGlProgram * myLodProgram
Definition: DtIndirectLodProgram.h:111
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
static const char * LodManagerDistScaleUniformName
Definition: DtIndirectLodProgram.h:66
int myGpuShaderUboBinding
Definition: DtIndirectLodProgram.h:122
static const char * LodManagerModelViewMatrixUniformName
Definition: DtIndirectLodProgram.h:64
DtIndirectLodProgramConstants & operator=(const DtIndirectLodProgramConstants &rhs)=delete
not allowed
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtVector3< int > myWorkGroupLocalSize
Definition: DtIndirectLodProgram.h:113
DtDe & myDe
Definition: DtIndirectLodProgram.h:117
interface class for managing program constants
Definition: DtProgramConstants.h:70
int myMaxNumInstancesIndex
Definition: DtIndirectLodProgram.h:56
static const char * LodManagerMaxNumInstancesUniformName
Definition: DtIndirectLodProgram.h:63
DtGlBuffer * myGpuShaderUbo
Definition: DtIndirectLodProgram.h:121
int myDistScaleIndex
Definition: DtIndirectLodProgram.h:59
helper class to manage, set, reset the program constants in the lod processor program ...
Definition: DtIndirectLodProgram.h:30
A convenience class to represent an OpenGL Shader Program.
Definition: DtGlProgram.h:66
3 dimensional vector
DtIndirectLodProgramConstants myProgramConstants
Definition: DtIndirectLodProgram.h:119
Contains makVrv::DtVirtualBaseClass class.
virtual void init(const DtGlProgram *program) override
initialize
singleton class that wraps indirect lod gpu shader.
Definition: DtIndirectLodProgram.h:72
int myZoomMagnificationIndex
Definition: DtIndirectLodProgram.h:58
Contains makVrv::DtProgramConstants class.
bool myMutableShadersFailedToCompile
indicate whether we have failed to compile
Definition: DtIndirectLodProgram.h:125
A generic OpenGL buffer. This can be: -&gt; a vertex buffer -&gt; an index buffer -&gt; a shader storage buffe...
Definition: DtGlBuffer.h:29
The class that is used to communicate the camera viewing parameters to the DtICullingAndLOD interface...
Definition: DtIndirectViewParameters.h:26
static const char * LodManagerLodTransitionPercentageUniformName
Definition: DtIndirectLodProgram.h:67
std::atomic< int > myNumUsers
Definition: DtIndirectLodProgram.h:115
virtual ~DtIndirectLodProgramConstants()
DTOR.
Contains DLL export macros.
virtual void reset(void) override
reset to invalid value
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:72
int myLodTransitionPercentageIndex
Definition: DtIndirectLodProgram.h:60
int myModelViewMatrixIndex
Definition: DtIndirectLodProgram.h:57
static const char * LodManagerZoomMagOrthoDistanceOrthoCullUniformName
Definition: DtIndirectLodProgram.h:65

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)