PanoramaRemap¶
from acron.raster import PanoramaRemap
- class PanoramaRemap¶
Bases:
Equirectangular panoramas resampled onto cube-map faces, headless and in float: the step between an HDRI as it is distributed (one 2:1 lat-long image) and what an image-based-lighting pipeline wants (six faces, the order and orientation
TexturePool.load_cube_mapuses).Face i, texel (s, t) – t growing DOWN the face – looks along 0 +X ( 1, y, -x) 1 -X (-1, y, x) 2 +Y ( x, -1, y) 3 -Y ( x, 1, -y) 4 +Z ( x, y, 1) 5 -Z (-x, y, -1) with x = -1 + 2 s / (n - 1) and y = 1 - 2 t / (n - 1), and the direction (dx, dy, dz) samples the panorama at u = atan2(dx, dy) / 2pi + 0.5 (mod 1), v = 0.5 - asin(dz) / pi, pixel (u (w - 1), v (h - 1)).
Inheritance diagram
digraph inheritance6eb7e41625 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "PanoramaRemap" [URL="acron.raster.PanoramaRemap.html#acron.raster.PanoramaRemap",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "PanoramaRemap" [arrowsize=0.75,style=""]; }- __init__()¶
- static cube_face_direction()¶
The (unnormalised) view direction of texel (s, t) of a cube face; t grows down the face.
- static equirect_to_cube_face()¶
One cube face of the panorama, face_size square, with as many channels as the source. Bilinear filtering (clamped at the panorama’s edges) unless
bilinearis false, which takes the nearest texel.