FnUsdAbstractionLib  14.0.8
usg::ShaderSchema Class Reference

ShaderSchema class creates ShaderDesc definitions stored in the registry. More...

#include <ShaderSchema.h>

Inheritance diagram for usg::ShaderSchema:
usg::Schema usg::CoShaderSchema usg::LightShaderSchema usg::SurfaceShaderSchema

Public Member Functions

 ShaderSchema (const SchemaDescription &pluginDescription, const ShaderPropertyArray &properties, const fdk::KeyValueMap &metadata=fdk::KeyValueMap())
 
const TokenbaseTypeName () const override
 Return a string indicating this is a ShaderSchema.
 
ShaderSchemaasShaderSchema () override
 Used to cast a Schema to a ShaderSchema.
 
virtual CoShaderSchemaasCoShader ()
 Used to cast a ShaderSchema to a CoShaderSchema.
 
virtual SurfaceShaderSchemaasSurfaceShader ()
 Used to cast a ShaderSchema to a SurfaceShaderSchema.
 
virtual LightShaderSchemaasLightShader ()
 Used to cast a ShaderSchema to a LightShaderSchema.
 
virtual VolumeShaderSchema * asVolumeShader ()
 Used to cast a ShaderSchema to a VolumeShaderSchema.
 
virtual const std::string & sourceCode (const Token &sourceType) const
 
virtual const bool sourceCode (ShaderSource &shaderSource) const
 
virtual const ShaderPropertyArray & shaderProperties () const
 Return the input/output shader properties.
 
- Public Member Functions inherited from usg::Schema
 Schema (const SchemaDescription &pluginDescription, const SchemaPropertyArray &properties, const fdk::KeyValueMap &metadata=fdk::KeyValueMap())
 
virtual ~Schema ()
 Dtor in implementation required for std::unique_ptr to work.
 
virtual void getSourceTypes (TokenSet &types) const
 

Additional Inherited Members

- Static Public Member Functions inherited from usg::Schema
static const SchemaDescriptionfind (const char *schema_name)
 Find a SchemaDescription by schema name and optional source-type - NOT the plugin .so filename!
 
- Static Protected Member Functions inherited from usg::Schema
static Schemacreate (const char *schema_name)
 
- Protected Attributes inherited from usg::Schema
std::unique_ptr< ShaderSchemaHandle > _pImpl
 

Detailed Description

ShaderSchema class creates ShaderDesc definitions stored in the registry.

Constructor & Destructor Documentation

usg::ShaderSchema::ShaderSchema ( const SchemaDescription pluginDescription,
const ShaderPropertyArray &  properties,
const fdk::KeyValueMap &  metadata = fdk::KeyValueMap() 
)

The shader class name is taken from the ShaderSchemaDescription::schemaName(), so the subclass must pass its ShaderSchemaDescription.

Member Function Documentation

virtual const std::string& usg::ShaderSchema::sourceCode ( const Token sourceType) const
virtual

Return the implementation code string for a specific sourceType when the shader is the single shader in a material network. Subclass should have already declared the type in its list of supported types, so if there are multiple sources the type string should be checked.

virtual const bool usg::ShaderSchema::sourceCode ( ShaderSource shaderSource) const
virtual

Creates the source code for the shader for a specific target (e.g. glslfx). Returns true if the target is supported.



©2024 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com