RectAreaLight¶
Qualified name: algan.rendering.lights.RectAreaLight
- class RectAreaLight(*args, width=2.0, height=2.0, target=tensor([0., 0., 0.]), samples=4, decay=2.0, distance=0.0, **kwargs)[source]¶
Bases:
_TargetedLightEmit light from a one-sided rectangular surface.
The rectangle is centred on
locationand facestarget. Emitted radiance is constant with distance; illumination falls off through geometry and has no artificial range cutoff. The path tracer shows the opaque panel to camera, reflection and refraction rays: its front emits and its back is black. The single-sample renderer integrates a fixed grid of emitting cells but does not display the panel itself.intensitykeeps its existing area-light normalization: for areaA, the emitted linear-RGB radiance iscolor * intensity / A(including the usual opacity/glow multipliers). Thus increasing the area at fixed intensity spreads the same total power over a larger, dimmer panel. The one-sided Lambertian flux ispi * color * intensity. This is a scene-linear convention, not a calibrated photometric watt or lumen.Animation
Location, color, opacity and intensity follow their normal Mob animation rules. Target, width, height and sample count are immediate setup parameters; set them before rendering. Construction does not spawn the light: call
spawn()to add it to the scene.- Parameters:
height (width /) – Positive rectangle dimensions in world units. Each defaults to 2.
target – World point the rectangle faces. Defaults to the origin.
samples – Positive emitter sample count, rounded up to a square grid. Defaults to 4. More samples improve the single-sample renderer’s integration and shadows at linear cost. The path tracer samples the panel directly and its cost does not depend on this count.
distance (decay /) – Compatibility keywords fixed to 2 and 0 respectively, including on later assignment. Other values raise instead of silently changing emission to a distance-dependent, nonphysical model. Omit both in new code. Point and spot lights retain their artistic falloff controls.
- Raises:
.AlganConfigurationError – If dimensions or sample count are invalid, or a nonphysical decay or finite distance cutoff is requested.
Methods
Attributes
animation_managerThis mob's scene-owned animation manager.
basisThe Mob's orientation and scale, as a flattened 3x3 matrix of shape
(*, 9).casts_shadowsWhether this Mob's geometry blocks light on its way from a light source to another surface -- whether it casts a shadow.
childrenThe Mobs attached below this one, in attachment order.
closed_shellWhether this Mob's triangles form a CLOSED shell -- every camera ray that enters the geometry crosses a second time on its way out.
The fixed inverse-square exponent, 2; this is not an animation.
The fixed unlimited-range sentinel, 0; this is not an animation.
draws_descendantsWhether
get_render_primitivesreturns geometry belonging to this Mob's DESCENDANTS as well as its own.forwardGet the direction the Mob is facing.
lifespanThis mob's [spawn, despawn) interval on its Scene timeline (a
Lifespan).light_typelocationThe Mob's position in world space, shape
(*, 3).normalized_basisThe Mob's orientation with scale divided out, shape
(*, 9).parentsThe Mobs this one is attached to, in attachment order.
receives_shadowsWhether this Mob's surfaces are darkened by shadows cast onto them.
rightGet the Mob's own rightward direction.
scale_coefficientThe Mob's scale along its own right, up and forward axes, shape
(*, 3).two_sidedWhether this Mob's geometry should be lit from whichever side the ray arrives on.
upGet the Mob's own upward direction.
xThe Mob's x coordinate in world units, shape
(*, 1).xyThe Mob's x and y coordinates in world units, shape
(*, 2).yThe Mob's y coordinate in world units, shape
(*, 1).zThe Mob's z coordinate in world units, shape
(*, 1).- property decay: float¶
The fixed inverse-square exponent, 2; this is not an animation.
- property distance: float¶
The fixed unlimited-range sentinel, 0; this is not an animation.