Skip to content

raisin::ScreenSpaceRefractionSystem ​

class · #include <rayrai/PostFxRenderTargets.hpp>

Owns the opaque-color copy texture used by the screen-space refraction lookup. Reallocated automatically when the scene target size changes.

Extracted from RayraiWindow as part of the 1.1 decomposition.

Constructors & destructor ​

ScreenSpaceRefractionSystem ​

cpp
ScreenSpaceRefractionSystem() = default
cpp
ScreenSpaceRefractionSystem(const ScreenSpaceRefractionSystem &) = delete
cpp
ScreenSpaceRefractionSystem(ScreenSpaceRefractionSystem &&) = delete

~ScreenSpaceRefractionSystem ​

cpp
~ScreenSpaceRefractionSystem()

Public member functions ​

operator= ​

cpp
ScreenSpaceRefractionSystem &operator=(const ScreenSpaceRefractionSystem &) = delete
cpp
ScreenSpaceRefractionSystem &operator=(ScreenSpaceRefractionSystem &&) = delete

ensureResources ​

cpp
bool ensureResources(int width, int height)

(Re)allocate the RGBA16F color (with mips) and depth-stencil textures for this size.

Parameters

ParameterDescription
widthWidth in pixels.
heightHeight in pixels.

Returns False for a non-positive size.

capture ​

cpp
bool capture(unsigned int resolvedSceneFbo, int width, int height)

Copy a resolved scene's HDR color and depth, then build its roughness pyramid.

Parameters

ParameterDescription
resolvedSceneFboSingle-sample framebuffer to copy from.
widthCopy width.
heightCopy height.

Returns False if resolvedSceneFbo is 0 or the size is invalid.

cpp
bool capture(
    unsigned int resolvedSceneFbo,
    int width,
    int height,
    bool buildRoughnessPyramid)

Geometry tracing samples only level zero; screen-space rough glass needs the pyramid. Restores the read-framebuffer and 2D texture bindings.

Parameters

ParameterDescription
resolvedSceneFboSingle-sample framebuffer to copy from.
widthCopy width.
heightCopy height.
buildRoughnessPyramidRegenerate the color mip chain.

Returns False if resolvedSceneFbo is 0 or the size is invalid.

release ​

cpp
void release()

Delete the textures; safe to call repeatedly.

opaqueTex ​

cpp
unsigned int opaqueTex() const

Returns Copied opaque color texture (mipmapped RGBA16F), or 0.

depthTex ​

cpp
unsigned int depthTex() const

Returns Copied depth-stencil texture, or 0.

width ​

cpp
int width() const

Returns Allocated width.

height ​

cpp
int height() const

Returns Allocated height.

RaiSim — physics for robotics and AI.