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
ScreenSpaceRefractionSystem() = defaultScreenSpaceRefractionSystem(const ScreenSpaceRefractionSystem &) = deleteScreenSpaceRefractionSystem(ScreenSpaceRefractionSystem &&) = delete~ScreenSpaceRefractionSystem
~ScreenSpaceRefractionSystem()Public member functions
operator=
ScreenSpaceRefractionSystem &operator=(const ScreenSpaceRefractionSystem &) = deleteScreenSpaceRefractionSystem &operator=(ScreenSpaceRefractionSystem &&) = deleteensureResources
bool ensureResources(int width, int height)(Re)allocate the RGBA16F color (with mips) and depth-stencil textures for this size.
Parameters
| Parameter | Description |
|---|---|
width | Width in pixels. |
height | Height in pixels. |
Returns False for a non-positive size.
capture
bool capture(unsigned int resolvedSceneFbo, int width, int height)Copy a resolved scene's HDR color and depth, then build its roughness pyramid.
Parameters
| Parameter | Description |
|---|---|
resolvedSceneFbo | Single-sample framebuffer to copy from. |
width | Copy width. |
height | Copy height. |
Returns False if resolvedSceneFbo is 0 or the size is invalid.
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
| Parameter | Description |
|---|---|
resolvedSceneFbo | Single-sample framebuffer to copy from. |
width | Copy width. |
height | Copy height. |
buildRoughnessPyramid | Regenerate the color mip chain. |
Returns False if resolvedSceneFbo is 0 or the size is invalid.
release
void release()Delete the textures; safe to call repeatedly.
opaqueTex
unsigned int opaqueTex() constReturns Copied opaque color texture (mipmapped RGBA16F), or 0.
depthTex
unsigned int depthTex() constReturns Copied depth-stencil texture, or 0.
width
int width() constReturns Allocated width.
height
int height() constReturns Allocated height.