MaterialX 1.39.5
Loading...
Searching...
No Matches
GenOptions Class Reference

Class holding options to configure shader generation. More...

#include <GenOptions.h>

Public Attributes

ShaderInterfaceType shaderInterfaceType
 Sets the type of shader interface to be generated.
 
bool fileTextureVerticalFlip
 If true the y-component of texture coordinates used for sampling file textures will be flipped before sampling.
 
string targetColorSpaceOverride
 An optional override for the target color space.
 
string targetDistanceUnit
 Define the target distance unit.
 
bool addUpstreamDependencies
 Sets whether to include upstream dependencies for the element to generate a shader for.
 
FilePath libraryPrefix
 The standard library prefix, which will be applied to calls to emitLibraryInclude during code generation.
 
bool emitColorTransforms
 Enable emitting colorspace transform code if a color management system is defined.
 
bool elideConstantNodes
 Enable eliding constant nodes. Defaults to true.
 
bool premultipliedBsdfAdd
 Enable replacing BSDF mix nodes with premultiplied add nodes.
 
bool distributeLayerOverBsdfMix
 Enable distributing layer operations over mix nodes.
 
bool hwTransparency
 Sets if transparency is needed or not for HW shaders.
 
HwSpecularEnvironmentMethod hwSpecularEnvironmentMethod
 Sets the method to use for specular environment lighting for HW shader targets.
 
HwDirectionalAlbedoMethod hwDirectionalAlbedoMethod
 Sets the method to use for directional albedo evaluation for HW shader targets.
 
HwTransmissionRenderMethod hwTransmissionRenderMethod
 Sets the method to use for transmission rendering for HW shader targets.
 
unsigned int hwAiryFresnelIterations
 Sets the number of iterations for Airy Fresnel reflection calculations.
 
bool hwSrgbEncodeOutput
 Enables an sRGB encoding for the color output on HW shader targets.
 
bool hwWriteDepthMoments
 Enables the writing of depth moments for HW shader targets.
 
bool hwShadowMap
 Enables shadow mapping for HW shader targets.
 
bool hwAmbientOcclusion
 Enables ambient occlusion rendering for HW shader targets.
 
unsigned int hwMaxActiveLightSources
 Sets the maximum number of light sources that can be active at once.
 
bool hwNormalizeUdimTexCoords
 Sets whether to transform texture coordinates to normalize uv space when UDIMs images are bound to an image.
 
bool hwWriteAlbedoTable
 Enables the writing of a directional albedo table.
 
bool hwWriteEnvPrefilter
 Enables the generation of a prefiltered environment map.
 
bool hwImplicitBitangents
 Calculate fallback bitangents from existing normals and tangents inside the bitangent node.
 
bool oslImplicitSurfaceShaderConversion
 
bool oslConnectCiWrapper
 

Detailed Description

Class holding options to configure shader generation.

Member Data Documentation

◆ distributeLayerOverBsdfMix

bool distributeLayerOverBsdfMix

Enable distributing layer operations over mix nodes.

Transforms layer(mix(A, B, w), C) into mix(layer(A, C), layer(B, C), w) for backends with limited layering capabilities. Defaults to false.

◆ emitColorTransforms

bool emitColorTransforms

Enable emitting colorspace transform code if a color management system is defined.

Defaults to true.

◆ fileTextureVerticalFlip

bool fileTextureVerticalFlip

If true the y-component of texture coordinates used for sampling file textures will be flipped before sampling.

This can be used if file textures need to be flipped vertically to match the target's texture space convention. By default this option is false.

◆ hwAiryFresnelIterations

unsigned int hwAiryFresnelIterations

Sets the number of iterations for Airy Fresnel reflection calculations.

Higher values provide more accurate thin-film interference patterns but increase computational cost. Defaults to 2.

◆ hwAmbientOcclusion

bool hwAmbientOcclusion

Enables ambient occlusion rendering for HW shader targets.

Defaults to false.

◆ hwNormalizeUdimTexCoords

bool hwNormalizeUdimTexCoords

Sets whether to transform texture coordinates to normalize uv space when UDIMs images are bound to an image.

Can be enabled for when texture atlas generation is performed to compress a set of UDIMs into a single normalized image for hardware rendering.

◆ hwShadowMap

bool hwShadowMap

Enables shadow mapping for HW shader targets.

Defaults to false.

◆ hwSrgbEncodeOutput

bool hwSrgbEncodeOutput

Enables an sRGB encoding for the color output on HW shader targets.

Defaults to false.

◆ hwTransparency

bool hwTransparency

Sets if transparency is needed or not for HW shaders.

If a surface shader has potential of being transparent this must be set to true, otherwise no transparency code fragments will be generated for the shader and the surface will be fully opaque.

◆ hwWriteAlbedoTable

bool hwWriteAlbedoTable

Enables the writing of a directional albedo table.

Defaults to false.

◆ hwWriteDepthMoments

bool hwWriteDepthMoments

Enables the writing of depth moments for HW shader targets.

Defaults to false.

◆ hwWriteEnvPrefilter

bool hwWriteEnvPrefilter

Enables the generation of a prefiltered environment map.

Defaults to false.

◆ libraryPrefix

FilePath libraryPrefix

The standard library prefix, which will be applied to calls to emitLibraryInclude during code generation.

Defaults to "libraries".

◆ premultipliedBsdfAdd

bool premultipliedBsdfAdd

Enable replacing BSDF mix nodes with premultiplied add nodes.

This folds the mix weight into each BSDF's weight input, enabling hardware shading languages to skip BSDF evaluation via dynamic branching when the weight is zero. Defaults to false.

◆ targetColorSpaceOverride

string targetColorSpaceOverride

An optional override for the target color space.

Shader fragments will be generated to transform input values and textures into this color space.

◆ targetDistanceUnit

string targetDistanceUnit

Define the target distance unit.

Shader fragments will be generated to transform input distance values to the given unit.


The documentation for this class was generated from the following file: