21 #include <osg/Matrixd>
23 #include <unordered_map>
37 class DtLightingComponentShaderConstants;
38 class DtTileSpaceLightGrid;
39 class DtLightComputeProgram;
40 class DtGlDeleteObjectManager;
41 class DtCoreGlBufferCreator;
42 class DtOsgLightManager;
43 class DtIndirectGlTextureObject;
44 class DtCoordinateSystem;
46 class DtIndirectDefaultTexturesContainer;
47 class DtIndirectGlTextureObjectManager;
48 class DtIndirectGlTextureObject;
86 virtual void update(
const std::vector<const DtLight*>& lights,
const osg::State& state,
const osg::Camera* camera);
100 virtual void packLights(
const osg::Matrixd& normalMatrix,
const std::vector<const DtLight*>& lights,
const osg::State& state);
103 virtual void updateTiledShadingData(
const std::vector<const DtLight*>& lights,
const osg::State& state,
const osg::Camera* camera);
108 ,
const std::vector<Vector3_64>& vWorldEye
109 ,
const std::vector<Vector3_64>& vWorldCenter
110 ,
const std::vector<Vector3_64>& vWorldUp
112 ,
const osg::Camera* camera);
virtual ~DtOsgLightingComponentTcsUserData()
virtual void updateLightingShaderUbo(const osg::State &state)
update the light ubo
This class represents the per context, per camera data and operations on it via the DtOsgLightingComp...
Definition: DtOsgLightingComponentTcsUserData.h:75
This represents an arbitrary user pointer/data within DtKeyedData.
Definition: DtKeyedData.h:95
DtIndirectGlTextureObjectManager & myIndirectGlTextureObjectManager
Definition: DtOsgLightingComponentTcsUserData.h:203
Helper class to pack lights into a buffer/texture.
Definition: DtLightData.h:42
virtual void slot_componentVisualizationModeChanged(int mode)
set the component visualization mode
int myTileLightIndexListSsboBinding
Definition: DtOsgLightingComponentTcsUserData.h:174
virtual void updateTileLightIndexList(const std::vector< Matrix4_64 > &projectionMatrix, const std::vector< Vector3_64 > &vWorldEye, const std::vector< Vector3_64 > &vWorldCenter, const std::vector< Vector3_64 > &vWorldUp, const Vector2_uint32 &viewportSize, const osg::Camera *camera)
Updates the per-light-grid index lists. called via updateTiledShadingData.
int myTotalCount
Definition: DtOsgLightingComponentTcsUserData.h:71
int myLightingShaderUboBiding
Definition: DtOsgLightingComponentTcsUserData.h:167
virtual void reset()
Definition: DtOsgLightingComponentTcsUserData.h:61
Definition: DtLightingComponentShaderConstants.h:28
DtTileLightIndexInfo myTileLightIndexInfo
Definition: DtOsgLightingComponentTcsUserData.h:178
Encapsulate an OpenGL texture object that is created/used in indirect rendering.
Definition: DtIndirectGlTextureObject.h:36
const char * creatorTypeName< DtOsgLightingComponentTcsUserData >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtOsgLightingComponentTcsUserData.h:219
Vector3_32 upVector(const osg::State &state) const
up vector
DtTileSpaceLightGrid * myTileSpaceLightGrid
Definition: DtOsgLightingComponentTcsUserData.h:176
DtVirtualBaseClassCreator< DtOsgLightingComponentTcsUserData, const std::string & > DtOsgLightingComponentTcsUserDataCreator
creator
Definition: DtOsgLightingComponentTcsUserData.h:215
creator for DtCoreGlBuffer
Definition: DtCoreGlBuffer.h:66
This manager manages the lifetime of the actual gl texture objects (gl unsigned ints) in the indirect...
Definition: DtIndirectGlTextureObjectManager.h:60
virtual void releaseGLObjects(void)
DtOsgLightingComponentTcsUserData & operator=(const DtOsgLightingComponentTcsUserData &rhs)=delete
virtual const DtLightingComponentShaderConstants * shaderConstants(void) const
get the shader constants
virtual void slot_reloadShader()
reload the light source compute shaders
static const float theLightPointHdrScalar
Definition: DtOsgLightingComponentTcsUserData.h:209
DtLightingComponentShaderConstants * myLightingShaderUboConstants
Definition: DtOsgLightingComponentTcsUserData.h:168
virtual void createRenderPassSsbos(void)
DtGlBuffer * myTileLightIndexListPreComputeSsbo
Definition: DtOsgLightingComponentTcsUserData.h:189
DtIndirectDefaultTexturesContainer & myIndirectDefaultTexturesContainer
Definition: DtOsgLightingComponentTcsUserData.h:202
virtual void releaseTexture(DtIndirectGlTextureObject *&indirectGlTextureObject)
internal
virtual void packLights(const osg::Matrixd &normalMatrix, const std::vector< const DtLight * > &lights, const osg::State &state)
pack lights and update the ubo
DtLightData * myLightGrid
Parameters of lights are stored in this structure.
Definition: DtOsgLightingComponentTcsUserData.h:157
DtIndirectGlTextureObject * myModelDebugTexture
Definition: DtOsgLightingComponentTcsUserData.h:206
DtGlBuffer * myTileLightIntersectionDataSsbo
Definition: DtOsgLightingComponentTcsUserData.h:187
static const int theLightBlockCount
Definition: DtOsgLightingComponentTcsUserData.h:161
static const float theEmissiveTextureHdrScalar
Definition: DtOsgLightingComponentTcsUserData.h:211
virtual void deleteRenderPassSsbos(void)
virtual void bindRenderPassBuffers()
This is called by the DtLightingComponentStateAttribute.
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:22
virtual void releaseComputePassSsbos(void)
release buffers needed in compute and render passes
virtual void deleteComputePassSsbos(void)
delete buffers needed in compute and render passes
DtOsgLightManager & myOsgLightManager
Definition: DtOsgLightingComponentTcsUserData.h:196
virtual void slot_preTick()
pre tick function
DtGlBuffer * myTileLightIndexListSsbo
Holds a set of indexes, one per light tile. This can get big, so cannot fit in a UBO. This goes in at binding 12 in the lighting pass This is actually also written to by the compute pass, to be read in the render pass.
Definition: DtOsgLightingComponentTcsUserData.h:173
static const int theLightBlockBase
These go in at bindings 6-10 in the lighting pass.
Definition: DtOsgLightingComponentTcsUserData.h:160
DtCoordinateSystem * myCoordinateSystem
local clone of the system wide coordinate system. for thread safety.
Definition: DtOsgLightingComponentTcsUserData.h:200
virtual void createComputePassSsbos(void)
create buffers needed in compute and render passes
DtGlBuffer * myLightingShaderUbo
Lighting shader ubo This goes in at binding 11 in the lighting pass.
Definition: DtOsgLightingComponentTcsUserData.h:166
DtOsgLightManager receives LightSource nodes from the DtOsgCullVisitor, and collects them all here wh...
Definition: DtOsgLightManager.h:55
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtCoreGlBufferCreator & myCoreGlBufferCreator
Definition: DtOsgLightingComponentTcsUserData.h:192
virtual void updateTiledShadingData(const std::vector< const DtLight * > &lights, const osg::State &state, const osg::Camera *camera)
run the compute shaders in order to update the per camera lighting data and bin the lights in screens...
loads and contains various core default textures used by the indirect system
Definition: DtIndirectDefaultTexturesContainer.h:30
int lightGridSize() const
Returns the number of lights in the light grid Not virtual. Called via constructor.
virtual void bindCommonBuffers(const osg::State &state)
Class doing all the heavy lifting in regards of forward+ lighting.
Definition: DtTileSpaceLightGrid.h:42
DtOsgLightingComponentTcsUserData()=delete
not allowed
virtual void deleteBuffers(void)
called on destruction
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
std::unordered_map< DtGlBuffer *, int > myBufferToLightIndexMap
Definition: DtOsgLightingComponentTcsUserData.h:69
DtGlBuffer * myTileLightIndexBuffersInfoSsbo
Definition: DtOsgLightingComponentTcsUserData.h:185
struct for holding information about a camera's tile light index map
Definition: DtOsgLightingComponentTcsUserData.h:51
A generic OpenGL buffer. This can be: -> a vertex buffer -> an index buffer -> a shader storage buffe...
Definition: DtGlBuffer.h:29
DtSignalConnectionManager myConnections
Definition: DtOsgLightingComponentTcsUserData.h:194
Base class to provide boost signal/slot management.
DtIndirectGlTextureObject * myBrdfLookUpTexture
Definition: DtOsgLightingComponentTcsUserData.h:205
Vaos are OpenGL context specific. They need to be deleted in the context they are created in...
Definition: DtGlDeleteObjectManager.h:58
const char int mode
Definition: ioapi.h:38
virtual void updateLightSourceIndexBufferHandle(DtGlBuffer *handle, int maxNumLightSources)
virtual void releaseRenderPassSsbos(void)
int myBufferChunkCount
Definition: DtOsgLightingComponentTcsUserData.h:70
Contains DLL export macros.
DtLightComputeProgram * myLightComputeProgram
Definition: DtOsgLightingComponentTcsUserData.h:182
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
DtTileLightIndexInfo()
Definition: DtOsgLightingComponentTcsUserData.h:54
static const float theDynamicLightHdrScalar
Definition: DtOsgLightingComponentTcsUserData.h:210
virtual void slot_coordinateSystemChanged()
slot for when the coordinate system changes
std::vector< DtLight * > myViewSpaceLightsScratchPad
Definition: DtOsgLightingComponentTcsUserData.h:180
virtual void update(const std::vector< const DtLight * > &lights, const osg::State &state, const osg::Camera *camera)
DtGlDeleteObjectManager & myGlDeleteObjectManager
Definition: DtOsgLightingComponentTcsUserData.h:191
Contains the DtKeyedData class declaration.
std::array< DtGlBuffer *, theLightBlockCount > myLightDataBlockUbos
Definition: DtOsgLightingComponentTcsUserData.h:162
Class that encapsulates the 2 pass (setup, sort) computation of lights affecting the screen space til...
Definition: DtLightComputeProgram.h:46