HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PremultipliedBsdfAddRefactor Class Reference

#include <ShaderGraphRefactor.h>

+ Inheritance diagram for PremultipliedBsdfAddRefactor:

Public Member Functions

const stringgetName () const override
 Return the name of this refactoring pass. More...
 
size_t execute (ShaderGraph &graph, GenContext &context) override
 
- Public Member Functions inherited from ShaderGraphRefactor
virtual ~ShaderGraphRefactor ()
 

Detailed Description

Replaces BSDF mix nodes with premultiplied add nodes. Transforms mix(A, B, w) into add(A*w, B*(1-w)) by folding the mix weight into each BSDF's weight input, enabling hardware shading languages to skip BSDF evaluation when the weight is zero.

Definition at line 59 of file ShaderGraphRefactor.h.

Member Function Documentation

size_t PremultipliedBsdfAddRefactor::execute ( ShaderGraph graph,
GenContext context 
)
overridevirtual

Execute the pass on the given graph. Return the number of graph edits made, or zero if the pass is not applicable to the current context.

Implements ShaderGraphRefactor.

const string& PremultipliedBsdfAddRefactor::getName ( ) const
overridevirtual

Return the name of this refactoring pass.

Implements ShaderGraphRefactor.


The documentation for this class was generated from the following file: