![]() |
VR-Forces Developer's Guide
|
Interface for the ballistic rendering draw pass.
Manages the VirtualProgram state, mesh geometry, and additive-blend GL state needed to issue instanced draw calls for visible projectiles. Instantiated via the DtBallisticDrawComponentCreator factory.
Public Member Functions | |
| virtual | ~DtBallisticDrawComponent () |
| virtual void | initialize () |
| virtual void | update (osg::RenderInfo &renderInfo) |
| virtual void | apply (osg::RenderInfo &renderInfo) |
| virtual void | drawBullets (DtGlBuffer *visibleSSBO, DtGlBuffer *indirectDrawSSBO) |
| virtual void | drawDebug (osg::RenderInfo &renderInfo, DtGlBuffer *visibleSSBO, DtGlBuffer *indirectDrawSSBO, int debugMode) |
| virtual void | releaseGLObjects (osg::State *state) |
| virtual bool | shouldDraw (bool isShadowPass) |
| void | unbindCullBuffers () |
| void | unbindDrawBuffers () |
| virtual void | slot_reloadShaders () |
| void | setComputeComponent (DtBallisticComputeComponent *computeComponent) |
Public Attributes | |
| friend | DtBallisticDrawComponentCreator |
Protected Member Functions | |
| DtBallisticDrawComponent (DtDe &de) | |
Protected Attributes | |
| DtDe & | myDe |
| DtSignalConnectionManager | myConnections |
| const DtBallisticRunTimeSettings & | myBallisticRunTimeSettings |
| osg::ref_ptr< osg::StateSet > | myStateSet |
| DtIndirectShaderManager & | myIndirectShaderManager |
| GLuint | myMeshVao |
| GLuint | myMeshVbo |
| GLuint | myMeshEbo |
| int | myMeshIndexCount |
| bool | myVPInitialized |
| osg::ref_ptr< osg::StateSet > | myDebugStateSet |
| bool | myDebugVPInitialized |
| DtBallisticComputeComponent * | myComputeComponent |
Private Member Functions | |
| DtBallisticDrawComponent ()=delete | |
| DtBallisticDrawComponent (const DtBallisticDrawComponent &rhs)=delete | |
| DtBallisticDrawComponent & | operator= (const DtBallisticDrawComponent &rhs)=delete |
|
protected |
Protected constructor; use the creator factory to instantiate.
| de | Simulation environment. |
|
virtual |
Virtual destructor.
|
privatedelete |
Default construction is not supported.
|
privatedelete |
Copy construction is not supported.
|
privatedelete |
Copy assignment is not supported.
|
virtual |
One-time creation of the StateSet (blend, depth attributes) and bullet mesh.
Called from update() on the first frame. Subsequent calls are no-ops. Mirrors DtIndirectDefaultDrawComponent::initialize().
|
virtual |
Ensures the VirtualProgram is initialized; no-op after the first call.
|
virtual |
Applies the VirtualProgram StateSet and sets raw GL blend/depth state for bullet rendering.
|
virtual |
Issues the indirect draw call for this camera's visible bullets.
The per-camera buffer bindings (SSBO 12, UBO 1) are set up by the caller via DtBallisticRendererUserData::bindForDraw() before this is called.
| visibleSSBO | The per-camera VisibleBulletLists SSBO. |
| indirectDrawSSBO | The per-camera IndirectDrawCommands SSBO. |
|
virtual |
Draws debug visualisation lines for active DtBallisticRunTimeSettings toggles.
| renderInfo | OSG render info for state application. |
| visibleSSBO | The per-camera VisibleBulletLists SSBO. |
| indirectDrawSSBO | The per-camera IndirectDrawCommands SSBO. |
| debugMode | 0 = bounding boxes, 1 = velocity vectors. |
|
virtual |
Releases all OpenGL objects associated with this component.
Returns true if this component should execute during shadow passes.
| void makVrv::DtBallisticDrawComponent::unbindCullBuffers | ( | ) |
Unbinds all ballistic SSBO/UBO binding points via the compute component.
Called after the draw pass completes to restore clean indexed-buffer state. Also clears the active GL program via glUseProgram(0). Use only from non-draw paths (cull, compute, query).
| void makVrv::DtBallisticDrawComponent::unbindDrawBuffers | ( | ) |
Unbinds SSBO/UBO binding points without clearing the GL program.
Called after the draw pass to restore clean indexed-buffer state while keeping the VirtualProgram's composed program active so that OSG's tracked lastAppliedProgramObject stays consistent with GL state.
|
virtual |
Reloads the render shaders.
| void makVrv::DtBallisticDrawComponent::setComputeComponent | ( | DtBallisticComputeComponent * | computeComponent | ) |
Provides the compute component reference used to bind the BallisticCameraUbo at draw time.
Called once from DtBallisticComputeComponent constructor after the draw component is created.
| friend makVrv::DtBallisticDrawComponent::DtBallisticDrawComponentCreator |
|
protected |
Reference to the simulation environment.
|
protected |
Manages signal connections for shader reload notifications.
|
protected |
Reference to the shared ballistic runtime settings.
|
protected |
OSG state set carrying the render VirtualProgram.
|
protected |
Reference to the indirect shader manager used to load shaders.
|
protected |
OpenGL VAO for the bullet mesh.
|
protected |
Interleaved position and normal VBO for the bullet mesh.
|
protected |
Element index buffer for the bullet mesh.
|
protected |
Number of indices in the element buffer.
|
protected |
True after the render VirtualProgram has been installed on myStateSet.
|
protected |
OSG state set carrying the debug VirtualProgram.
|
protected |
True after the debug VirtualProgram has been installed on myDebugStateSet.
|
protected |
Compute component providing the BallisticCameraUbo for binding at draw time.