FnUsdAbstractionLib 0.6.0
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
usg::ShaderSource Class Referenceabstract

Interface to define shader source code. More...

#include <ShaderSource.h>

Public Member Functions

 ShaderSource (const MaterialSource &materialSourceGen, const ShaderSchema *schema, std::stringstream &sourceDest)
 
const SourceCodeGeneratorsourceTypeGenerator () const
 Returns the SourceCodeGenerator that created this MaterialSource.
 
const usg::TokensourceType () const
 Returns the source target type of the generator.
 
const MaterialSourcematerialSource () const
 Returns the MaterialSource that created this ShaderSource.
 
virtual void startFunction ()=0
 Starts a shader function with the given set of inputs.
 
virtual void emitLine (const std::string &line)=0
 Emits the shader line source.
 
virtual std::string input (const std::string &name)=0
 Returns code required to retrieve a value from the named input.
 
virtual std::string sampleTexture (const std::string &inputName, const std::string &texCoordVarName)=0
 Returns code that allows sampling of a texture at the given texture coordinate.
 
virtual void output (const std::string &name, const std::string &expression)=0
 Declares and defines a shader output to be equal to the given expression.
 
virtual void endFunction ()=0
 Ends the shader function.
 
virtual fdk::StringList inputs () const =0
 Return the list of named inputs created by calls to input().
 
virtual const fdk::StringSet & textures () const =0
 Return the list of named texture inputs created by calls to input().
 

Protected Attributes

const MaterialSource_materialSource
 
const ShaderSchema_shaderSchema
 
std::stringstream & _sourceDest
 

Detailed Description

Interface to define shader source code.



©2025 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.thefoundry.co.uk