PyMaterialXRenderMsl.MslRenderer

class MslRenderer

Bases: ShaderRenderer

Helper class for rendering generated MSL code to produce images.

There are two main interfaces which can be used: one which takes in a HwShader and one which allows for explicit setting of shader stage code.

The main services provided are:
  • Validation: All shader stages are compiled and atteched to an MSL shader program.

  • Introspection: The compiled shader program is examined for uniforms and attributes.

  • Binding: Uniforms and attributes which match the predefined variables generated the MSL code generator will have values assigned to this. This includes matrices, attribute streams, and textures.

  • Rendering: The program with bound inputs will be used to drawing geometry to an offscreen buffer. An interface is provided to save this offscreen buffer to disk using an externally defined image handler.

Methods

__init__(*args, **kwargs)

captureImage(self, arg0)

create(arg0, arg1, arg2)

createProgram(*args, **kwargs)

Overloaded function.

getProgram(self)

initialize(self[, renderContextHandle])

render(self)

renderTextureSpace(self, arg0, arg1)

validateInputs(self)

Methods

__init__(*args, **kwargs)
captureImage(self: MslRenderer, arg0: Image) Image
static create(arg0: int, arg1: int, arg2: BaseType) MslRenderer
createProgram(*args, **kwargs)

Overloaded function.

  1. createProgram(self: PyMaterialXRenderMsl.MslRenderer, arg0: PyMaterialXGenShader.Shader) -> None

  2. createProgram(self: PyMaterialXRenderMsl.MslRenderer, arg0: dict[str, str]) -> None

getProgram(self: MslRenderer) MslProgram
initialize(self: MslRenderer, renderContextHandle: capsule = None) None
render(self: MslRenderer) None
renderTextureSpace(self: MslRenderer, arg0: Vector2, arg1: Vector2) None
validateInputs(self: MslRenderer) None