Graphics#
-
namespace graphics#
Enums
-
enum class GpuLightType : std::uint32_t#
Physical light source category for GPU shading and shadow casting.
Values:
-
enumerator Directional#
Distant directional sun light with cascaded shadow maps.
-
enumerator Point#
Omnidirectional point light source with spherical attenuation.
-
enumerator Spot#
Cone-constrained spotlight source with projected shadow map.
-
enumerator Directional#
-
enum class GpuRenderableFlags : std::uint32_t#
Bitmask flags describing renderable object visibility and pipeline behavior.
Values:
-
enumerator None#
Inactive or non-rendering object.
-
enumerator Active#
Object is active and candidate for rendering.
-
enumerator Opaque#
Object draws in the opaque pass.
-
enumerator ShadowCaster#
Object casts shadows into directional/local shadow maps.
-
enumerator None#
-
enum class GpuRenderableDeformableType : std::uint32_t#
Deformation binding classification for GPU skinning and soft-body animation.
Values:
-
enumerator None#
Rigid transform only; no GPU deformation.
-
enumerator SoftBody#
Volumetric 3D soft-body particle skinning.
-
enumerator Curve#
1D elastic strand / curve deformation.
-
enumerator None#
-
enum class GpuLightShadowMode : std::uint32_t#
Shadow casting and projection mode for a GPU light source.
Values:
-
enumerator None#
Light does not cast shadows.
-
enumerator Local2D#
2D spotlight projection shadow map.
-
enumerator Point#
6-face omnidirectional cubemap point shadow map.
-
enumerator None#
-
enum class CameraBackgroundMode : std::uint32_t#
Clear behavior and background mode applied prior to rendering a camera’s view.
Values:
-
enumerator ClearColor#
Clear to solid RGBA color.
-
enumerator EnvironmentCubemap#
Render background skybox cubemap.
-
enumerator ClearColor#
-
enum class MaterialProgramFamily#
Shader program specialization family applied when rendering surface primitives.
Values:
-
enumerator StandardLit#
Standard PBR metallic-roughness lit surface pipeline.
-
enumerator SoftBodyLit#
Deformable tetrahedral/surface soft-body mesh pipeline with skinning.
-
enumerator CurveLit#
Elastic strand and ribbon curve rendering pipeline.
-
enumerator StandardLit#
-
enum class MaterialRenderMode#
Blending and rasterization mode determining pipeline stage assignment.
Values:
-
enumerator Opaque#
Fully opaque surface writing depth and color in the primary pass.
-
enumerator Cutout#
Alpha-tested masked surface discarding pixels below cutoff threshold.
-
enumerator Transparent#
Alpha-blended transparent surface rendered in the back-to-front pass.
-
enumerator Opaque#
-
enum class TextureColorSpace#
Color space encoding used when sampling texture data.
Values:
-
enumerator Linear#
Linear color or non-color data (normal maps, metallic-roughness, ambient occlusion).
-
enumerator Srgb#
sRGB non-linear gamma-corrected color data (base color, albedo, emissive).
-
enumerator Linear#
-
enum class TexturePixelFormat#
Channel layout and bit depth of pixel buffers.
Values:
-
enumerator RGBA8#
8-bit unsigned normalized RGBA (4 bytes per pixel).
-
enumerator RGBA16F#
16-bit floating-point half-precision RGBA (8 bytes per pixel, HDR).
-
enumerator RGBA8#
-
enum class TextureMipPolicy#
Declared mipmap generation policy for a texture asset.
Values:
-
enumerator Disabled#
Declares that no additional mipmaps should be generated.
-
enumerator Generate#
Currently unused; supplied subresource payloads are uploaded unchanged.
-
enumerator Disabled#
-
enum class TextureDimension#
Spatial dimension category of a texture asset.
Values:
-
enumerator Texture2D#
Standard 2D planar texture.
-
enumerator TextureCube#
6-face cubemap texture for skyboxes and image-based lighting.
-
enumerator Texture2D#
-
enum class IblQualityTier : std::uint32_t#
Image-based lighting (IBL) environment quality tier.
Values:
-
enumerator Off#
Environment IBL lighting disabled.
-
enumerator DiffuseOnly#
Diffuse irradiance cubemap only.
-
enumerator Full#
Full diffuse irradiance and split-sum prefiltered specular reflections.
-
enumerator Off#
-
enum class MaterialFeatureFlags : std::uint32_t#
Bitmask flags describing material shader features and rasterization behavior.
Values:
-
enumerator None#
No optional shader features enabled.
-
enumerator AlphaTest#
Alpha testing / cutout mask discarding enabled.
-
enumerator NormalMap#
Tangent-space normal mapping enabled.
-
enumerator ClearCoat#
Currently unused by the material shading implementation.
-
enumerator DoubleSided#
Disables backface culling and flips normals on backfaces.
-
enumerator None#
Functions
-
EnvironmentIblDesc createEnvironmentIblFromCubemapImages(RenderResourceManager &resources, const std::array<EnvironmentCubemapImage, 6u> &faces, const EnvironmentIblBakeOptions &options = {})#
Convolves raw in-memory cubemap face images and registers IBL textures in the resource manager.
- Parameters:
resources – Resource manager to receive generated textures.
faces – Array of 6 cubemap face image payloads (+X, -X, +Y, -Y, +Z, -Z).
options – Baking resolution and sample count options.
- Throws:
std::runtime_error – if face dimensions do not match.
- Returns:
Populated EnvironmentIblDesc referencing the registered background, irradiance, and specular cubemaps.
-
EnvironmentIblDesc createEnvironmentIblFromCubemapFiles(RenderResourceManager &resources, const std::array<std::filesystem::path, 6u> &facePaths, const EnvironmentIblBakeOptions &options = {})#
Loads cubemap face image files from disk, performs IBL convolution, and registers resulting textures.
- Parameters:
resources – Resource manager to receive generated textures.
facePaths – Array of 6 filesystem paths to image files.
options – Baking options.
- Throws:
std::runtime_error – if an image cannot be loaded or the loaded face dimensions differ.
- Returns:
Populated EnvironmentIblDesc referencing the registered cubemaps.
-
constexpr std::uint32_t mainDirectionalLightIndex(const common::SceneLayoutDesc &layout, std::uint32_t envIndex) noexcept#
Computes the global linear light index for the primary directional light in a given environment.
- Parameters:
layout – Multi-environment scene layout descriptor.
envIndex – Zero-based environment index.
- Returns:
Global GPU light buffer index or kInvalidGpuSceneIndex.
-
inline bool usesTransparentPass(const MaterialResourceDesc &desc) noexcept#
Checks if a material is configured to draw in the transparent render pass.
- Parameters:
desc – Material descriptor to check.
- Returns:
True if renderMode is Transparent.
-
inline MaterialFeatureFlags effectiveMaterialFeatureFlags(const MaterialResourceDesc &desc) noexcept#
Derives the effective shader feature flags for a material based on its mode and pipeline settings.
- Parameters:
desc – Material descriptor.
- Returns:
Adjusted MaterialFeatureFlags bitmask.
-
inline EnvironmentFluidDesc defaultEnvironmentFluidDesc() noexcept#
Returns default rendering settings for fluid surfaces.
- Returns:
EnvironmentFluidDesc struct with default water-like parameters.
Variables
-
constexpr std::uint32_t kInvalidGpuSceneIndex = 0xffffffffu#
Sentinel constant representing an invalid or unallocated GPU scene slot index.
-
constexpr std::uint32_t kMainDirectionalLightSlot = 0u#
Fixed slot index within each environment reserved for the main directional sun light.
-
constexpr std::uint32_t kInvalidBatchCameraLayer = 0xffffffffu#
Sentinel constant representing an unassigned batch camera shadow layer.
-
constexpr std::uint32_t kForwardLocalLightCap = 8u#
Maximum number of local (point/spot) lights processed per environment during forward shading.
-
constexpr std::uint32_t kShadowedLocalLightCap = 4u#
Maximum number of shadowed local lights evaluated per environment.
-
constexpr std::uint32_t kShadowedPointLightCap = 1u#
Maximum number of active shadowed omnidirectional point lights.
-
constexpr std::uint32_t kLocalShadowMaxFaceCount = 6u#
Maximum cubemap face count for point light omnidirectional shadow maps.
-
constexpr std::uint32_t kShadowCascadeCount = 4#
Number of directional shadow map cascades.
-
constexpr std::uint32_t kShadowMapResolution = 2048#
Pixel resolution per shadow map tile or cascade slice.
-
struct CameraData#
- #include <host_scene.h>
Host representation of a virtual camera sensor.
Public Types
-
enum class Product : std::uint32_t#
Target render product generated by this camera.
Values:
-
enumerator ColorDepth#
Standard RGB color buffer and linear depth; supports ManagedPrimary.
-
enumerator Depth#
High-precision depth buffer; requires an ExplicitSurface depth target.
-
enumerator SegmentationDepth#
Integer class mask and linear depth; requires an ExplicitSurface target with color+depth and R32_UINT color.
-
enumerator ColorDepth#
Public Members
-
common::EntityId entityId = common::kInvalidEntityId#
Camera entity ID.
-
std::uint32_t envIndex = 0u#
Environment index hosting the camera.
-
std::uint32_t cameraSlot = 0xffffffffu#
Camera index within the environment.
-
float verticalFovDegrees = 60.0f#
Vertical field of view in degrees.
-
float nearClip = 0.01f#
Near clipping plane distance.
-
float farClip = 1000.0f#
Far clipping plane distance.
-
Product product = Product::ColorDepth#
Output product type.
-
gpu::RenderOutputBinding output = {}#
Output destination. ManagedPrimary accepts ColorDepth only; other products require ExplicitSurface.
-
std::uint32_t outputWidth = 0#
Target width in pixels (0 uses destination size).
-
std::uint32_t outputHeight = 0#
Target height in pixels (0 uses destination size).
-
gpu::GpuRenderViewport viewport = {}#
Normalized subregion viewport; currently honored only for non-layered ExplicitSurface targets.
-
bool clearColor = true#
Clear color attachment flag.
-
bool clearDepth = true#
Clear depth attachment flag.
-
Diligent::float4 clearColorValue = {0.0f, 0.0f, 0.0f, 1.0f}#
Clear color value.
-
float clearDepthValue = 1.0f#
Clear depth value.
-
CameraBackgroundMode backgroundMode#
Background skybox mode.
-
std::uint32_t renderOrder = 0#
Scheduling order for cameras drawing to shared targets.
-
enum class Product : std::uint32_t#
-
struct EnvironmentCubemapImage#
- #include <environment_ibl_baker.h>
In-memory floating-point image payload representing a single cubemap face.
-
struct EnvironmentFluidDesc#
- #include <render_resource_manager.h>
Screen-space fluid surface rendering and optical refraction parameters.
Public Members
-
float smoothness = 0.92f#
Surface smoothness parameter.
-
Diligent::float3 specular = {0.35f, 0.4f, 0.45f}#
Specular highlight tint color.
-
float fresnel = 0.8f#
Fresnel reflection exponent.
-
float depthEdgeThreshold = 0.2f#
Depth discontinuity edge threshold.
-
float filterRadiusPixels = 6.0f#
Bilateral depth smoothing filter radius in pixels.
-
float filterWorldRadius = 0.18f#
World-space depth filter cutoff distance.
-
float filterDepthThreshold = 0.12f#
Depth gradient bilateral threshold.
-
bool enableBackgroundRefraction#
Enable background scene refraction distorting through the fluid volume.
-
float refractionIor = 1.33f#
Index of refraction (1.33 for water).
-
float refractionViewThickness = 0.35f#
Assumed optical thickness along camera view vector.
-
float smoothness = 0.92f#
-
struct EnvironmentIblBakeOptions#
- #include <environment_ibl_baker.h>
Parameter tuning descriptor for Monte Carlo irradiance and specular cubemap baking.
Public Members
-
std::uint32_t irradianceSize = 16u#
Resolution of baked diffuse irradiance cubemap faces.
-
std::uint32_t specularSize#
Resolution of base mip level for prefiltered specular cubemap.
-
std::uint32_t specularMipCount#
Number of roughness mip levels generated for specular convolution.
-
std::uint32_t irradianceSampleCount#
Monte Carlo hemisphere sample count per texel for diffuse irradiance.
-
std::uint32_t specularSampleCount#
Importance sampling sample count per texel/roughness for specular reflection.
-
float intensity = 1.0f#
Global radiant intensity multiplier.
-
float backgroundIntensity#
Background skybox display intensity (-1 inherits
intensity).
-
std::uint32_t irradianceSize = 16u#
-
struct EnvironmentIblDesc#
- #include <render_resource_manager.h>
Image-based lighting (IBL) environment maps and radiance intensity multipliers.
Public Functions
-
inline bool enabled(IblQualityTier tier) const noexcept#
Checks if IBL resources are available and active for the requested quality tier.
- Parameters:
tier – Target IBL quality tier.
- Returns:
True if required cubemaps are valid.
Public Members
-
TextureHandle backgroundCubemap = {}#
Panoramic or cubemap background environment skybox.
-
TextureHandle irradianceCubemap = {}#
Diffuse Lambertian irradiance convolution cubemap.
-
TextureHandle prefilteredSpecularCubemap = {}#
Split-sum prefiltered specular reflection cubemap.
-
float intensity = 1.0f#
Ambient radiance intensity multiplier.
-
float backgroundIntensity = 1.0f#
Background skybox display intensity multiplier.
-
inline bool enabled(IblQualityTier tier) const noexcept#
-
struct ForwardDrawCommand#
- #include <forward_draw_types.h>
Low-level forward rasterization draw command issued to the graphics hardware.
Public Members
-
std::uint32_t instanceIndex = 0xffffffffu#
Base object index or draw call instance offset.
-
std::uint32_t drawListOffset = 0u#
Offset into indirect draw arguments buffer.
-
std::uint32_t useDrawListBuffer#
Flag indicating whether indirect draw list indexing is used.
-
MaterialProgramFamily programFamily#
Material shader program specialization.
-
MaterialFeatureFlags materialFeatureFlags#
Compiled feature flags.
-
common::ResourceId meshId = common::kInvalidResourceId#
Bound mesh resource identifier.
-
common::ResourceId materialId#
Bound material resource identifier.
-
std::uint64_t meshVersion = 0#
Mesh registration version used to validate cached GPU data.
-
std::uint32_t indexCount = 0u#
Number of indices to draw.
-
std::uint32_t instanceIndex = 0xffffffffu#
-
struct GpuBatchCameraMetadata#
- #include <gpu_scene_pipeline_types.h>
Routing metadata describing an active camera in a multi-camera batched render pass.
Public Members
-
std::uint32_t globalCameraIndex = 0u#
Global camera index across all environments.
-
std::uint32_t envIndex = 0u#
Parent environment index.
-
std::uint32_t mainLightIndex#
Primary directional light index for this camera’s environment.
-
std::uint32_t colorLayer = 0u#
Destination color texture array layer.
-
std::uint32_t shadowLayer#
Destination shadow texture array layer.
-
std::uint32_t reserved0 = 0u#
Reserved padding.
-
std::uint32_t reserved1 = 0u#
Reserved padding.
-
std::uint32_t reserved2 = 0u#
Reserved padding.
-
std::uint32_t globalCameraIndex = 0u#
-
struct GpuCameraInput#
- #include <gpu_scene.h>
Raw GPU uniform input buffer layout representing a camera entity.
Public Members
-
Diligent::float4 position = {}#
Camera world position (xyz).
-
Diligent::float4 orientation#
Camera world orientation quaternion (xyzw).
-
Diligent::float4 projectionParams#
FOV (x), near plane (y), far plane (z), reserved (w).
-
Diligent::float4 viewportAndOutputSize#
Viewport origin (xy) and extent (zw).
-
std::uint32_t envIndex = 0u#
Environment index.
-
std::uint32_t cameraSlot = 0u#
Environment local camera slot.
-
std::uint32_t active = 0u#
Active state flag (0 or 1).
-
std::uint32_t entityPoseSlot#
Index into GPU global entity pose buffer.
-
Diligent::float4 position = {}#
-
struct GpuEntitySceneView#
- #include <gpu_scene.h>
Structured collection of GPU buffer views representing the complete scene state on device memory.
Public Members
-
common::SceneLayoutDesc layout = {}#
Multi-environment scene layout limits.
-
common::PoseBufferView poses = {}#
Entity transform pose buffer view.
-
Diligent::IBuffer *renderableMetadataBuffer#
GPU buffer holding GpuRenderableMetadata array.
-
Diligent::IBuffer *renderableQueueInfoBuffer#
GPU buffer holding GpuRenderableQueueInfo array.
-
Diligent::IBuffer *renderableVisibilityFlagsBuffer#
GPU buffer holding per-camera visibility bitmasks.
-
Diligent::IBuffer *renderableShadowCascadeMasksBuffer#
GPU buffer holding shadow cascade visibility masks.
-
Diligent::IBuffer *cameraInputsBuffer = nullptr#
GPU buffer holding GpuCameraInput array.
-
Diligent::IBuffer *preparedCamerasBuffer#
GPU buffer holding GpuPreparedCamera uniforms.
-
Diligent::IBuffer *lightInputsBuffer = nullptr#
GPU buffer holding GpuLightInput array.
-
Diligent::IBuffer *localLightSelectionBuffer#
GPU buffer holding GpuLocalLightSelection array.
-
Diligent::IBuffer *softBodyVertexBindingBuffer#
GPU buffer holding GpuSoftBodyVertexBinding array.
-
std::uint32_t entityCount = 0#
Total active entities.
-
std::uint32_t renderableCount = 0#
Total renderable objects.
-
std::uint32_t cameraCount = 0#
Total cameras.
-
std::uint32_t lightCount = 0#
Total lights.
-
std::uint64_t bindingGeneration = 0#
Monotonic revision counter for buffer bindings.
-
common::SceneLayoutDesc layout = {}#
-
struct GpuLightInput#
- #include <gpu_scene.h>
Raw GPU uniform input buffer layout representing a light source.
Public Members
-
Diligent::float4 positionRange = {}#
World position (xyz) and max attenuation range (w).
-
Diligent::float4 directionIntensity = {}#
Emission direction (xyz) and radiant intensity (w).
-
Diligent::float4 color = {}#
Linear radiant flux color (RGB).
-
Diligent::float4 spotAngles = {}#
Spot angles: cos(inner) in x, cos(outer) in y.
-
float shadowDistance = 0.0f#
Shadow projection distance.
-
float shadowFadeDistance = 0.0f#
Shadow smooth fade distance.
-
float shadowBias = 0.0015f#
Constant shadow depth bias.
-
float shadowPadding0 = 0.0f#
Reserved padding.
-
std::uint32_t envIndex = 0u#
Environment index.
-
std::uint32_t lightSlot = 0u#
Local environment light slot.
-
std::uint32_t type = 0u#
GpuLightType enum integer value.
-
std::uint32_t active = 0u#
Active flag (1 = active, 0 = inactive).
-
std::uint32_t castsShadows = 0u#
Shadow casting flag (0 or 1).
-
std::uint32_t reserved0 = 0u#
Reserved padding.
-
std::uint32_t reserved1 = 0u#
Reserved padding.
-
std::uint32_t reserved2 = 0u#
Reserved padding.
-
Diligent::float4 positionRange = {}#
-
struct GpuLightShadowAssignment#
- #include <gpu_scene_pipeline_types.h>
Mapping linking a scene light to its allocated shadow map viewport and projection slice.
-
struct GpuLocalLightSelection#
- #include <gpu_scene.h>
Per-environment selection of local lights considered by forward shading.
Public Members
-
std::uint32_t localLightCount#
Number of selected local lights, capped at kForwardLocalLightCap.
-
std::uint32_t shadowedLocalLightCount = 0u#
Selected shadowed 2D local lights.
-
std::uint32_t shadowedPointLightCount = 0u#
Selected shadowed point lights.
-
std::uint32_t reserved0 = 0u#
Reserved padding.
-
std::array<std::uint32_t, kForwardLocalLightCap> lightIndices = {}#
Selected light indices in the global light buffer.
-
std::uint32_t localLightCount#
-
struct GpuLocalShadowView#
- #include <gpu_scene_pipeline_types.h>
GPU uniform buffer payload describing a local (spot/point) shadow projection camera.
Public Members
-
std::array<Diligent::float4x4, kLocalShadowMaxFaceCount> lightViewProjectionMatrices = {}#
View-projection matrices for spot or 6 cube faces.
-
Diligent::float4 lightPositionRange = {}#
World-space light position (xyz) and attenuation range (w).
-
Diligent::float4 lightDirection = {}#
World-space light direction vector.
-
Diligent::float2 shadowTexelSize#
Reciprocal shadow map dimensions (1/width, 1/height).
-
float shadowNearPlane = 0.0f#
Near clipping plane distance.
-
float shadowFarPlane = 0.0f#
Far clipping plane distance.
-
std::uint32_t lightIndex#
Associated light index in the scene light buffer.
-
std::uint32_t envIndex = 0u#
Associated environment index.
-
std::uint32_t firstLayer = 0u#
First shadow map texture array slice.
-
std::uint32_t layerCount = 1u#
Number of shadow texture array slices.
-
std::uint32_t lightType = 0u#
Light type identifier.
-
std::uint32_t active = 0u#
Active flag (1 = active, 0 = inactive).
-
std::uint32_t reserved0 = 0u#
Reserved padding.
-
std::uint32_t reserved1 = 0u#
Reserved padding.
-
std::array<Diligent::float4x4, kLocalShadowMaxFaceCount> lightViewProjectionMatrices = {}#
-
struct GpuPreparedCamera#
- #include <gpu_scene_pipeline_types.h>
GPU uniform buffer structure holding transformed camera matrices, cascaded shadow maps, and culling ranges.
Public Members
-
Diligent::float4x4 viewMatrix#
World-to-camera view transformation matrix.
-
Diligent::float4x4 viewProjectionMatrix#
Combined view-projection matrix.
-
std::array<Diligent::float4x4, 4> lightViewProjectionMatrices = {}#
View-projection matrices for up to 4 directional shadow cascades.
-
Diligent::float4 cameraPosition = {}#
World-space camera eye position.
-
Diligent::float4 cascadeSplits = {}#
Depth split distances for cascaded shadow mapping.
-
Diligent::float2 mainShadowTexelSize = {0.0f, 0.0f}#
Directional shadow map texel size.
-
float mainShadowCascadeCount = 0.0f#
Number of active directional shadow cascades.
-
float mainShadowFadeDistance = 0.0f#
Shadow fade-out distance.
-
std::uint32_t envIndex = 0u#
Environment index this camera renders.
-
std::uint32_t active = 0u#
Active flag (1 = active, 0 = inactive).
-
std::uint32_t objectRangeStart = 0u#
Starting index into object draw list.
-
std::uint32_t objectRangeCount = 0u#
Number of candidate objects for this camera.
-
std::uint32_t visibilityDataOffset = 0u#
Offset into visibility bitmask buffer.
-
std::uint32_t reserved0 = 0u#
Reserved padding.
-
std::uint32_t reserved1 = 0u#
Reserved padding.
-
std::uint32_t reserved2 = 0u#
Reserved padding.
-
Diligent::float4x4 viewMatrix#
-
struct GpuRenderableMetadata#
- #include <gpu_scene.h>
GPU per-renderable object descriptor consumed by compute culling and vertex shaders.
Public Members
-
std::uint32_t flags#
GpuRenderableFlags bitmask.
-
std::uint32_t deformVertexBase = 0u#
Base vertex offset in deformed position buffer.
-
std::uint32_t deformNormalBase = 0u#
Base vertex offset in deformed normal buffer.
-
std::uint32_t deformableIndex = 0xffffffffu#
Index into soft-body / strand physics buffer.
-
std::uint32_t deformVertexCount = 0u#
Number of deformable vertices.
-
std::uint32_t deformableType = 0u#
GpuRenderableDeformableType value.
-
std::uint32_t segmentationId = 0u#
Segmentation class ID.
-
std::uint32_t entityPoseSlot = kInvalidGpuSceneIndex#
Index in global entity pose buffer.
-
Diligent::float4 localBoundsMin = {}#
Local bounding box minimum (xyz).
-
Diligent::float4 localBoundsMax = {}#
Local bounding box maximum (xyz).
-
std::uint32_t flags#
-
struct GpuRenderableQueueInfo#
- #include <gpu_scene.h>
Mapping linking a renderable object to its slots in indirect draw argument command buffers.
Public Members
-
std::uint32_t opaqueCommandIndex = 0xffffffffu#
Index of opaque draw command.
-
std::uint32_t shadowCommandBaseIndex#
Base index of directional shadow draw command.
-
std::uint32_t localShadowCommandIndex = 0xffffffffu#
Index of local shadow draw command.
-
std::uint32_t reserved0 = 0u#
Reserved padding.
-
std::uint32_t opaqueCommandIndex = 0xffffffffu#
-
struct GpuSoftBodyVertexBinding#
- #include <gpu_scene.h>
Skinning weights and barycentric particle indices binding a soft-body surface vertex to simulation nodes.
-
struct GpuVisiblePairInstance#
- #include <gpu_scene_pipeline_types.h>
Output record produced by GPU frustum culling representing a visible (object, camera) pair.
Public Members
-
std::uint32_t objectIndex = 0u#
Index of visible render object in the global object table.
-
std::uint32_t batchCameraIndex = 0u#
Index of the camera observing the object.
-
std::uint32_t bucketIndex = 0u#
Material/pipeline sort bucket index.
-
std::uint32_t shadowSubviewIndex = 0u#
Shadow cascade or face subview index.
-
std::uint32_t objectIndex = 0u#
-
struct HostSceneView#
- #include <host_scene.h>
Immutable view bundle referencing host scene instances, cameras, lights, and draw registries for a frame.
Public Members
-
const std::vector<RenderableInstance> *renderables#
Array of all renderable instances.
-
const std::vector<GpuRenderableMetadata> *renderableMetadata#
Per-renderable GPU metadata flags.
-
const std::vector<CameraData> *cameras = nullptr#
Array of active scene cameras.
-
const std::vector<EnvironmentIblDesc> *environmentIbls#
Per-environment IBL skybox descriptors.
-
const std::vector<EnvironmentFluidDesc> *environmentFluids#
Per-environment fluid rendering settings.
-
const std::vector<IndirectCommandRegistryEntry> *opaqueDrawRegistry#
Indirect draw commands for opaque pass.
-
const std::vector<TransparentDrawEntry> *transparentDrawRegistry#
Sorted commands for transparent pass.
-
const std::vector<IndirectCommandRegistryEntry> *shadowDrawRegistry#
Indirect draw commands for directional shadows.
-
const std::vector<IndirectCommandRegistryEntry> *localShadowDrawRegistry#
Indirect draw commands for local light shadows.
-
const GpuEntitySceneView *gpuEntityScene = nullptr#
GPU buffer view bindings.
-
const std::vector<RenderableInstance> *renderables#
-
struct IndirectCommandRegistryEntry#
- #include <forward_draw_types.h>
Entry in the batched indirect draw command registry for opaque and shadow passes.
Public Members
-
ForwardDrawCommand drawCommand = {}#
Underlying forward draw command template.
-
std::uint32_t maxVisibleCount#
Maximum number of visible instances allocated in GPU draw buffers.
-
ForwardDrawCommand drawCommand = {}#
-
struct LightData#
- #include <host_scene.h>
Host representation of a directional, spot, or point light source.
Public Members
-
common::EntityId entityId = common::kInvalidEntityId#
Light entity ID.
-
std::uint32_t envIndex = 0u#
Environment index hosting the light.
-
std::uint32_t lightSlot = 0xffffffffu#
Light slot index within the environment.
-
GpuLightType type = GpuLightType::Directional#
Light source type.
-
Diligent::float3 position = {0.0f, 0.0f, 0.0f}#
World position (for spot and point lights).
-
Diligent::float3 direction = {0.0f, -1.0f, 0.0f}#
World emission direction.
-
Diligent::float3 color = {1.0f, 1.0f, 1.0f}#
Linear RGB radiant flux color.
-
float intensity = 1.0f#
Radiant intensity multiplier (Lux or Lumens).
-
float range = 0.0f#
Attenuation distance for point and spot lights; directional lights do not use it, and zero produces a near-zero local-light range.
-
float innerConeAngle = 0.0f#
Spotlight inner cone angle in radians.
-
float outerConeAngle = 0.0f#
Spotlight outer cone falloff angle in radians.
-
float shadowDistance = 80.0f#
Maximum shadow projection distance.
-
float shadowFadeDistance = 20.0f#
Distance over which shadows fade out smoothly.
-
float shadowBias = 0.0015f#
Constant shadow depth bias.
-
bool castsShadows = true#
Whether light projects shadow maps.
-
common::EntityId entityId = common::kInvalidEntityId#
-
struct MaterialHandle#
- #include <render_resource_manager.h>
Handle referencing a registered surface material asset.
Public Members
-
common::ResourceId id = common::kInvalidResourceId#
Unique numeric resource identifier.
-
common::ResourceId id = common::kInvalidResourceId#
-
struct MaterialPipelineDesc#
- #include <render_resource_manager.h>
Pipeline shader configuration for compiling or selecting material PSO variants.
Public Members
-
MaterialProgramFamily programFamily = MaterialProgramFamily::StandardLit#
Shader family.
-
MaterialFeatureFlags featureFlags = MaterialFeatureFlags::None#
Feature bitmask.
-
float alphaCutoff = 0.5f#
Alpha discard threshold for Cutout mode.
-
MaterialProgramFamily programFamily = MaterialProgramFamily::StandardLit#
-
struct MaterialResourceDesc#
- #include <render_resource_manager.h>
Physical surface material description including PBR textures and parameters.
Public Members
-
std::string debugName#
Human-readable debug identifier.
-
Diligent::float3 baseColor = {1.0f, 1.0f, 1.0f}#
Constant base color multiplier (RGB).
-
float metallic = 0.0f#
Metallic reflection factor [0..1].
-
float roughness = 0.5f#
Microfacet roughness factor [0..1].
-
Diligent::float3 emissiveFactor = {0.0f, 0.0f, 0.0f}#
Emissive color radiance (RGB).
-
TextureHandle baseColorTexture = {}#
Base color / albedo texture map.
-
TextureHandle normalTexture = {}#
Tangent-space normal map.
-
TextureHandle metallicRoughnessTexture = {}#
Combined metallic (B) and roughness (G) texture map.
-
TextureHandle emissiveTexture = {}#
Emissive radiance texture map.
-
TextureHandle aoTexture = {}#
Precomputed ambient occlusion (R) map.
-
MaterialPipelineDesc pipeline = {}#
Pipeline program family and feature flags.
-
MaterialRenderMode renderMode#
Rasterization pass blending mode.
-
std::int32_t renderOrder#
Sorting order within the same render mode bucket (lower draws earlier).
-
float opacity = 1.0f#
Surface opacity factor [0..1].
-
bool castsShadows = true#
Whether objects with this material render into shadow maps.
-
bool receivesShadows = true#
Whether surface samples shadow maps during shading.
-
std::string debugName#
-
struct MeshHandle#
- #include <render_resource_manager.h>
Handle referencing a registered CPU/GPU triangle mesh asset.
Public Members
-
common::ResourceId id = common::kInvalidResourceId#
Unique numeric resource identifier.
-
common::ResourceId id = common::kInvalidResourceId#
-
struct MeshResourceDesc#
- #include <render_resource_manager.h>
Geometric vertex and index data definition for registering a mesh resource.
Public Members
-
std::string debugName#
Human-readable debug name.
-
std::vector<std::uint32_t> indices#
Triangle index buffer (3 indices per face).
-
struct Vertex#
- #include <render_resource_manager.h>
Interleaved vertex attribute layout.
Public Members
-
Diligent::float3 position = {}#
3D object-space position.
-
Diligent::float3 normal = {0.0f, 1.0f, 0.0f}#
Surface normal vector.
-
float texCoordU = 0.0f#
Horizontal UV texture coordinate.
-
float texCoordV = 0.0f#
Vertical UV texture coordinate.
-
Diligent::float4 tangent#
Tangent vector (xyz) and bitangent sign (w).
-
Diligent::float3 position = {}#
-
std::string debugName#
-
struct RenderableInstance#
- #include <host_scene.h>
Host representation of a renderable mesh entity placed in an environment.
Public Members
-
common::EntityId entityId = common::kInvalidEntityId#
Entity identifier in scene graph.
-
std::uint32_t envIndex = 0u#
Zero-based environment index.
-
std::uint32_t objectSlot = 0xffffffffu#
Slot index within the environment’s object array.
-
bool visible = true#
Visibility toggle flag.
-
std::uint32_t segmentationId = 0u#
Categorical integer ID for segmentation mask rendering.
-
MeshHandle mesh = {}#
Bound geometry mesh handle.
-
MaterialHandle material = {}#
Bound surface material handle.
-
common::EntityId entityId = common::kInvalidEntityId#
-
class Renderer#
- #include <renderer.h>
Primary clustered forward HDR renderer executing scene culling, shadow passes, surface shading, and post-processing.
Public Functions
-
Renderer(gpu::GpuDevice &device, RenderResourceManager &resourceManager, const RendererDesc &desc = RendererDesc{})#
Constructs a renderer instance bound to a GPU device and asset resource manager.
- Parameters:
device – GPU device interface.
resourceManager – Mesh/material/texture resource manager.
desc – Renderer configuration descriptor.
-
~Renderer()#
Destructor releasing renderer pipelines and GPU passes.
-
bool initialize()#
Initializes graphics pipelines, shadow passes, compute culling, and post-processing filters.
- Returns:
True on success. When no graphics backend is available, initialization still succeeds but creates no GPU pipelines.
-
RenderStats render(const common::FrameContext &frameContext, const HostSceneView &sceneView, const physics::PhysicsGpuSceneView *physicsScene, const RenderFrameOptions &options = RenderFrameOptions{})#
Executes complete scene rendering for all active cameras and outputs.
- Parameters:
frameContext – Temporal frame context.
sceneView – Scene graph and camera/light data view.
physicsScene – Optional physics GPU buffer views for deformable skinning and debug overlays.
options – Per-frame presentation and tonemapping options.
- Returns:
RenderStats containing draw-call and execution metrics. An uninitialized renderer returns all zeros; when no graphics backend is available or GPU-scene preparation fails, draw/execution counters remain zero but host renderable/light counts may be populated.
-
Renderer(gpu::GpuDevice &device, RenderResourceManager &resourceManager, const RendererDesc &desc = RendererDesc{})#
-
struct RendererDesc#
- #include <renderer.h>
Global configuration descriptor for creating the forward renderer.
Public Members
-
IblQualityTier iblQualityTier = IblQualityTier::Off#
Image-based lighting quality tier.
-
IblQualityTier iblQualityTier = IblQualityTier::Off#
-
struct RenderFrameOptions#
- #include <renderer.h>
Per-frame rendering options, camera presentation routing, and debug visualization switches.
Public Functions
-
RenderFrameOptions() = default#
Default constructor.
-
inline RenderFrameOptions(common::EntityId presentedCameraEntityIn, std::optional<gpu::GpuPresentationTargetDesc> presentationTargetIn, ToneMapper toneMapperIn = ToneMapper::Reinhard, float exposureIn = 1.0f)#
Convenience constructor specifying presented camera entity and presentation target.
- Parameters:
presentedCameraEntityIn – Entity ID of camera to present.
presentationTargetIn – Presentation target description.
toneMapperIn – Selected tonemapper.
exposureIn – Exposure multiplier.
-
inline RenderFrameOptions(common::EntityId presentedCameraEntityIn, PresentedExplicitOutput presentedExplicitOutputIn, std::optional<gpu::GpuPresentationTargetDesc> presentationTargetIn = std::nullopt, ToneMapper toneMapperIn = ToneMapper::Reinhard, float exposureIn = 1.0f)#
Convenience constructor specifying presented camera, explicit output, and presentation target.
- Parameters:
presentedCameraEntityIn – Camera entity ID.
presentedExplicitOutputIn – Explicit output binding to present.
presentationTargetIn – Presentation target description.
toneMapperIn – Selected tonemapper.
exposureIn – Exposure multiplier.
Public Members
-
common::EntityId presentedCameraEntity#
Primary camera entity blitted to the window presentation swapchain.
-
std::optional<PresentedExplicitOutput> presentedExplicitOutput = {}#
Optional explicit offscreen output blitted to presentation.
-
std::optional<gpu::GpuPresentationTargetDesc> presentationTarget = {}#
Presentation swapchain description.
-
ToneMapper toneMapper = ToneMapper::Reinhard#
Tonemapping operator.
-
float exposure = 1.0f#
Exposure compensation scale factor.
-
DebugParticleOptions debugParticles = {}#
Particle debug rendering options.
-
DebugRoutedCableOptions debugRoutedCables = {}#
Routed cable debug options.
-
DebugStrandFrameOptions debugStrandFrames = {}#
Strand frame debug options.
-
struct DebugParticleOptions#
- #include <renderer.h>
Debug visualization options for particle physics point clouds.
Public Members
-
bool enabled = false#
Enable particle sphere/billboard debug rendering.
-
Diligent::float4 color = {0.2f, 0.8f, 1.0f, 1.0f}#
Default particle color (RGBA).
-
Diligent::float4 staticColor#
Color for pinned/static particles.
-
Diligent::float4 edgeColor#
Color for distance constraint debug lines.
-
bool useParticleRadii = true#
Use actual particle radii instead of fallbackRadius.
-
bool highlightStaticParticles = true#
Visually tint static particles differently.
-
bool drawConstraintEdges#
Draw wireframe edges between constrained particle pairs.
-
float fallbackRadius = 0.15f#
Fallback radius in world units if unassigned.
-
bool enabled = false#
-
struct DebugRoutedCableOptions#
- #include <renderer.h>
Debug visualization options for routed cable paths.
-
struct DebugStrandFrameOptions#
- #include <renderer.h>
Debug visualization options for 1D strand coordinate frames.
-
struct PresentedExplicitOutput#
- #include <renderer.h>
Destination display routing configuration for an explicit offscreen target.
Public Types
Public Functions
-
inline bool isValid() const noexcept#
Checks if the output binding refers to a valid target.
- Returns:
True if valid.
Public Members
-
gpu::GpuRenderTargetBinding binding = {}#
Source target binding.
-
gpu::GpuRenderTargetDesc sourceTargetDesc = {}#
Source target descriptor.
-
SourceKind sourceKind = SourceKind::Color#
Output channel category.
-
bool sourceIsDisplayEncoded = false#
True if source buffer is already sRGB encoded.
-
float nearClip = 0.01f#
Near plane for depth visualization.
-
float farClip = 1000.0f#
Far plane for depth visualization.
-
inline bool isValid() const noexcept#
-
RenderFrameOptions() = default#
-
class RenderResourceManager#
- #include <render_resource_manager.h>
Central repository managing host-side registration and lookup for meshes, materials, and textures.
Public Functions
-
RenderResourceManager()#
Default constructor.
-
~RenderResourceManager()#
Destructor.
-
RenderResourceManager(const RenderResourceManager &other)#
-
RenderResourceManager &operator=(const RenderResourceManager &other)#
-
RenderResourceManager(RenderResourceManager &&other) noexcept#
-
RenderResourceManager &operator=(RenderResourceManager &&other) noexcept#
-
MeshHandle registerMesh(const MeshResourceDesc &desc)#
Registers a new mesh asset and allocates a unique handle.
Missing or invalid tangent data is generated or repaired in the stored descriptor.
- Parameters:
desc – Mesh geometry descriptor.
- Returns:
Allocated MeshHandle.
-
MaterialHandle registerMaterial(const MaterialResourceDesc &desc)#
Registers a new surface material and allocates a unique handle.
The stored descriptor derives AlphaTest from Cutout mode and enables NormalMap when a normal texture is supplied.
- Parameters:
desc – Material descriptor.
- Returns:
Allocated MaterialHandle.
-
TextureHandle registerTexture(const TextureResourceDesc &desc)#
Registers a new texture and allocates a unique handle.
Stored width, height, and mip count are clamped to at least one. A non-empty pixelData payload is copied into the first subresource when explicit subresources are absent.
- Parameters:
desc – Texture descriptor.
- Returns:
Allocated TextureHandle.
-
bool isValid(MeshHandle mesh) const#
Validates whether a mesh handle refers to an existing mesh resource.
- Parameters:
mesh – Handle to check.
- Returns:
True if valid.
-
bool isValid(MaterialHandle material) const#
Validates whether a material handle refers to an existing material resource.
- Parameters:
material – Handle to check.
- Returns:
True if valid.
-
bool isValid(TextureHandle texture) const#
Validates whether a texture handle refers to an existing texture resource.
- Parameters:
texture – Handle to check.
- Returns:
True if valid.
-
const MeshResourceDesc *tryGetMesh(MeshHandle mesh) const noexcept#
Looks up the mesh resource descriptor for a valid handle.
- Parameters:
mesh – Handle to query.
- Returns:
Pointer to MeshResourceDesc or nullptr if invalid.
-
const MaterialResourceDesc *tryGetMaterial(MaterialHandle material) const noexcept#
Looks up the material resource descriptor for a valid handle.
- Parameters:
material – Handle to query.
- Returns:
Pointer to MaterialResourceDesc or nullptr if invalid.
-
const TextureResourceDesc *tryGetTexture(TextureHandle texture) const noexcept#
Looks up the texture resource descriptor for a valid handle.
- Parameters:
texture – Handle to query.
- Returns:
Pointer to TextureResourceDesc or nullptr if invalid.
-
bool tryGetMeshLocalBounds(MeshHandle mesh, Diligent::float3 &outMin, Diligent::float3 &outMax) const noexcept#
Computes the local axis-aligned bounding box for a registered mesh.
- Parameters:
mesh – Mesh handle.
outMin – Output minimum corner (xyz).
outMax – Output maximum corner (xyz).
- Returns:
True if mesh was found and bounds computed.
-
std::uint64_t meshVersion(MeshHandle mesh) const noexcept#
Retrieves the registration version for a mesh asset.
- Parameters:
mesh – Mesh handle.
- Returns:
One for a registered mesh, or zero for an invalid handle.
-
RenderResourceManager()#
-
struct RenderStats#
- #include <renderer.h>
Frame rendering performance and draw call instrumentation metrics.
Public Members
-
std::uint32_t drawCalls = 0#
Sum of the opaque, transparent, and shadow draw-call counters.
-
std::uint32_t opaqueDrawCalls = 0#
Opaque forward pass draw calls.
-
std::uint32_t transparentDrawCalls = 0#
Transparent pass draw calls.
-
std::uint32_t shadowDrawCalls = 0#
Shadow map cascade and local light draw calls.
-
std::uint32_t renderableCount = 0#
Total candidate renderable objects evaluated.
-
std::uint32_t lightCount = 0#
Total scene light sources.
-
std::uint32_t renderedCameraCount = 0#
Total cameras rendered during the frame.
-
std::uint32_t renderTargetResizeRequests#
Number of offscreen render target resize requests.
-
std::uint32_t renderTargetResizeNoOps#
Resize requests where target dimensions were unchanged.
-
std::uint32_t renderTargetRecreateCount = 0#
Number of render target texture recreations.
-
std::uint32_t renderTargetResizeConflicts#
Conflicts where shared targets had mismatched requests.
-
std::uint32_t drawCalls = 0#
-
struct TextureHandle#
- #include <render_resource_manager.h>
Handle referencing a registered 2D or cubemap texture asset.
Public Members
-
common::ResourceId id = common::kInvalidResourceId#
Unique numeric resource identifier.
-
common::ResourceId id = common::kInvalidResourceId#
-
struct TextureResourceDesc#
- #include <render_resource_manager.h>
Texture asset descriptor containing image dimensions, formats, and pixel data payloads.
Public Members
-
std::string debugName#
Debug identifier.
-
std::uint32_t width = 1u#
Image width in pixels.
-
std::uint32_t height = 1u#
Image height in pixels.
-
std::uint32_t mipLevelCount = 1u#
Number of mipmap levels present.
-
TextureDimension dimension = TextureDimension::Texture2D#
2D or Cubemap dimensionality.
-
TexturePixelFormat pixelFormat = TexturePixelFormat::RGBA8#
Pixel data format.
-
TextureColorSpace colorSpace = TextureColorSpace::Linear#
Color space interpretation.
-
TextureMipPolicy mipPolicy#
Declared mipmap generation policy; currently unused.
-
std::vector<SubresourceDesc> subresources#
Array of explicit subresource payloads.
-
std::vector<std::uint8_t> pixelData#
Contiguous raw pixel payload for level 0.
-
std::string debugName#
-
struct TransparentDrawEntry#
- #include <forward_draw_types.h>
Sorted draw entry representing a transparent surface rendered back-to-front.
Public Members
-
ForwardDrawCommand drawCommand = {}#
Underlying forward draw command.
-
std::int32_t renderOrder = 0#
Explicit user sort key within the transparent pass.
-
std::uint32_t objectIndex = 0xffffffffu#
Object slot index in the scene table.
-
ForwardDrawCommand drawCommand = {}#
-
enum class GpuLightType : std::uint32_t#