FnUsdAbstractionLib 0.6.0
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
usg::RenderInterface Class Reference
Inheritance diagram for usg::RenderInterface:
usg::StormRenderInterface

Classes

class  OutputLayer
 
struct  RenderPluginDesc
 
struct  RenderSettingsDescriptor
 

Public Types

using DataFormat = uint8_t
 
using RenderSettingsDescriptorVector = std::vector< RenderSettingsDescriptor >
 

Public Member Functions

 RenderInterface (bool createHandle=true)
 
bool isValid () const
 True if RenderInterface is valid (has a valid object binding.)
 
 operator bool () const
 
const TokenrendererId () const
 Identifier token for this renderer interface - should be unique!
 
ArgSetrendererArgs ()
 
void initRenderer (const ArgSet &args)
 
bool rendererInitialized () const
 
const RenderSettingsDescriptorVector & renderSettings () const
 Returns the available render settings.
 
void setRenderSetting (const Token &key, const Value &v)
 Sets the render setting if it exists.
 
bool isRenderSetting (const Token &key) const
 Returns whether the key identifies a render setting.
 
const RenderSettingsDescriptorgetRenderSetting (const Token &key) const
 Returns the render setting for key. If it doesn't exist, returns an empty descriptor.
 
void setRefineLevel (int level)
 Sets the refine level for subdiv prims.
 
void setProgressiveRendering (bool progressiveRendering)
 Sets whether the rendering should be done progressively.
 
void setEnablePresentation (bool enable)
 Enables/disables presentation to the screen.
 
void setPresentationOutput (const Token &name)
 Sets the AOVs which will be rendered to the viewport if presentation is enabled.
 
void setEnableLighting (bool enabled)
 Enables/disables scene lighting.
 
bool isLightingEnabled () const
 Returns whether scene lighting is enabled or disabled.
 
void setCameraFraming (const fdk::Box2i &displayWindow, const fdk::Box2i &dataWindow, float pixelAspectRatio=1.0f)
 
void setFreeCameraMatrices (const fdk::Mat4d &viewMatrix, const fdk::Mat4d &projectionMatrix)
 
void setOutputLayerSize (int32_t width, int32_t height)
 Set pixel w/h of the OutputLayers.
 
void setEnableShadows (bool enabled)
 Turns the shadow task on or off.
 
bool isShadowsEnabled () const
 Returns whether the shadow task is on or off.
 
virtual const SourceCodeGeneratorgetSourceCodeGenerator (const Token &sourceType) const
 Return the MaterialSource generator to use for source type sourceType.
 
void setEnableMaterials (bool enabled)
 Enables/disables using scene materials.
 
bool isMaterialEnabled () const
 Returns whether scene materials are enabled/disabled.
 
void setDisplayRender (const bool displayRender)
 
bool isDisplayRender () const
 
void setDisplayProxy (const bool displayProxy)
 
bool isDisplayProxy () const
 
void setDisplayGuides (const bool displayGuides)
 
bool isDisplayGuides () const
 
void setFlatShading (bool enable)
 
bool isFlatShading () const
 
void executeTasks (bool fullyConverge=false)
 
bool isConverged () const
 Is the buffer converged (whether the renderer is still adding samples or not).
 
void setOutputLayers (const TokenArray &names)
 Set the list of named OutputLayers to be rendered.
 
OutputLayer getOutputLayer (const Token &name) const
 
void setSceneName (const std::string &sceneName)
 Set the identifier name for the scene.
 
const std::string & getSceneName () const
 Get the identifier name for the scene.
 

Static Public Member Functions

static const std::vector< RenderPluginDesc > & rendererPlugins ()
 Return the list of all loaded plugin names.
 
static bool rendererPluginExists (Token id, RenderPluginDesc *desc=nullptr)
 Checks whether the renderer plugin exists.
 

Static Public Attributes

static DataFormat FormatUNorm8
 
static DataFormat FormatUNorm8Vec2
 
static DataFormat FormatUNorm8Vec3
 
static DataFormat FormatUNorm8Vec4
 
static DataFormat FormatSNorm8
 
static DataFormat FormatSNorm8Vec2
 
static DataFormat FormatSNorm8Vec3
 
static DataFormat FormatSNorm8Vec4
 
static DataFormat FormatFloat16
 
static DataFormat FormatFloat16Vec2
 
static DataFormat FormatFloat16Vec3
 
static DataFormat FormatFloat16Vec4
 
static DataFormat FormatFloat32
 
static DataFormat FormatFloat32Vec2
 
static DataFormat FormatFloat32Vec3
 
static DataFormat FormatFloat32Vec4
 
static DataFormat FormatInt16
 
static DataFormat FormatInt16Vec2
 
static DataFormat FormatInt16Vec3
 
static DataFormat FormatInt16Vec4
 
static DataFormat FormatUInt16
 
static DataFormat FormatUInt16Vec2
 
static DataFormat FormatUInt16Vec3
 
static DataFormat FormatUInt16Vec4
 
static DataFormat FormatInt32
 
static DataFormat FormatInt32Vec2
 
static DataFormat FormatInt32Vec3
 
static DataFormat FormatInt32Vec4
 
static DataFormat FormatFloat32UInt8
 Depth-stencil format.
 
static DataFormat FormatInvalid
 
static DataFormat FormatCount
 

Protected Member Functions

virtual bool _initRenderer (const Token &rendererId)
 Subclasses can do any custom initializations in this method.
 

Protected Attributes

std::unique_ptr< RenderInterfaceHandle, void(*)(RenderInterfaceHandle *)> _pImpl
 
Token _rendererId
 Renderer identifier string.
 
ArgSet _rendererArgs
 Arguments to renderer.
 
std::vector< RenderSettingsDescriptor_rendererSettings
 Arguments to renderer.
 
std::string _sceneName
 Identifier name for scene.
 
bool _showViewerGeometry = true
 True if we show the ViewerContext geometry, otherwise show from inputs.
 
bool _flatShading = false
 Materials are not lit, they are constant-shaded colors & textures.
 
bool _enableLighting = true
 
bool _enableSceneMaterials = true
 
bool _enableShadows = false
 
bool _displayRender = true
 True if we are showing render prims.
 
bool _displayProxy = false
 True if we are showing proxy prims.
 
bool _displayGuides = false
 True if we are showing guide prims.
 
float _pointSize = 3.0f
 
fdk::Vec4f _pointColor {1.0f, 0.0f, 0.0f, 1.0f}
 
int _refineLevel = 0
 The refine level for subdiv prims.
 

Friends

class RenderInterfaceHandle
 

Member Function Documentation

◆ initRenderer()

void usg::RenderInterface::initRenderer ( const ArgSet args)

Initialize the renderer interface, copying the provided args. This method will then call the virtual subclass method _initRenderer().

◆ rendererInitialized()

bool usg::RenderInterface::rendererInitialized ( ) const

Returns true if the render substructures are allocated and initialized. Note - check this before calling any accessor methods!

◆ setEnableLighting()

void usg::RenderInterface::setEnableLighting ( bool  enabled)
inline

Enables/disables scene lighting.


Lighting API

◆ setCameraFraming()

void usg::RenderInterface::setCameraFraming ( const fdk::Box2i &  displayWindow,
const fdk::Box2i &  dataWindow,
float  pixelAspectRatio = 1.0f 
)

Camera and Framing API

◆ setFreeCameraMatrices()

void usg::RenderInterface::setFreeCameraMatrices ( const fdk::Mat4d &  viewMatrix,
const fdk::Mat4d &  projectionMatrix 
)

Set the view and projection matrices for the free camera. Note: The projection matrix must be pre-adjusted for the window policy.

◆ setEnableShadows()

void usg::RenderInterface::setEnableShadows ( bool  enabled)
inline

Turns the shadow task on or off.


Shadow API

◆ getSourceCodeGenerator()

virtual const SourceCodeGenerator * usg::RenderInterface::getSourceCodeGenerator ( const Token sourceType) const
virtual

Return the MaterialSource generator to use for source type sourceType.


Material API

◆ executeTasks()

void usg::RenderInterface::executeTasks ( bool  fullyConverge = false)

Start the engine execution of the currently assigned rendering tasks. If fullyConverge = true the method will loop until isConverged() = true before returning.

◆ getOutputLayer()

OutputLayer usg::RenderInterface::getOutputLayer ( const Token name) const

Retrieve a named OutputLayer, if it exists. If not the returned OutputLayer object is invalid. Warning, no internal state checking performed, assumes rendererInitialized() returned true!

◆ _initRenderer()

virtual bool usg::RenderInterface::_initRenderer ( const Token rendererId)
protectedvirtual

Subclasses can do any custom initializations in this method.

Reimplemented in usg::StormRenderInterface.



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