raytracing_settings¶
Renderer settings: what a render produces, and the experimental switches.
SETTINGS.raytracing is deliberately small. It holds the settings that change
what the image looks like – samples_per_pixel, max_bounces,
shadows, lighting and tonemapping – and those are the ones documented and
supported.
The renderer also carries roughly fifty kernel and performance switches. Those
live on SETTINGS.raytracing.experimental, and setting one on the parent
raises with a pointer to the experimental section rather than silently accepting
it. The split is about the promise made, not the mechanism: engine code still
reads every field off SETTINGS.raytracing directly, and only writes are gated.
Nothing here is listed twice. The field set, each field’s type, and each
field’s setter are all derived from the storage module
(algan/rendering/raytracing/settings.py), because every table that mirrored
it drifted from it. There used to be three: a 119-row map from each lowercase
field to an UPPER_CASE global of the same name, a 50-row map from a field to
its setter, and a type table. The first is what let nine switches reach the
engine with no way to set them – each had a global and a setter, and nobody
added the row – and a tenth would have gone the same way. There is one
spelling for each setting now, so a switch declared in that module IS a field.
What remains listed is only what cannot be derived: _PUBLIC_FIELDS (a
promise, not a fact about the code), _POLYMORPHIC_FIELDS (three mode
switches that spell one state as a bool and another as a string, where
inferring the type from the default is wrong), _MINIMUMS (bounds read
off each field’s documented meaning) and _INERT_FIELDS.
Every write is validated: the accepted type comes from the value the field
ships with, numeric fields carry their lower bound, and floats must be finite.
Before that, only fields with a setter were checked at all, and only as far as
that setter’s own bool()/float() went – max_bounces = 'x' stored
the string and failed much later inside a kernel with nothing pointing back
here.
RayTracingPreset captures a configuration for reuse. Like the video
presets it is immutable, so set() on one returns a copy.
Read these live (rt_settings.x at call time) rather than importing them by
value at module import, which would freeze them before user code runs.
Classes
Immutable captured ray-tracing configuration. |
|
Stable mutable view over the ray-tracer's live configuration. |