MaterialX 1.38.2
Classes
Util.h File Reference

Rendering utility methods. More...

#include <MaterialXRender/Export.h>
#include <MaterialXGenShader/GenContext.h>
#include <MaterialXGenShader/ShaderGenerator.h>
#include <MaterialXGenShader/Util.h>
#include <map>

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
ShaderPtr createShader (const string &shaderName, GenContext &context, ElementPtr elem)
 Create a shader for a given element.
 
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.
 
ShaderPtr createDepthShader (GenContext &context, DocumentPtr stdLib, const string &shaderName)
 Create a shader with depth value output, using the given standard libraries for code generation.
 
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.
 
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.
 

User Interface Utilities

using UIPropertyGroup = std::multimap< string, UIPropertyItem >
 A grouping of property items by name.
 
unsigned int getUIProperties (InputPtr input, const string &target, UIProperties &uiProperties)
 Get the UI properties for a given input element and target. More...
 
void createUIPropertyGroups (DocumentPtr doc, const VariableBlock &block, UIPropertyGroup &groups, UIPropertyGroup &unnamedGroups, const string &pathSeparator, bool showAllInputs)
 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,
bool  showAllInputs 
)

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.