17 #include <osg/Matrixd>
29 class DtBallisticDrawComponent;
30 class DtBallisticRunTimeSettings;
31 class DtBallisticGeometry;
100 virtual void draw(osg::RenderInfo& renderInfo);
109 virtual void uploadCameraData(
const osg::Camera* camera,
const Observer& obs);
134 virtual void sortAndDraw(osg::RenderInfo& renderInfo,
int component
135 ,
bool isLightBin,
bool isDepthBin,
bool isShadowPass);
virtual void uploadCameraData(const osg::Camera *camera, const Observer &obs)
Uploads per-camera observer data to the camera UBO for this frame.
This represents an arbitrary user pointer/data within DtKeyedData.
Definition: DtKeyedData.h:95
virtual void releaseGLObjects(osg::State *state)
Releases all GPU buffer objects on the GL thread.
std::vector< int > myScratchPadVector
Scratch buffer used during sort/draw to avoid per-frame allocation.
Definition: DtBallisticRendererUserData.h:164
virtual void clearPerFrameCounters()
Zeros the visible count in myVisibleSSBO and instanceCount in myIndirectSSBO.
DtBallisticRendererUserData & operator=(const DtBallisticRendererUserData &rhs)=delete
Copy assignment is not supported.
DtGlBuffer * myCameraUBO
Per-camera camera UBO (UBO 1 for both cull and draw).
Definition: DtBallisticRendererUserData.h:157
Pairs a ballistic geometry with its model-view matrix for a given cull frame.
Definition: DtBallisticRendererUserData.h:36
virtual void sortAndDraw(osg::RenderInfo &renderInfo, int component, bool isLightBin, bool isDepthBin, bool isShadowPass)
Sorts and draws geometries for a specific render pass.
bool myPerCameraBuffersInitialized
True after initializePerCameraBuffers() has completed.
Definition: DtBallisticRendererUserData.h:167
DtBallisticGeometryAndProps()
Default constructor.
OSG Drawable that drives per-camera GPU cull and draw for a ballistic spatial cell.
Definition: DtBallisticGeometry.h:58
virtual void bindForDraw()
Saves current SSBO/UBO bindings and binds per-camera draw buffers.
std::vector< DtBallisticGeometryAndProps > myBallisticGeometries
Geometries registered by the renderer during the cull pass for this frame.
Definition: DtBallisticRendererUserData.h:144
DtGlBuffer * myVisibleSSBO
Per-camera visible bullet list SSBO (SSBO 7 for cull writes; SSBO 12 for draw reads).
Definition: DtBallisticRendererUserData.h:147
OSG Drawable that batches and issues GPU draw calls for all ballistic geometries. ...
Definition: DtBallisticRenderer.h:46
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:23
const DtBallisticRunTimeSettings & myBallisticRunTimeSettings
Reference to the shared ballistic runtime settings.
Definition: DtBallisticRendererUserData.h:161
virtual void initializePerCameraBuffers()
One-time allocation of per-camera GPU buffers; no-op after first call.
virtual ~DtBallisticRendererUserData()
Virtual destructor.
DtGlBuffer * myIndirectSSBO
Per-camera indirect draw command SSBO.
Definition: DtBallisticRendererUserData.h:154
int mySavedSsbo12
Saved SSBO 12 binding; restored by unbindAfterDraw().
Definition: DtBallisticRendererUserData.h:172
osg::Matrixd myModelViewMatrix
Model-view matrix at the time of cull registration.
Definition: DtBallisticRendererUserData.h:45
int mySavedSsbo1
Saved SSBO 1 binding; restored by unbindAfterDraw().
Definition: DtBallisticRendererUserData.h:170
A generic OpenGL buffer. This can be: -> a vertex buffer -> an index buffer -> a shader storage buffe...
Definition: DtGlBuffer.h:29
Singleton holding runtime-tweakable settings for the ballistic system.
Definition: DtBallisticRunTimeSettings.h:43
int mySavedUbo1
Saved UBO 1 binding; restored by unbindAfterDraw().
Definition: DtBallisticRendererUserData.h:174
virtual void draw(osg::RenderInfo &renderInfo)
Issues draw calls for all ballistic geometries registered this frame.
Contains DLL export macros.
Per-camera data used by DtBallisticRenderer to drive GPU cull and draw for one camera.
Definition: DtBallisticRendererUserData.h:71
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:76
virtual void bindForCull()
Binds per-camera buffers to the SSBO/UBO slots consumed by cull shaders.
virtual void unbindAfterDraw()
Restores SSBO/UBO bindings saved by bindForDraw().
DtVirtualBaseClassCreator< DtBallisticRendererUserData, const std::string & > DtBallisticRendererUserDataCreator
creator
Definition: DtBallisticRendererUserData.h:49
const char * creatorTypeName< DtBallisticRendererUserData >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtBallisticRendererUserData.h:56
DtBallisticRendererUserData()=delete
Default construction is not supported.
DtBallisticGeometry * myBallisticGeometry
Geometry registered during the cull pass.
Definition: DtBallisticRendererUserData.h:44
Contains the DtKeyedData class declaration.