#include <Args.h>
Public Types | |
| enum | RenderMode { DEFAULT_RENDER_MODE , SHADOW_RENDER_MODE , MIRROR_RENDER_MODE , SECONDARY_CAMERA_RENDER_MODE } |
Public Member Functions | |
| Args (const gpu::ContextPointer &context, float sizeScale=1.0f, int boundaryLevelAdjust=0, float lodFarAngleHalfTan=0.1f, float lodNearAngleHalfTan=0.01f, float lodFarDist=200.0f, float lodNearDist=4.0f, RenderMode renderMode=DEFAULT_RENDER_MODE, DisplayMode displayMode=MONO, RenderMethod renderMethod=DEFERRED, gpu::Batch *batch=nullptr) | |
| bool | hasViewFrustum () const |
| void | setViewFrustum (const ViewFrustum &viewFrustum) |
| Removes currently stored view frustums and adds a given one. More... | |
| const ViewFrustum & | getViewFrustum () const |
| Returns reference to the top view frustum on the stack. More... | |
| void | pushViewFrustum (const ViewFrustum &viewFrustum) |
| Adds a view frustum to the top of the stack. More... | |
| void | popViewFrustum () |
| Removes the top view frustum from the stack. More... | |
| bool | isStereo () const |
Public Attributes | |
| std::shared_ptr< gpu::Framebuffer > | _blitFramebuffer |
| std::shared_ptr< render::ShapePipeline > | _shapePipeline |
| Temporarily set to a proper pipeline when generating batch commands to render shapes. | |
| std::stack< ViewFrustum > | _viewFrustums |
| glm::ivec4 | _viewport { 0.0f, 0.0f, 1.0f, 1.0f } |
| Viewport rectangle in pixels. | |
| float | _sizeScale { 1.0f } |
| int | _boundaryLevelAdjust { 0 } |
| float | _lodFarAngleHalfTan { 0.1f } |
| float | _lodFarAngleHalfTanSq { _lodFarAngleHalfTan * _lodFarAngleHalfTan } |
See _lodFarAngleHalfTan. | |
| float | _lodNearAngleHalfTan { 0.01f } |
| float | _lodNearAngleHalfTanSq { _lodNearAngleHalfTan * _lodNearAngleHalfTan } |
See _lodFarAngleHalfTan. | |
| float | _lodFarDist { 200.0f } |
| float | _lodNearDist { 4.0f } |
Distance in meters at which _lodNearAngleHalfTan applies for size-based culling. | |
| float | _lodFarDistSq { _lodFarDist * _lodFarDist } |
See _lodNearDist. | |
| float | _lodNearDistSq { _lodNearDist * _lodNearDist } |
See _lodFarDist. | |
| RenderMode | _renderMode { DEFAULT_RENDER_MODE } |
| DisplayMode | _displayMode { MONO } |
| Current display mode. It can be temporarily overridden for secondary camera task and then restored when task is done. | |
| RenderMethod | _renderMethod { DEFERRED } |
| gpu::Batch * | _batch = nullptr |
| Current batch to which the commands will be written. | |
| uint32_t | _globalShapeKey { 0 } |
| uint32_t | _itemShapeKey { 0 } |
| bool | _enableTexturing { true } |
Set to false in MakeLightingModel task if texturing is disabled. | |
| bool | _enableBlendshape { true } |
Set to false in MakeLightingModel task if blendshapes are disabled. | |
| bool | _enableSkinning { true } |
Set to false in MakeLightingModel task if skinning is disabled. | |
| RenderDetails | _details |
| Contains statistics about culling in current frame. | |
| render::ScenePointer | _scene |
| Pointer to the main 3D scene. | |
| int8_t | _cameraMode { -1 } |
| std::function< void(gpu::Batch &, const gpu::TexturePointer &)> | _hudOperator { nullptr } |
| Used to generate commands for drawing HUD. | |
| gpu::TexturePointer | _hudTexture { nullptr } |
| Texture that will be drawn as HUD. | |
| bool | _takingSnapshot { false } |
| StencilMaskMode | _stencilMaskMode { StencilMaskMode::NONE } |
| std::function< void(gpu::Batch &)> | _stencilMaskOperator |
| Function that adds batch commands to draw stencil mesh for VR views. | |
| ItemID | _ignoreItem { 0 } |
| size_t | _mirrorDepth { 0 } |
| Current mirror depth. 0 for main view, 1 for a view reflected once so on. | |
| size_t | _numMirrorFlips { 0 } |
| Incremented on each reflection. Not incremented for portals. | |
Used by AppRenderArgs class in GraphicsEngine. They contain current frame setup and some statistics. During some of the rendering steps, render arguments are modified and then restored, for example during rendering of mirrored views.
|
inline |
| context | Shared pointer to the GPU context. |
| sizeScale | Refer to _sizeScale comment. |
| boundaryLevelAdjust | A coefficient related to octree depth. |
| lodFarAngleHalfTan | Precomputed half tangent of angle threshold for size-based culling. Applied at distance _lodFarDist. |
| lodNearAngleHalfTan | Precomputed half tangent of angle threshold for size-based culling. Applied at distance _lodNearDist. |
| lodFarDist | Distance in meters at which _lodFarAngleHalfTan applies for size-based culling. |
| lodNearDist | Distance in meters at which _lodNearAngleHalfTan applies for size-based culling. |
| renderMode | DEFAULT_RENDER_MODE is always passed here. |
| displayMode | TODO: It's always set to MONO in Application::updateRenderArgs() but then set to correct value soon after. |
| renderMethod | TODO: It's always set to DEFERRED? |
| batch | nullptr is passed here. |
|
inline |
Returns reference to the top view frustum on the stack.
This function should never be called when frustum stack is empty.
|
inline |
true if there is one or more frustums stored currently.
|
inline |
|
inline |
Removes the top view frustum from the stack.
Should never be called on empty stack.
|
inline |
Adds a view frustum to the top of the stack.
Used for mirrors, secondary camera, shadow cameras and debugging purposes.
| viewFrustum | View frustum to be added to the stack. |
|
inline |
Removes currently stored view frustums and adds a given one.
| viewFrustum | View frustum to add. |
| std::shared_ptr<gpu::Framebuffer> render::Args::_blitFramebuffer |
Framebuffer where rendered image will be stored. For regular frame it's the final framebuffer. It's temporarily changed to other buffers when rendering mirrors and for secondary camera.
| int render::Args::_boundaryLevelAdjust { 0 } |
A coefficient related to octree depth. DOCTODO: needs to be documented in LODManager.
| int8_t render::Args::_cameraMode { -1 } |
Current camera mode for the primary camera. It's set once before command generation for a given frame starts.
| uint32_t render::Args::_globalShapeKey { 0 } |
Contains shared settings for all rendered shapes. Currently used to render all shapes as wireframe.
| ItemID render::Args::_ignoreItem { 0 } |
Used to avoid drawing mirror or portal item. Set temporarily for mirror/portal views and then restored.
| uint32_t render::Args::_itemShapeKey { 0 } |
Settings for the currently rendered shape. It's set before generating batch commands for rendering a shape and set to 0 after it's finished.
| float render::Args::_lodFarAngleHalfTan { 0.1f } |
Precomputed half tangent of angle threshold for size-based culling. Applied at distance _lodFarDist.
| float render::Args::_lodFarDist { 200.0f } |
Distance in meters at which _lodFarAngleHalfTan applies for size-based culling. For distances between _lodFarDist and _lodNearDist the value is interpolated between near and far value.
| float render::Args::_lodNearAngleHalfTan { 0.01f } |
Precomputed half tangent of angle threshold for size-based culling. Applied at distance _lodNearDist.
| RenderMethod render::Args::_renderMethod { DEFERRED } |
Current render method. Sometimes it's overridden locally and then restored, for example in DrawLayered3D::run. It's also set by SetRenderMethod job, for example in RenderForwardTask and RenderShadowsAndDeferredTask.
| RenderMode render::Args::_renderMode { DEFAULT_RENDER_MODE } |
Current render mode for a given task. During execution of tasks that generate batch commands this is changed to reflect current task and then restored. This happens for example for shadow rendering task.
| float render::Args::_sizeScale { 1.0f } |
DOCTODO: this is very confusing. When Args are created, lodManager->getVisibilityDistance() is put here, even though variable is called scale. It seems to be used only when fetching spatial tree for orthographic camera and for drawing LOD reticle.
| StencilMaskMode render::Args::_stencilMaskMode { StencilMaskMode::NONE } |
Used for view stencil in VR. Temporarily changed to StencilMaskMode::NONE for secondary camera and then set back to previous value.
| bool render::Args::_takingSnapshot { false } |
true when snapshot is being taken on primary camera. false when snapshot is being taken on secondary camera or not taken at all.
| std::stack<ViewFrustum> render::Args::_viewFrustums |
Stores view frustums. Storing multiple frustums is required when tasks such as generating render batches for mirrors, shadows and secondary camera are executed.