raisin::PbrEnvironment
struct · #include <rayrai/PbrEnvironment.hpp>
Image-based lighting environment bundle.
Groups the four GL handles that together drive split-sum image-based lighting — display/radiance cubemap, diffuse irradiance cubemap, roughness-prefiltered specular cubemap, split-sum BRDF LUT — plus the mip count of the prefiltered cubemap and an overall strength scalar. Prefer this struct over passing the four handles individually.
Build one with PbrEnvironment::loadFromHdrFile(path) (factory defined in RayraiWindow.hpp so the static IBL loaders are visible) and pass it to Visuals::setPbrEnvironment(env).
Nested classes
structLoadOptions — Options accepted by loadFromHdrFile().
Public member functions
isComplete
bool isComplete() constReturns True when all four texture handles are non-zero.
Static member functions
loadFromHdrFile static
static PbrEnvironment loadFromHdrFile(const std::string &hdrPath)Build a complete PbrEnvironment from a single Radiance .hdr file.
Loads the equirectangular cubemap, integrates the diffuse irradiance, computes the GGX-prefiltered specular cubemap, and creates the split-sum BRDF LUT. All four handles are owned by the active GL context and remain valid for the lifetime of that context.
Each handle that fails to build (for example because the file cannot be read) is 0, and isComplete() then returns false. Handles that did build, such as the file-independent BRDF LUT, are still returned.
Defined inline in RayraiWindow.hpp so the static cubemap creators are visible.
Parameters
| Parameter | Description |
|---|---|
hdrPath | Path to the equirectangular Radiance .hdr file. |
Returns The baked environment; check isComplete() before use.
static PbrEnvironment loadFromHdrFile(
const std::string &hdrPath,
const LoadOptions &opts)Build a complete PbrEnvironment from a single Radiance .hdr file.
Loads the equirectangular cubemap, integrates the diffuse irradiance, computes the GGX-prefiltered specular cubemap, and creates the split-sum BRDF LUT. All four handles are owned by the active GL context and remain valid for the lifetime of that context.
Each handle that fails to build (for example because the file cannot be read) is 0, and isComplete() then returns false. Handles that did build, such as the file-independent BRDF LUT, are still returned.
Defined inline in RayraiWindow.hpp so the static cubemap creators are visible.
Parameters
| Parameter | Description |
|---|---|
hdrPath | Path to the equirectangular Radiance .hdr file. |
Returns The baked environment; check isComplete() before use.
Parameters
| Parameter | Description |
|---|---|
opts | Face sizes, sample counts and strength used for the bake. |
Public attributes
environmentCubemap
unsigned int environmentCubemapDisplay/radiance cubemap (sky).
irradianceCubemap
unsigned int irradianceCubemapDiffuse irradiance cubemap.
prefilteredCubemap
unsigned int prefilteredCubemapRoughness-prefiltered specular cubemap; mip 0 sharp.
splitSumBrdfLut
unsigned int splitSumBrdfLutSplit-sum BRDF lookup texture (2D).
prefilteredMipCount
int prefilteredMipCountMip count baked into prefilteredCubemap.
strength
float strengthOverall IBL contribution scale.
boxProjection
bool boxProjectionOptional box-projected parallax-corrected reflection bounds.
probePosition
glm::vec3 probePositionWorld-space capture position of the cubemap, metres.
boxMin
glm::vec3 boxMinWorld-space minimum corner of the projection box, metres.
boxMax
glm::vec3 boxMaxWorld-space maximum corner of the projection box, metres.