Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::PBR_Renderer::CreateInfo Struct Reference

Renderer create info. More...

#include <PBR_Renderer.hpp>

Public Types

enum  TEX_COLOR_CONVERSION_MODE { TEX_COLOR_CONVERSION_MODE_NONE = 0 , TEX_COLOR_CONVERSION_MODE_SRGB_TO_LINEAR }
 

Public Attributes

bool EnableIBL = true
 
bool EnableAO = true
 
bool EnableEmissive = true
 
bool EnableClearCoat = false
 
bool EnableSheen = false
 
bool EnableAnisotropy = false
 
bool EnableIridescence = false
 
bool EnableTransmission = false
 
bool EnableVolume = false
 
bool UseSeparateMetallicRoughnessTextures = false
 
bool CreateDefaultTextures = true
 
bool EnableShadows = false
 
bool AllowHotShaderReload = false
 
bool PackMatrixRowMajor = false
 
bool UseSkinPreTransform = false
 Whether to use skin pre-transform before applying joint transformations.
 
bool PackVertexNormals = false
 Whether vertex normals are packed into a single 32-bit uint, see PackVertexNormal().
 
bool PackVertexColors = false
 Whether vertex colors are packed into a single 32-bit uint.
 
VERTEX_POS_PACK_MODE VertexPosPackMode = VERTEX_POS_PACK_MODE_NONE
 Vertex position packing mode, see VERTEX_POS_PACK_MODE.
 
Uint32 PCFKernelSize = 3
 
SHADER_TEXTURE_ARRAY_MODE ShaderTexturesArrayMode = SHADER_TEXTURE_ARRAY_MODE_NONE
 Shader textures array access mode, see SHADER_TEXTURE_ARRAY_MODE.
 
Uint32 MaterialTexturesArraySize = 0
 
Uint32 PrimitiveArraySize = 0
 
Uint32 MaxLightCount = 16
 The maximum number of lights.
 
Uint32 MaxShadowCastingLightCount = 8
 The maximum number of shadow-casting lights.
 
Uint32 OITLayerCount = 0
 
SamplerDesc ColorMapImmutableSampler = DefaultSampler
 Immutable sampler for color map texture.
 
SamplerDesc PhysDescMapImmutableSampler = DefaultSampler
 Immutable sampler for physical description map texture.
 
SamplerDesc NormalMapImmutableSampler = DefaultSampler
 Immutable sampler for normal map texture.
 
SamplerDesc AOMapImmutableSampler = DefaultSampler
 Immutable sampler for AO texture.
 
SamplerDesc EmissiveMapImmutableSampler = DefaultSampler
 Immutable sampler for emissive map texture.
 
SamplerDesc ClearCoatMapImmutableSampler = DefaultSampler
 Immutable sampler for clear coat map texture.
 
SamplerDesc SheenMapImmutableSampler = DefaultSampler
 Immutable sampler for sheen texture.
 
SamplerDesc AnisotropyMapImmutableSampler = DefaultSampler
 Immutable sampler for anisotropy texture.
 
SamplerDesc IridescenceMapImmutableSampler = DefaultSampler
 Immutable sampler for iridescence texture.
 
SamplerDesc TransmissionMapImmutableSampler = DefaultSampler
 Immutable sampler for transmission texture.
 
SamplerDesc ThicknessMapImmutableSampler = DefaultSampler
 Immutable sampler for thickness texture.
 
Uint32 MaxJointCount = 64
 
JOINTS_BUFFER_MODE JointsBufferMode = JOINTS_BUFFER_MODE_UNIFORM
 Joints buffer mode.
 
Uint32 NumBRDFSamples = 512
 The number of samples for BRDF LUT creation.
 
const char * SheenAlbedoScalingLUTPath = nullptr
 If Sheen is enabled, this parameter specifies the path to the sheen look-up table.
 
const char * PreintegratedCharlieBRDFPath = nullptr
 
InputLayoutDesc InputLayout
 
std::function< PSMainSourceInfo(PSO_FLAGS PsoFlags)> GetPSMainSource = nullptr
 
std::function< StaticShaderTextureIdsArrayType(const PSOKey &Key)> GetStaticShaderTextureIds = nullptr
 
IBufferpPrimitiveAttribsCB = nullptr
 
IBufferpMaterialAttribsCB = nullptr
 
IBufferpJointsBuffer = nullptr
 
std::array< int, TEXTURE_ATTRIB_ID_COUNT > TextureAttribIndices {}
 Texture attribute index info.
 

Detailed Description

Renderer create info.

Member Enumeration Documentation

◆ TEX_COLOR_CONVERSION_MODE

Conversion mode applied to diffuse, specular and emissive textures.

Note
Normal map, ambient occlusion and physical description textures are always assumed to be in linear color space.
Enumerator
TEX_COLOR_CONVERSION_MODE_NONE 

Sampled texture colors are used as is.

Remarks
This mode should be used if the textures are in linear color space, or if the texture is in sRGB color space and the texture view is also in sRGB color space (which ensures that sRGB->linear conversion is performed by the GPU).
TEX_COLOR_CONVERSION_MODE_SRGB_TO_LINEAR 

Manually convert texture colors from sRGB to linear color space.

Remarks
This mode should be used if the textures are in sRGB color space, but the texture views are in linear color space.

Member Data Documentation

◆ AllowHotShaderReload

bool Diligent::PBR_Renderer::CreateInfo::AllowHotShaderReload = false

Whether to allow hot shader reload.

Remarks
When hot shader reload is enabled, the renderer will need to keep copies of generated shaders in the shader source factory. This adds some overhead and should only be used in development mode.

◆ CreateDefaultTextures

bool Diligent::PBR_Renderer::CreateInfo::CreateDefaultTextures = true

Whether to create default textures.

Remarks
If set to true, the following textures will be created:
  • White texture
  • Black texture
  • Default normal map
  • Default physical description map

◆ EnableAnisotropy

bool Diligent::PBR_Renderer::CreateInfo::EnableAnisotropy = false

Whether to enable anisotropy. A pipeline state can use anisotropy only if this flag is set to true.

◆ EnableAO

bool Diligent::PBR_Renderer::CreateInfo::EnableAO = true

Whether to use enable ambient occlusion. A pipeline state can use AO only if this flag is set to true.

◆ EnableClearCoat

bool Diligent::PBR_Renderer::CreateInfo::EnableClearCoat = false

Whether to enable clear coat. A pipeline state can use clear coat only if this flag is set to true.

◆ EnableEmissive

bool Diligent::PBR_Renderer::CreateInfo::EnableEmissive = true

Whether to enable emissive texture. A pipeline state can use emissive texture only if this flag is set to true.

◆ EnableIBL

bool Diligent::PBR_Renderer::CreateInfo::EnableIBL = true

Indicates whether to enable IBL. A pipeline state can use IBL only if this flag is set to true.

◆ EnableIridescence

bool Diligent::PBR_Renderer::CreateInfo::EnableIridescence = false

Whether to enable iridescence. A pipeline state can use iridescence only if this flag is set to true.

◆ EnableShadows

bool Diligent::PBR_Renderer::CreateInfo::EnableShadows = false

Whether to enable shadows. A pipeline state can use shadows only if this flag is set to true.

◆ EnableSheen

bool Diligent::PBR_Renderer::CreateInfo::EnableSheen = false

Whether to enable sheen. A pipeline state can use sheen only if this flag is set to true.

◆ EnableTransmission

bool Diligent::PBR_Renderer::CreateInfo::EnableTransmission = false

Whether to enable transmission. A pipeline state can use transmission only if this flag is set to true.

◆ EnableVolume

bool Diligent::PBR_Renderer::CreateInfo::EnableVolume = false

Whether to enable volume. A pipeline state can use volume only if this flag is set to true.

◆ GetPSMainSource

std::function<PSMainSourceInfo(PSO_FLAGS PsoFlags)> Diligent::PBR_Renderer::CreateInfo::GetPSMainSource = nullptr

An optional user-provided callback function that is used to generate the pixel shader's main function source code for the specified PSO flags. If null, the renderer will use the default implementation.

◆ GetStaticShaderTextureIds

std::function<StaticShaderTextureIdsArrayType(const PSOKey& Key)> Diligent::PBR_Renderer::CreateInfo::GetStaticShaderTextureIds = nullptr

An optional user-provided callback function that returns static material texture indices for the specified PSO key. If null, the renderer will assign the indices automatically.

Remarks
This function is called only if ShaderTexturesArrayMode is set SHADER_TEXTURE_ARRAY_MODE_STATIC.
        The main usage scenario for this function is to implement "static" bindless
        mode, where texture indices are assigned at shader compile time and hard-coded
        into PSO. The client can use the Key.UserValue to identify the shader indices. 

◆ InputLayout

InputLayoutDesc Diligent::PBR_Renderer::CreateInfo::InputLayout

Input layout description.

Remarks
The renderer uses the following input layout:
            struct VSInput
            {
                float3 Pos     : ATTRIB0;
                float3 Normal  : ATTRIB1; // If PSO_FLAG_USE_VERTEX_NORMALS is set
                float2 UV0     : ATTRIB2; // If PSO_FLAG_USE_TEXCOORD0 is set
                float2 UV1     : ATTRIB3; // If PSO_FLAG_USE_TEXCOORD1 is set
                float4 Joint0  : ATTRIB4; // If PSO_FLAG_USE_JOINTS is set
                float4 Weight0 : ATTRIB5; // If PSO_FLAG_USE_JOINTS is set
                float4 Color   : ATTRIB6; // If PSO_FLAG_USE_VERTEX_COLORS is set
                float3 Tangent : ATTRIB7; // If PSO_FLAG_USE_VERTEX_TANGENTS is set
            }; 

◆ MaterialTexturesArraySize

Uint32 Diligent::PBR_Renderer::CreateInfo::MaterialTexturesArraySize = 0

User-provided material textures array size.

Remarks
This parameter is ignored if ShaderTexturesArrayMode is SHADER_TEXTURE_ARRAY_MODE_NONE. If this parameter is set to 0, the renderer will define the array size. If it is not zero, the client should provide the GetStaticShaderTextureIds callback function to define texture indices.

◆ MaxJointCount

Uint32 Diligent::PBR_Renderer::CreateInfo::MaxJointCount = 64

The maximum number of joints.

If set to 0, the animation will be disabled.

◆ OITLayerCount

Uint32 Diligent::PBR_Renderer::CreateInfo::OITLayerCount = 0

The number of OIT layers. If set to 0, OIT will be disabled.

◆ PackMatrixRowMajor

bool Diligent::PBR_Renderer::CreateInfo::PackMatrixRowMajor = false

Whether shader matrices are laid out in row-major order in GPU memory.

Remarks
By default, shader matrices are laid out in column-major order in GPU memory. If this option is set to true, shaders will be compiled with the SHADER_COMPILE_FLAG_PACK_MATRIX_ROW_MAJOR flag and use the row-major layout.

◆ PCFKernelSize

Uint32 Diligent::PBR_Renderer::CreateInfo::PCFKernelSize = 3

PCF shadow kernel size. Allowed values are 2, 3, 5, 7.

◆ pJointsBuffer

IBuffer* Diligent::PBR_Renderer::CreateInfo::pJointsBuffer = nullptr

A pointer to the user-provided joints buffer. If null, the renderer will allocate the buffer.

◆ pMaterialAttribsCB

IBuffer* Diligent::PBR_Renderer::CreateInfo::pMaterialAttribsCB = nullptr

A pointer to the user-provided material attribs buffer. If null, the renderer will allocate the buffer.

◆ pPrimitiveAttribsCB

IBuffer* Diligent::PBR_Renderer::CreateInfo::pPrimitiveAttribsCB = nullptr

A pointer to the user-provided primitive attribs buffer. If null, the renderer will allocate the buffer.

◆ PreintegratedCharlieBRDFPath

const char* Diligent::PBR_Renderer::CreateInfo::PreintegratedCharlieBRDFPath = nullptr

If IBL and Sheen are enabled, this parameter specifies the path to the preintegrated Charlie BRDF look-up table.

◆ PrimitiveArraySize

Uint32 Diligent::PBR_Renderer::CreateInfo::PrimitiveArraySize = 0

The size of the shader primitive array. When 0, single primitive will be used.

◆ UseSeparateMetallicRoughnessTextures

bool Diligent::PBR_Renderer::CreateInfo::UseSeparateMetallicRoughnessTextures = false

Whether to use separate textures for metallic and roughness instead of a combined physical description texture.