pygfx.renderers.wgpu.ShaderInterface

class pygfx.renderers.wgpu.ShaderInterface

Bases: object

Define what a shader object must look like from the pov from the pipeline.

property hash

A hash of the current state of the shader. If the hash changed, it’s likely that the shader changed.

get_bindings(wobject, shared)

Subclasses must return a dict describing the buffers and textures used by this shader.

The result must be a dict of dicts with binding objects (group_slot -> binding_slot -> binding)

get_pipeline_info(wobject, shared)

Subclasses must return a dict describing pipeline details.

Fields for a compute shader: empty

Fields for a render shader:
  • “cull_mode”

  • “primitive_topology”

get_render_info(wobject, shared)

Subclasses must return a dict describing render details.

Fields for a compute shader:
  • “indices” (3 ints)

Fields for a render shader:
  • “render_mask”

  • “indices” (list of 2 or 4 ints).

Examples

Minimal Custom Object

Minimal Custom Object

Depth Material

Depth Material

Simple Custom Object

Simple Custom Object

Wireframe Material

Wireframe Material

Custom Object

Custom Object

NDC Coordinates

NDC Coordinates