MaterialX 1.38.10
Loading...
Searching...
No Matches
Util.h File Reference

Rendering utility methods. More...

Go to the source code of this file.

Classes

struct  UIProperties
 Set of possible UI properties for an element. More...
 
struct  UIPropertyItem
 Interface for holding the UI properties associated shader port. More...
 

Functions

Shader Utilities
MX_RENDER_API ShaderPtr createShader (const string &shaderName, GenContext &context, ElementPtr elem)
 Create a shader for a given element.
 
MX_RENDER_API ShaderPtr createConstantShader (GenContext &context, DocumentPtr stdLib, const string &shaderName, const Color3 &color)
 Create a shader with a constant color output, using the given standard libraries for code generation.
 
MX_RENDER_API ShaderPtr createDepthShader (GenContext &context, DocumentPtr stdLib, const string &shaderName)
 Create a shader with depth value output, using the given standard libraries for code generation.
 
MX_RENDER_API ShaderPtr createAlbedoTableShader (GenContext &context, DocumentPtr stdLib, const string &shaderName)
 Create a shader that generates a look-up table for directional albedo, using the given standard libraries for code generation.
 
MX_RENDER_API ShaderPtr createEnvPrefilterShader (GenContext &context, DocumentPtr stdLib, const string &shaderName)
 Create a shader that generates a prefiltered environment map.
 
MX_RENDER_API ShaderPtr createBlurShader (GenContext &context, DocumentPtr stdLib, const string &shaderName, const string &filterType, float filterSize)
 Create a blur shader, using the given standard libraries for code generation.
 

Variables

MATERIALX_NAMESPACE_BEGIN MX_RENDER_API const Color3 DEFAULT_SCREEN_COLOR_SRGB
 
MX_RENDER_API const Color3 DEFAULT_SCREEN_COLOR_LIN_REC709
 

User Interface Utilities

using UIPropertyGroup = std::multimap< string, UIPropertyItem >
 A grouping of property items by name.
 
MX_RENDER_API unsigned int getUIProperties (InputPtr input, const string &target, UIProperties &uiProperties)
 Get the UI properties for a given input element and target. More...
 
MX_RENDER_API void createUIPropertyGroups (DocumentPtr doc, const VariableBlock &block, UIPropertyGroup &groups, UIPropertyGroup &unnamedGroups, const string &pathSeparator)
 Utility to group UI properties items based on Element group name from a VariableBlock. More...
 

Detailed Description

Rendering utility methods.

Function Documentation

◆ createUIPropertyGroups()

MX_RENDER_API void createUIPropertyGroups ( DocumentPtr  doc,
const VariableBlock block,
UIPropertyGroup groups,
UIPropertyGroup unnamedGroups,
const string &  pathSeparator 
)

Utility to group UI properties items based on Element group name from a VariableBlock.

Returns a list of named and unnamed groups.

◆ getUIProperties()

MX_RENDER_API unsigned int getUIProperties ( InputPtr  input,
const string &  target,
UIProperties uiProperties 
)

Get the UI properties for a given input element and target.

Returns the number of properties found.