EPOK RUNTIME
Sky Gradient
sky_gradient.hpp · the sky gradient module
Declarations are extracted from the pinned headers. Examples and general guidance are generated sketches, not verified complete programs; consult the linked source and guides for the actual contract.
Module
the sky gradient module.
Include this module
C++ include
#include "sky_gradient.hpp"Types
Functions and methods
drawReturns false when the camera cannot be resolved; the caller then clears with the flat sky colour instead.Function templateelevationSine of the ray's elevation, Q12.MethodlevelPerforms `level` as part of the sky gradient module.Methodsky_gradient_colorPerforms `sky gradient color` as part of the sky gradient module.Functionsky_gradient_mixPerforms `sky gradient mix` as part of the sky gradient module.Functionsky_gradient_viewbasis: camera-from-world rotation (Q12 rows).Function templateFields, variables and values
centre_xExposes `centre_x` on `epok::SkyGradientView` for the sky gradient module.Fieldcentre_yExposes `centre_y` on `epok::SkyGradientView` for the sky gradient module.FieldgroundExposes `ground` on `epok::SkyGradientColors` for the sky gradient module.FieldhorizonExposes `horizon` on `epok::SkyGradientColors` for the sky gradient module.Fieldray_xRay through screen offset (a,b) from the centre, scaled down by 256: (a*ray_x, -b*ray_y, ray_z) where ray_x carries the mirror sign.Fieldray_yRay through screen offset (a,b) from the centre, scaled down by 256: (a*ray_x, -b*ray_y, ray_z) where ray_x carries the mirror sign.Fieldray_zRay through screen offset (a,b) from the centre, scaled down by 256: (a*ray_x, -b*ray_y, ray_z) where ray_x carries the mirror sign.FieldskyExposes `sky` on `epok::SkyGradientColors` for the sky gradient module.Fieldsky_gradient_down_bandExposes `sky_gradient_down_band` on the `epok` namespace for the sky gradient module.Variablesky_gradient_up_bandThe sky colour is reached about 45 degrees above the horizon (sin 0.7) and the ground colour about 15 degrees below it (sin 0.25).VariableupWorld up in camera space, normalised to Q12 (camera +Z forward, +Y up).Field