XII Release 0.1.0
Loading...
Searching...
No Matches
xiiView Class Reference

#include <View.h>

Inheritance diagram for xiiView:
[legend]

Public Types

using RenderGraphBuilder = xiiDelegate<void(xiiView&, xiiRenderGraph&, xiiRenderGraphBlackboard&)>

Public Member Functions

xiiWorld * GetWorld () const
 Copyright (c) Theophilus Eriata. All Rights Reserved.
xiiViewHandle GetHandle () const
xiiStringView GetName () const
void SetName (xiiStringView sName)
xiiGALTextureView * GetRenderTargetView () const
void SetRenderTargetView (xiiGALTextureView *pRenderTargetView)
 Retains the offscreen output view and its texture until replaced or this view is destroyed.
const xiiGALSwapChain * GetSwapChain () const
 Sets the swapchain that this view will be rendering into.
void SetSwapChain (const xiiGALSwapChain *pSwapChain)
void SetCamera (xiiCamera *pCamera)
xiiCamera * GetCamera ()
const xiiCamera * GetCamera () const
void SetCullingCamera (const xiiCamera *pCamera)
const xiiCamera * GetCullingCamera () const
void SetLodCamera (const xiiCamera *pCamera)
const xiiCamera * GetLodCamera () const
xiiEnum< xiiCameraUsageHint > GetCameraUsageHint () const
void SetCameraUsageHint (xiiEnum< xiiCameraUsageHint > hint)
void SetViewRenderMode (xiiEnum< xiiViewRenderMode > value)
xiiEnum< xiiViewRenderMode > GetViewRenderMode () const
void SetRenderPath (xiiEnum< xiiRenderPath > value)
xiiEnum< xiiRenderPath > GetRenderPath () const
xiiResult SetSensorProfile (xiiSensorProfileHandle hProfile)
 Configures passes that opt into the view sensor profile. An invalid handle disables them.
xiiSensorProfileHandle GetSensorProfile () const
xiiSharedPtr< xiiGALTexture > GetSensorOutputTexture () const
xiiResult SetDisplayOutputSettings (const xiiDisplayOutputSettings &settings)
 Applies validated, view-local exposure, tone-mapping and display calibration.
const xiiDisplayOutputSettings & GetDisplayOutputSettings () const
xiiUInt64 GetDisplayOutputSettingsRevision () const
void InvalidateTemporalHistory ()
 Invalidates all per-view temporal lighting and reconstruction history after a camera cut or teleport.
void SetViewport (const xiiRectFloat &viewport)
const xiiRectFloat & GetViewport () const
void SetRenderScale (float fRenderScale)
float GetRenderScale () const
 Returns the configured per-view render scale factor (1.0 = native).
float GetRenderResolutionScale () const
 Returns the dynamic render scale applied to this view (1.0 = native viewport resolution).
xiiUInt32 GetRenderResolutionWidth () const
 Returns the dynamic internal render resolution width for this view.
xiiUInt32 GetRenderResolutionHeight () const
 Returns the dynamic internal render resolution height for this view.
const xiiViewData & GetData () const
bool IsValid () const
void SetRenderEnabled (bool bEnabled)
bool IsRenderEnabled () const
xiiResult ComputePickingRay (float fNormalizedScreenPosX, float fNormalizedScreenPosY, xiiVec3 &out_vRayStartPos, xiiVec3 &out_vRayDir) const
xiiResult ComputeScreenSpacePos (const xiiVec3 &vWorldPos, xiiVec3 &out_vScreenPosNormalized) const
xiiResult ComputeWorldSpacePos (float fNormalizedScreenPosX, float fNormalizedScreenPosY, xiiVec3 &out_vWorldPos) const
 Calculates the near-plane world position at the normalized screen coordinates.
void ConvertScreenPixelPosToNormalizedPos (xiiVec3 &inout_vPixelPos)
 Converts a screen-space position from pixel coordinates to normalized coordinates.
void ConvertScreenNormalizedPosToPixelPos (xiiVec3 &inout_vNormalizedPos)
 Converts a screen-space position from normalized coordinates to pixel coordinates.
const xiiMat4 & GetProjectionMatrix (xiiCameraEye eye) const
 Native projections use ZeroToOne reversed Z (near=1, far=0), unlike Core camera projections.
const xiiMat4 & GetInverseProjectionMatrix (xiiCameraEye eye) const
const xiiMat4 & GetViewMatrix (xiiCameraEye eye) const
const xiiMat4 & GetInverseViewMatrix (xiiCameraEye eye) const
const xiiMat4 & GetViewProjectionMatrix (xiiCameraEye eye) const
const xiiMat4 & GetInverseViewProjectionMatrix (xiiCameraEye eye) const
void ComputeCullingFrustum (xiiFrustum &out_frustum) const
void SetRenderPipelineResource (const xiiRenderPipelineResourceHandle &pipeline)
const xiiRenderPipelineResourceHandle & GetRenderPipelineResource () const
const xiiRenderPipelineInstance & GetRenderPipelineInstance () const
xiiBitflags< xiiRenderExtractionCategory > GetExtractionRequirements () const
const xiiRenderExtractionStatistics & GetExtractionStatistics () const
void SetRenderGraphExtractionRequirements (xiiBitflags< xiiRenderExtractionCategory > requirements)
 Custom graph builders default to All for compatibility; specialize their demand explicitly.
bool IsGpuSceneInitialized () const
const xiiGpuInstanceData * GetGpuInstanceData () const
xiiArrayPtr< const xiiUInt32 > GetGpuInstanceSelection () const
xiiBitflags< xiiRenderPipelineFeature > GetRuntimeFeatures () const
void SetRenderGraphRuntimeFeatures (xiiBitflags< xiiRenderPipelineFeature > features)
xiiResult ResolveRenderedMesh (xiiUInt32 uiGpuObjectId, xiiGpuInstanceSource &out_source) const
 Copyright (c) Theophilus Eriata. All Rights Reserved.
void SetPipelineParameter (xiiStringView name, const xiiVariant &value)
void RemovePipelineParameter (xiiStringView name)
const xiiVariantDictionary & GetPipelineParameters () const
void SetRenderGraphBuilder (RenderGraphBuilder builder)
const RenderGraphBuilder & GetRenderGraphBuilder () const
xiiUInt32 GetRenderGraphBuilderVersion () const
xiiRenderGraph * GetRenderGraph ()
const xiiRenderGraph * GetRenderGraph () const
xiiExtractedRenderData * GetExtractedRenderData ()
const xiiExtractedRenderData * GetExtractedRenderData () const
xiiRenderGraphBlackboard & GetBlackboard ()
const xiiRenderGraphBlackboard & GetBlackboard () const
xiiRenderGraphResourceCache & GetResourceCache ()
const xiiRenderGraphResourceCache & GetResourceCache () const
xiiRenderGraphTimestampProfiler & GetProfiler ()
 Returns the device-wide GPU timestamp profiler.
Public Member Functions inherited from xiiReflectedClass
virtual const xiiRTTI * GetDynamicRTTI () const
bool IsInstanceOf (const xiiRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
template<typename T>
XII_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.

Public Attributes

xiiTagSet m_IncludeTags
xiiTagSet m_ExcludeTags

Friends

class xiiRenderWorldModule
class xiiViewRenderResourceManager
class xiiViewRenderResourceManagerState
class xiiMemoryUtils

Additional Inherited Members

Static Public Member Functions inherited from xiiNoBase
static const xiiRTTI * GetStaticRTTI ()

Detailed Description

Encapsulates a view on the given world through the given camera and rendered with the specified RenderPipeline into the given render target setup.

The view owns a generation-checked context for its rendering pipeline. Persistent GPU resources are stored by xiiViewRenderResourceManager so they are released before allocator and GAL shutdown regardless of world lifetime. A selected render pipeline resource populates the graph each frame.

Member Function Documentation

◆ ComputePickingRay()

XII_FORCE_INLINE xiiResult xiiView::ComputePickingRay ( float fNormalizedScreenPosX,
float fNormalizedScreenPosY,
xiiVec3 & out_vRayStartPos,
xiiVec3 & out_vRayDir ) const

Calculates the start position and direction (in world space) of the picking ray through the screen position in this view.

fNormalizedScreenPosX and fNormalizedScreenPosY are expected to be in [0; 1] range (normalized screen coordinates). If no ray can be computed, XII_FAILURE is returned.

◆ ComputeScreenSpacePos()

XII_FORCE_INLINE xiiResult xiiView::ComputeScreenSpacePos ( const xiiVec3 & vWorldPos,
xiiVec3 & out_vScreenPosNormalized ) const

Calculates the normalized screen-space coordinate ([0; 1] range) that the given world-space point projects to.

Returns XII_FAILURE, if the point could not be projected into screen-space.

◆ GetRenderPipelineInstance()

const xiiRenderPipelineInstance & xiiView::GetRenderPipelineInstance ( ) const

Read-only view-local pass state from the most recent pipeline build. Call only at a CPU frame boundary while holding world access. Pass pointers/arrays are borrowed until the next build; resource replacement or a failed synchronization can destroy them. Empty before the first build.

◆ GetSensorOutputTexture()

xiiSharedPtr< xiiGALTexture > xiiView::GetSensorOutputTexture ( ) const
nodiscard

Returns the first completed output of a pass using this view profile, in compiled node order. Empty after profile changes or disabling output, until rendering completes. Retain for asynchronous readback; synchronize GPU completion through GAL before accessing the image contents.

◆ ResolveRenderedMesh()

xiiResult xiiView::ResolveRenderedMesh ( xiiUInt32 uiGpuObjectId,
xiiGpuInstanceSource & out_source ) const

Copyright (c) Theophilus Eriata. All Rights Reserved.

Resolves an object ID produced by this view's native GPU scene to a live mesh owner. Call at a CPU frame boundary under world access. The ID must come from this view; asynchronous callers must also retain/validate their view, camera and capture state. Returns failure and clears output for background, retired packets or deleted owners.

◆ SetRenderEnabled()

void xiiView::SetRenderEnabled ( bool bEnabled)
inline

Controls render-data extraction and graph execution by the owning world module. Disabled views retain their camera, targets, pipeline instance, and cached resources. This does not change IsValid(). Call InvalidateTemporalHistory() when resuming after a camera cut. Like other view mutations, this requires exclusive access to the owning world.

◆ SetRenderPath()

XII_ALWAYS_INLINE void xiiView::SetRenderPath ( xiiEnum< xiiRenderPath > value)

Selects Forward+ or deferred opaque direct lighting for this view. Forward+ automatically falls back to deferred when the active device cannot execute the GPU-scene mesh path.

◆ SetRenderScale()

void xiiView::SetRenderScale ( float fRenderScale)

Sets the per-view render scale factor (1.0 = native). This integrates with dynamic resolution as a baseline multiplier.

Member Data Documentation

◆ m_ExcludeTags

xiiTagSet xiiView::m_ExcludeTags

Exclude objects with any of these tags, even if they also match m_IncludeTags. Both filters are evaluated each extraction, including for cached static render data.

◆ m_IncludeTags

xiiTagSet xiiView::m_IncludeTags

Extract active objects with any of these tags. An empty set includes all active objects. Tags apply to each object independently; parent tags are not inherited.


The documentation for this class was generated from the following files:
  • /home/runner/work/XII/XII/Source/Engine/GraphicsCore/Pipeline/View.h
  • /home/runner/work/XII/XII/Source/Engine/GraphicsCore/Pipeline/Implementation/View.cpp
  • /home/runner/work/XII/XII/Source/Engine/GraphicsCore/Pipeline/Implementation/View_inl.h
  • /home/runner/work/XII/XII/Source/Engine/GraphicsCore/Pipeline/Implementation/ViewPicking.cpp