pygfx.objects.PointLight

class pygfx.objects.PointLight(color='#ffffff', intensity=3, *, cast_shadow=False, distance=0, decay=0, **kwargs)

Bases: Light

Radial point light source.

A light that gets emitted from a single point in all directions.

Parameters:
  • color (Color) – The color of the emitted light.

  • intensity (float) – The light intensity. A value of 3 corresponds to a well lit scene.

  • cast_shadow (bool) – If True, the light can cast shadows. Otherwise it doesn’t.

  • distance (float) – The maximum distance at which objects are considered illuminated by the light. Limiting this may increase performance in large scenes. A value of 0 means that all objects are considered.

  • decay (float) – The rate at which the light dims as it travels. A value of 0 means no decay. A decay of 2 is physically correct.

Notes

When setting decay to a non-zero value you likely probably have to increase intensity (a lot) as light decays following an inverse-square profile.

property power

The light’s power. I.e. the luminous power of the light measured in lumens (lm). Changing the power will also change the light’s intensity.

property distance

When distance is zero, light will attenuate according to inverse-square law to infinite distance. When distance is non-zero, light will attenuate the same way until near the distance cutoff, where it will then attenuate quickly and smoothly to 0. Inherently, cutoffs are not physically correct.

property decay

The amount the light dims along the distance of the light. A decay of 2 leads to physically realistic light falloff. Default is 0, which means the light does not decay.