HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GenOptions.h
Go to the documentation of this file.
1 //
2 // TM & (c) 2017 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
3 // All rights reserved. See LICENSE.txt for license.
4 //
5 
6 #ifndef MATERIALX_GENOPTIONS_H
7 #define MATERIALX_GENOPTIONS_H
8 
9 /// @file
10 /// Shader generation options class
11 
13 
15 
16 /// Type of shader interface to be generated
18 {
19  /// Create a complete interface with uniforms for all
20  /// editable inputs on all nodes used by the shader.
21  /// This interface makes the shader fully editable by
22  /// value without requiring any rebuilds.
23  /// This is the default interface type.
25 
26  /// Create a reduced interface with uniforms only for
27  /// the inputs that has been declared in the shaders
28  /// nodedef interface. If values on other inputs are
29  /// changed the shader needs to be rebuilt.
31 };
32 
33 /// Method to use for specular environment lighting
35 {
36  /// Do not use specular environment maps
38 
39  /// Use Filtered Importance Sampling for
40  /// specular environment/indirect lighting.
42 
43  /// Use pre-filtered environment maps for
44  /// specular environment/indirect lighting.
46 };
47 
48 /// Method to use for directional albedo evaluation
50 {
51  /// Use an analytic approximation for directional albedo.
53 
54  /// Use a table look-up for directional albedo.
56 
57  /// Use Monte Carlo integration for directional albedo.
59 };
60 
61 /// @class GenOptions
62 /// Class holding options to configure shader generation.
64 {
65  public:
67  shaderInterfaceType(SHADER_INTERFACE_COMPLETE),
68  fileTextureVerticalFlip(false),
69  addUpstreamDependencies(true),
70  hwTransparency(false),
71  hwSpecularEnvironmentMethod(SPECULAR_ENVIRONMENT_FIS),
72  hwDirectionalAlbedoMethod(DIRECTIONAL_ALBEDO_ANALYTIC),
73  hwWriteDepthMoments(false),
74  hwShadowMap(false),
75  hwAmbientOcclusion(false),
76  hwMaxActiveLightSources(3),
77  hwNormalizeUdimTexCoords(false),
78  hwWriteAlbedoTable(false),
79  emitColorTransforms(true)
80  {
81  }
82  virtual ~GenOptions() { }
83 
84  // TODO: Add options for:
85  // - shader gen optimization level
86  // - graph flattening or not
87 
88  /// Sets the type of shader interface to be generated
90 
91  /// If true the y-component of texture coordinates used for sampling
92  /// file textures will be flipped before sampling. This can be used if
93  /// file textures need to be flipped vertically to match the target's
94  /// texture space convention. By default this option is false.
96 
97  /// An optional override for the target color space.
98  /// Shader fragments will be generated to transform
99  /// input values and textures into this color space.
101 
102  /// Define the target distance unit.
103  /// Shader fragments will be generated to transform
104  /// input distance values to the given unit.
106 
107  /// Sets whether to include upstream dependencies
108  /// for the element to generate a shader for.
110 
111  /// Sets if transparency is needed or not for HW shaders.
112  /// If a surface shader has potential of being transparent
113  /// this must be set to true, otherwise no transparency
114  /// code fragments will be generated for the shader and
115  /// the surface will be fully opaque.
117 
118  /// Sets the method to use for specular environment lighting
119  /// for HW shader targets.
121 
122  /// Sets the method to use for directional albedo evaluation
123  /// for HW shader targets.
125 
126  /// Enables the writing of depth moments for HW shader targets.
127  /// Defaults to false.
129 
130  /// Enables shadow mapping for HW shader targets.
131  /// Defaults to false.
133 
134  /// Enables ambient occlusion rendering for HW shader targets.
135  /// Defaults to false.
137 
138  /// Sets the maximum number of light sources that can
139  /// be active at once.
141 
142  /// Sets whether to transform texture coordinates to normalize
143  /// uv space when UDIMs images are bound to an image. Can be
144  /// enabled for when texture atlas generation is performed to
145  /// compress a set of UDIMs into a single normalized image for
146  /// hardware rendering.
148 
149  /// Enables the writing of a directional albedo table.
150  /// Defaults to false.
152 
153  /// Enable emitting colorspace transform code if a color management
154  /// system is defined.
155  /// Defaults to true.
157 };
158 
160 
161 #endif
ShaderInterfaceType
Type of shader interface to be generated.
Definition: GenOptions.h:17
HwDirectionalAlbedoMethod hwDirectionalAlbedoMethod
Definition: GenOptions.h:124
#define MATERIALX_NAMESPACE_BEGIN
Definition: Generated.h:23
bool fileTextureVerticalFlip
Definition: GenOptions.h:95
bool emitColorTransforms
Definition: GenOptions.h:156
HwDirectionalAlbedoMethod
Method to use for directional albedo evaluation.
Definition: GenOptions.h:49
bool hwWriteDepthMoments
Definition: GenOptions.h:128
virtual ~GenOptions()
Definition: GenOptions.h:82
#define MX_GENSHADER_API
Definition: Export.h:18
unsigned int hwMaxActiveLightSources
Definition: GenOptions.h:140
string targetColorSpaceOverride
Definition: GenOptions.h:100
Use an analytic approximation for directional albedo.
Definition: GenOptions.h:52
bool hwNormalizeUdimTexCoords
Definition: GenOptions.h:147
HwSpecularEnvironmentMethod hwSpecularEnvironmentMethod
Definition: GenOptions.h:120
bool hwTransparency
Definition: GenOptions.h:116
bool hwWriteAlbedoTable
Definition: GenOptions.h:151
Use Monte Carlo integration for directional albedo.
Definition: GenOptions.h:58
HwSpecularEnvironmentMethod
Method to use for specular environment lighting.
Definition: GenOptions.h:34
int shaderInterfaceType
Sets the type of shader interface to be generated.
Definition: GenOptions.h:89
bool addUpstreamDependencies
Definition: GenOptions.h:109
bool hwAmbientOcclusion
Definition: GenOptions.h:136
Use a table look-up for directional albedo.
Definition: GenOptions.h:55
bool hwShadowMap
Definition: GenOptions.h:132
#define MATERIALX_NAMESPACE_END
Definition: Generated.h:24
Do not use specular environment maps.
Definition: GenOptions.h:37
string targetDistanceUnit
Definition: GenOptions.h:105