MaterialX.PyMaterialXGenSlang Module¶
Shader generation using the Slang shading language.
- class MaterialX.PyMaterialXGenSlang.SlangShaderGenerator¶
Bases:
HwShaderGeneratorBase class for Slang code generation.
A generator for a specific Slang target should be derived from this class.
- static create() MaterialX.PyMaterialXGenShader.ShaderGenerator¶
- bindLightShader(self: MaterialX.PyMaterialXCore.NodeDef, arg0: SupportsInt, arg1: MaterialX.PyMaterialXGenShader.GenContext) None¶
- generate(self: MaterialX.PyMaterialXGenSlang.SlangShaderGenerator, arg0: str, arg1: MaterialX.PyMaterialXCore.Element, arg2: MaterialX.PyMaterialXGenShader.GenContext) MaterialX.PyMaterialXGenShader.Shader¶
Generate a shader starting from the given element, translating the element and all dependencies upstream into shader code.
- getColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX.PyMaterialXGenShader.ColorManagementSystem¶
Returns the color management system.
- getTarget(self: MaterialX.PyMaterialXGenSlang.SlangShaderGenerator) str¶
Return a unique identifier for the target this generator is for.
- getTokenSubstitutions(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) dict[str, str]¶
Return the map of token substitutions used by the generator.
- getUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX_v1_39_5::UnitSystem¶
Returns the unit system.
- getVersion(self: MaterialX.PyMaterialXGenSlang.SlangShaderGenerator) str¶
Return the version string for the Slang version this generator is for.
- registerShaderMetadata(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document, arg1: MaterialX_v1_39_5::GenContext) None¶
Register metadata that should be exported to the generated shaders.
Supported metadata includes standard UI attributes like “uiname”, “uifolder”, “uimin”, “uimax”, etc. But it is also extendable by defining custom attributes using AttributeDefs. Any AttributeDef in the given document with exportable=”true” will be exported as shader metadata when found on nodes during shader generation. Derived shader generators may override this method to change the registration. Applications must explicitly call this method before shader generation to enable export of metadata.
- registerTypeDefs(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document) None¶
Register type definitions from the document.
- setColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXGenShader.ColorManagementSystem) None¶
Sets the color management system.
- setUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX_v1_39_5::UnitSystem) None¶
Sets the unit system.
- unbindLightShader(self: SupportsInt, arg0: MaterialX.PyMaterialXGenShader.GenContext) None¶
- unbindLightShaders(self: MaterialX.PyMaterialXGenShader.GenContext) None¶