Configuration¶
This page contains class defined in the hkw.setup module.
Config¶
Config
dataclass
¶
Configuration for rendering.
Attributes:
| Name | Type | Description |
|---|---|---|
sensor |
Sensor
|
Sensor settings. |
film |
Film
|
Film settings. |
sampler |
Sampler
|
Sampler settings. |
emitters |
list[Emitter]
|
Emitter settings. |
integrator |
Integrator
|
Integrator settings. |
render_passes |
set[str]
|
Set of active render passes. Recognised values:
The convenience properties :attr: |
Source code in hakowan/setup/config.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
albedo
property
writable
¶
Whether the albedo pass is active. Alias for "albedo" in render_passes.
depth
property
writable
¶
Whether the depth pass is active. Alias for "depth" in render_passes.
facet_id
property
writable
¶
Whether the facet-ID pass is active. Alias for "facet_id" in render_passes.
When active the Blender backend performs a second render after the
main one. Every mesh face is colored with the RGB encoding of its
zero-based index (R = high byte, G = mid byte, B = low byte) using a
flat Emission shader so lighting has no effect. The output is written
to <stem>_facet_id<ext> with gamma correction, temporal blending,
and pixel filtering all disabled so pixel values can be decoded
directly::
fid = (R << 16) | (G << 8) | B
Background pixels have A = 0 and can be masked out. Supports up
to 2**24 − 1 ≈ 16.7 M faces.
normal
property
writable
¶
Whether the shading-normal pass is active. Alias for "normal" in render_passes.
render_passes
property
writable
¶
Set of active render passes.
Valid pass names are "albedo", "depth", "normal", and
"facet_id". Assigning a new collection replaces the entire set
and re-synchronises the Mitsuba AOV integrator accordingly.
Example::
config.render_passes = {"albedo", "depth"}
__sync_aovs()
¶
Rebuild the Mitsuba AOV integrator from the current render-pass set.
Strips any existing AOV wrapper and re-adds only the passes that are
currently active, ensuring the integrator always reflects the exact
state of _render_passes.
Source code in hakowan/setup/config.py
y_down()
¶
Update configuration for y-down coordinate system.
Source code in hakowan/setup/config.py
y_up()
¶
Update configuration for y-up coordinate system.
Source code in hakowan/setup/config.py
z_down()
¶
Update configuration for z-down coordinate system.
Source code in hakowan/setup/config.py
z_up()
¶
Update configuration for z-up coordinate system.
Source code in hakowan/setup/config.py
Emitter¶
Emitter
dataclass
¶
Envmap
dataclass
¶
Bases: Emitter
Environment light (i.e. image-based lighting).
Attributes:
| Name | Type | Description |
|---|---|---|
filename |
Path
|
Path to the environment light image file. |
scale |
float
|
Scaling factor to be applied to the environment light. |
up |
list
|
Up vector of the environment light. |
rotation |
float
|
Rotation angle of the environment light around the up direction. |
Source code in hakowan/setup/emitter.py
Film¶
Film
dataclass
¶
Film dataclass stores specifications of the output image.
Attributes:
| Name | Type | Description |
|---|---|---|
width |
int
|
Width of the output image in pixels. |
height |
int
|
Height of the output image in pixels. |
file_format |
str
|
File format of the output image. |
pixel_format |
str
|
Pixel format of the output image. |
component_format |
str
|
Component format of the output image. |
crop_offset |
NDArray | None
|
Offset of the crop window in pixels. |
crop_size |
NDArray | None
|
Size of the crop window in pixels. |
Together, width and height specify the output image resolution.
crop_offset and crop_size defines a crop region. If either is None, no cropping is performed.
file_format, pixel_format and component_format are for advanced user only. The default
values should work in most cases.
Source code in hakowan/setup/film.py
Integrator¶
AOV
dataclass
¶
Bases: Integrator
Arbitrary output variable (AOV) integrator.
Attributes:
| Name | Type | Description |
|---|---|---|
aovs |
list[str]
|
List of AOVs to render. |
integrator |
Integrator | None
|
Integrator to use for rendering AOVs. |
Note
See Mitsuba doc for supported AOV types and other details.
Source code in hakowan/setup/integrator.py
Direct
dataclass
¶
Bases: Integrator
Direct integrator.
Attributes:
| Name | Type | Description |
|---|---|---|
shading_samples |
int | None
|
Number of shading samples. |
emitter_samples |
int | None
|
Number of emitter samples. |
bsdf_samples |
int | None
|
Number of BSDF samples. |
Note
See Mitsuba doc for more details.
Source code in hakowan/setup/integrator.py
Integrator
dataclass
¶
Integrator dataclass contains parameters of various rendering techniques.
Attributes:
| Name | Type | Description |
|---|---|---|
hide_emitters |
bool
|
Whether to hide emitters from the camera. |
Source code in hakowan/setup/integrator.py
Path
dataclass
¶
Bases: Integrator
Path integrator.
Attributes:
| Name | Type | Description |
|---|---|---|
max_depth |
int
|
Maximum path depth. (-1 for unlimited) |
rr_depth |
int
|
Depth at which Russian roulette starts. |
Note
This integrator should work well for most surface-based scenes. See Mitsuba doc for more details.
Source code in hakowan/setup/integrator.py
VolPath
dataclass
¶
Bases: Integrator
Volumetric path integrator.
Attributes:
| Name | Type | Description |
|---|---|---|
max_depth |
int
|
Maximum path depth. (-1 for unlimited) |
rr_depth |
int
|
Depth at which Russian roulette starts. |
Note
This integrator should work well for most volume-based scenes. For example, if dielectric
material is involved, VolPath integrator sometimes produces better results than Path
integrator.
See Mitsuba doc for more details.
Source code in hakowan/setup/integrator.py
VolPathMIS
dataclass
¶
Bases: Integrator
Volumetric path integrator with spectral MIS.
Attributes:
| Name | Type | Description |
|---|---|---|
max_depth |
int
|
Maximum path depth. (-1 for unlimited) |
rr_depth |
int
|
Depth at which Russian roulette starts. |
Note
See Mitsuba doc for more details.
Source code in hakowan/setup/integrator.py
Sampler¶
Independent
dataclass
¶
Bases: Sampler
Independent sampler.
Note
See Mitsuba doc for more details.
Source code in hakowan/setup/sampler.py
Sampler
dataclass
¶
Sampler dataclass contains sampling-related settings.
Attributes:
| Name | Type | Description |
|---|---|---|
sample_count |
int
|
Number of samples per pixel. |
seed |
int
|
Seed for random number generate. |
Source code in hakowan/setup/sampler.py
Stratified
dataclass
¶
Bases: Sampler
Stratified sampler.
Attributes:
| Name | Type | Description |
|---|---|---|
jitter |
bool
|
Whether to jitter the samples. |
Note
See Mitsuba doc for more details.
Source code in hakowan/setup/sampler.py
Sensor¶
Orthographic
dataclass
¶
Perspective
dataclass
¶
Bases: Sensor
Perspective camera dataclass.
Attributes:
| Name | Type | Description |
|---|---|---|
fov |
float
|
Field of view in degrees. |
fov_axis |
str
|
Axis to which fov is applied. Can be "x" or "y" or "diagonal" or "smaller" or "larger". |
Source code in hakowan/setup/sensor.py
Sensor
dataclass
¶
Sensor dataclass contains camera-related settings.
Attributes:
| Name | Type | Description |
|---|---|---|
location |
list
|
Camera location in world space. |
target |
list
|
Camera look-at location in world space. |
up |
list
|
Camera up vector in world space. |
near_clip |
float
|
Near clipping plane distance. |
far_clip |
float
|
Far clipping plane distance. |
Source code in hakowan/setup/sensor.py
ThinLens
dataclass
¶
Bases: Perspective
Thin lens camera dataclass.
Attributes:
| Name | Type | Description |
|---|---|---|
aperture_radius |
float
|
Radius of the aperture in world space. |
focus_distance |
float
|
Distance to the focal plane in world space. |