pygfx.objects.Background

class pygfx.objects.Background(geometry=None, material=None, render_mask='opaque', **kwargs)

Bases: WorldObject

The scene’s background.

Can be e.g. a gradient, a static image or a skybox.

Parameters:
  • geometry (Geometry) – Must be None. Exists for compliance with the generic WorldObject API.

  • material (Material) – The material to use when rendering the background.

  • kwargs (Any) – Additional kwargs are forwarded to the object’s base class.

classmethod from_color(*colors)

Create a background with a BackgroundMaterial, using 1 uniform color, 2 colors for a vertical gradient, or 4 colors (one for each corner).

Examples

Orbit Camera

Orbit Camera

Use a Skybox

Use a Skybox

Panzoom Camera

Panzoom Camera

Color Picking

Color Picking

Transparency 1

Transparency 1

Use a Skybox

Use a Skybox

Nested Scenes

Nested Scenes

Mesh and Volume Slicing 2

Mesh and Volume Slicing 2

PBR Rendering 1

PBR Rendering 1

Transparency 2

Transparency 2

Volume and Mesh Slicing 1

Volume and Mesh Slicing 1

Dynamic Environment Map

Dynamic Environment Map

Subplots 2

Subplots 2

PBR Rendering 2

PBR Rendering 2

Text waterfall

Text waterfall

Environment Map Effects

Environment Map Effects

Mesh with quads

Mesh with quads

Map Screen to World

Map Screen to World

Validate Skybox

Validate Skybox

Pytorch Integration

Pytorch Integration