MaterialX 1.38.10
Loading...
Searching...
No Matches
GenOptions.h
Go to the documentation of this file.
1//
2// Copyright Contributors to the MaterialX Project
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#ifndef MATERIALX_GENOPTIONS_H
7#define MATERIALX_GENOPTIONS_H
8
11
13
15
16MATERIALX_NAMESPACE_BEGIN
17
20{
27
33};
34
37{
40
44
48};
49
52{
55
58
61};
62
65{
68
71};
72
75class MX_GENSHADER_API GenOptions
76{
77 public:
78 GenOptions() :
79 shaderInterfaceType(SHADER_INTERFACE_COMPLETE),
80 fileTextureVerticalFlip(false),
81 addUpstreamDependencies(true),
82 libraryPrefix("libraries"),
83 hwTransparency(false),
84 hwSpecularEnvironmentMethod(SPECULAR_ENVIRONMENT_FIS),
85 hwDirectionalAlbedoMethod(DIRECTIONAL_ALBEDO_ANALYTIC),
86 hwTransmissionRenderMethod(TRANSMISSION_REFRACTION),
87 hwWriteDepthMoments(false),
88 hwShadowMap(false),
89 hwAmbientOcclusion(false),
90 hwMaxActiveLightSources(3),
91 hwNormalizeUdimTexCoords(false),
92 hwWriteAlbedoTable(false),
93 hwWriteEnvPrefilter(false),
94 hwImplicitBitangents(true),
95 emitColorTransforms(true)
96 {
97 }
98 virtual ~GenOptions() { }
99
100 // TODO: Add options for:
101 // - shader gen optimization level
102 // - graph flattening or not
103
106
112
117
122
126
131
138
142
146
150
154
158
162
166
173
177
181
185
189};
190
191MATERIALX_NAMESPACE_END
192
193#endif
Cross-platform support for file and search paths.
HwDirectionalAlbedoMethod
Method to use for directional albedo evaluation.
Definition: GenOptions.h:52
@ DIRECTIONAL_ALBEDO_TABLE
Use a table look-up for directional albedo.
Definition: GenOptions.h:57
@ DIRECTIONAL_ALBEDO_MONTE_CARLO
Use Monte Carlo integration for directional albedo.
Definition: GenOptions.h:60
@ DIRECTIONAL_ALBEDO_ANALYTIC
Use an analytic approximation for directional albedo.
Definition: GenOptions.h:54
HwSpecularEnvironmentMethod
Method to use for specular environment lighting.
Definition: GenOptions.h:37
@ SPECULAR_ENVIRONMENT_NONE
Do not use specular environment maps.
Definition: GenOptions.h:39
@ SPECULAR_ENVIRONMENT_FIS
Use Filtered Importance Sampling for specular environment/indirect lighting.
Definition: GenOptions.h:43
@ SPECULAR_ENVIRONMENT_PREFILTER
Use pre-filtered environment maps for specular environment/indirect lighting.
Definition: GenOptions.h:47
HwTransmissionRenderMethod
Method to use for transmission rendering.
Definition: GenOptions.h:65
@ TRANSMISSION_OPACITY
Use opacity for transmission rendering.
Definition: GenOptions.h:70
@ TRANSMISSION_REFRACTION
Use a refraction approximation for transmission rendering.
Definition: GenOptions.h:67
ShaderInterfaceType
Type of shader interface to be generated.
Definition: GenOptions.h:20
@ SHADER_INTERFACE_REDUCED
Create a reduced interface with uniforms only for the inputs that has been declared in the shaders no...
Definition: GenOptions.h:32
@ SHADER_INTERFACE_COMPLETE
Create a complete interface with uniforms for all editable inputs on all nodes used by the shader.
Definition: GenOptions.h:26
Macros for declaring imported and exported symbols.
A generic file path, supporting both syntactic and file system operations.
Definition: File.h:27
Class holding options to configure shader generation.
Definition: GenOptions.h:76
bool fileTextureVerticalFlip
If true the y-component of texture coordinates used for sampling file textures will be flipped before...
Definition: GenOptions.h:111
unsigned int hwMaxActiveLightSources
Sets the maximum number of light sources that can be active at once.
Definition: GenOptions.h:165
bool emitColorTransforms
Enable emitting colorspace transform code if a color management system is defined.
Definition: GenOptions.h:188
bool hwWriteEnvPrefilter
Enables the generation of a prefiltered environment map.
Definition: GenOptions.h:180
bool hwAmbientOcclusion
Enables ambient occlusion rendering for HW shader targets.
Definition: GenOptions.h:161
bool hwShadowMap
Enables shadow mapping for HW shader targets.
Definition: GenOptions.h:157
string targetDistanceUnit
Define the target distance unit.
Definition: GenOptions.h:121
HwTransmissionRenderMethod hwTransmissionRenderMethod
Sets the method to use for transmission rendering for HW shader targets.
Definition: GenOptions.h:149
string targetColorSpaceOverride
An optional override for the target color space.
Definition: GenOptions.h:116
bool addUpstreamDependencies
Sets whether to include upstream dependencies for the element to generate a shader for.
Definition: GenOptions.h:125
HwSpecularEnvironmentMethod hwSpecularEnvironmentMethod
Sets the method to use for specular environment lighting for HW shader targets.
Definition: GenOptions.h:141
bool hwTransparency
Sets if transparency is needed or not for HW shaders.
Definition: GenOptions.h:137
HwDirectionalAlbedoMethod hwDirectionalAlbedoMethod
Sets the method to use for directional albedo evaluation for HW shader targets.
Definition: GenOptions.h:145
ShaderInterfaceType shaderInterfaceType
Sets the type of shader interface to be generated.
Definition: GenOptions.h:105
bool hwImplicitBitangents
Calculate fallback bitangents from existing normals and tangents inside the bitangent node.
Definition: GenOptions.h:184
bool hwWriteDepthMoments
Enables the writing of depth moments for HW shader targets.
Definition: GenOptions.h:153
bool hwNormalizeUdimTexCoords
Sets whether to transform texture coordinates to normalize uv space when UDIMs images are bound to an...
Definition: GenOptions.h:172
FilePath libraryPrefix
The standard library prefix, which will be applied to calls to emitLibraryInclude during code generat...
Definition: GenOptions.h:130
bool hwWriteAlbedoTable
Enables the writing of a directional albedo table.
Definition: GenOptions.h:176