10 #ifndef hifi_render_Args_h
11 #define hifi_render_Args_h
16 #include <unordered_set>
18 #include <GLMHelpers.h>
19 #include <ViewFrustum.h>
20 #include <StencilMaskMode.h>
21 #include <UUIDHasher.h>
23 #include <gpu/Forward.h>
116 enum DisplayMode { MONO, STEREO_MONITOR, STEREO_HMD };
118 enum RenderMethod { DEFERRED, FORWARD };
136 Args(
const gpu::ContextPointer& context,
137 float sizeScale = 1.0f,
138 int boundaryLevelAdjust = 0,
139 float lodFarAngleHalfTan = 0.1f,
140 float lodNearAngleHalfTan = 0.01f,
141 float lodFarDist = 200.0f,
142 float lodNearDist = 4.0f,
144 DisplayMode displayMode = MONO,
145 RenderMethod renderMethod = DEFERRED,
146 gpu::Batch* batch =
nullptr) :
209 std::shared_ptr<gpu::Context> _context;
307 std::function<void(gpu::Batch&,
const gpu::TexturePointer&)>
_hudOperator {
nullptr };
std::shared_ptr< gpu::Framebuffer > _blitFramebuffer
Definition: Args.h:214
float _lodFarDistSq
See _lodNearDist.
Definition: Args.h:258
float _lodNearDistSq
See _lodFarDist.
Definition: Args.h:261
void pushViewFrustum(const ViewFrustum &viewFrustum)
Adds a view frustum to the top of the stack.
Definition: Args.h:195
float _lodNearAngleHalfTanSq
See _lodFarAngleHalfTan.
Definition: Args.h:248
DisplayMode _displayMode
Current display mode. It can be temporarily overridden for secondary camera task and then restored wh...
Definition: Args.h:269
std::function< void(gpu::Batch &, const gpu::TexturePointer &)> _hudOperator
Used to generate commands for drawing HUD.
Definition: Args.h:307
bool _enableTexturing
Set to false in MakeLightingModel task if texturing is disabled.
Definition: Args.h:288
float _lodFarAngleHalfTan
Definition: Args.h:238
float _lodNearAngleHalfTan
Definition: Args.h:245
render::ScenePointer _scene
Pointer to the main 3D scene.
Definition: Args.h:300
bool _enableSkinning
Set to false in MakeLightingModel task if skinning is disabled.
Definition: Args.h:294
uint32_t _itemShapeKey
Definition: Args.h:285
float _sizeScale
Definition: Args.h:230
int _boundaryLevelAdjust
Definition: Args.h:234
std::function< void(gpu::Batch &)> _stencilMaskOperator
Function that adds batch commands to draw stencil mesh for VR views.
Definition: Args.h:321
bool hasViewFrustum() const
Definition: Args.h:167
size_t _numMirrorFlips
Incremented on each reflection. Not incremented for portals.
Definition: Args.h:331
std::shared_ptr< render::ShapePipeline > _shapePipeline
Temporarily set to a proper pipeline when generating batch commands to render shapes.
Definition: Args.h:217
const ViewFrustum & getViewFrustum() const
Returns reference to the top view frustum on the stack.
Definition: Args.h:187
RenderMode
Definition: Args.h:102
@ MIRROR_RENDER_MODE
This is for the mirror camera mode for the main camera and not for actual mirrors in-game.
Definition: Args.h:110
@ DEFAULT_RENDER_MODE
Used for regular view.
Definition: Args.h:104
@ SHADOW_RENDER_MODE
Used for shadows and maybe highlight effect(?).
Definition: Args.h:107
@ SECONDARY_CAMERA_RENDER_MODE
Secondary camera can render to texture for effects such as mirrors or to screen.
Definition: Args.h:113
bool _takingSnapshot
Definition: Args.h:314
std::stack< ViewFrustum > _viewFrustums
Definition: Args.h:222
gpu::Batch * _batch
Current batch to which the commands will be written.
Definition: Args.h:277
RenderDetails _details
Contains statistics about culling in current frame.
Definition: Args.h:297
RenderMode _renderMode
Definition: Args.h:266
bool isStereo() const
Definition: Args.h:207
int8_t _cameraMode
Definition: Args.h:304
glm::ivec4 _viewport
Viewport rectangle in pixels.
Definition: Args.h:225
float _lodNearDist
Distance in meters at which _lodNearAngleHalfTan applies for size-based culling.
Definition: Args.h:255
size_t _mirrorDepth
Current mirror depth. 0 for main view, 1 for a view reflected once so on.
Definition: Args.h:328
ItemID _ignoreItem
Definition: Args.h:325
float _lodFarDist
Definition: Args.h:252
void popViewFrustum()
Removes the top view frustum from the stack.
Definition: Args.h:202
bool _enableBlendshape
Set to false in MakeLightingModel task if blendshapes are disabled.
Definition: Args.h:291
uint32_t _globalShapeKey
Definition: Args.h:281
RenderMethod _renderMethod
Definition: Args.h:274
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)
Definition: Args.h:136
gpu::TexturePointer _hudTexture
Texture that will be drawn as HUD.
Definition: Args.h:310
StencilMaskMode _stencilMaskMode
Definition: Args.h:318
float _lodFarAngleHalfTanSq
See _lodFarAngleHalfTan.
Definition: Args.h:241
void setViewFrustum(const ViewFrustum &viewFrustum)
Removes currently stored view frustums and adds a given one.
Definition: Args.h:174
Used for gathering statistics about culling in current frame.
Definition: Args.h:30
int _materialSwitches
Number of material switches during this frame.
Definition: Args.h:60
Item _other
Not used currently.
Definition: Args.h:72
Item & edit(Type type)
Gets an editable reference to statistics for a requested render mode.
Definition: Args.h:81
int _trianglesRendered
Number of triangles rendered during this frame.
Definition: Args.h:63
Item _shadow
Used during culling items for shadow bounds.
Definition: Args.h:69
Type
Statistics are generated separately for culling in different render modes.
Definition: Args.h:33
@ ITEM
Used during regular culling.
Definition: Args.h:35
@ SHADOW
Used during culling items for shadow bounds.
Definition: Args.h:38
@ OTHER
Not used currently.
Definition: Args.h:41
Item _item
Used during regular culling.
Definition: Args.h:66
Object containing culling statistics.
Definition: Args.h:45
int _considered
Items considered for culling.
Definition: Args.h:47
int _tooSmall
Items that are too small based on current LOD settings.
Definition: Args.h:53
int _outOfView
Items outside of view frustum.
Definition: Args.h:50
int _rendered
Items that will be rendered.
Definition: Args.h:56