Shaders that support ScreenRefractivity
- Last UpdatedJan 24, 2023
- 1 minute read
The following shaders support full-screen refractions using the fRefractivity parameter.
The refraction texture is generated automatically by the engine; this texture is unique for the whole scene and is generated by the back-buffer data.
Possible issues
This technique brings with it some more or less evident defects:
-
Reflective polygons are always drawn at the end of the pipeline, so they can cause sorting problems with transparent objects.
-
The refraction texture is calculated only once. Therefore, two or more refractive polygons should not overlap, because the back polygon would not be considered as refraction from the front polygon.
-
Using DOF and HDR, the refraction texture has neither DOF nor HDR, while the polygons refract.
-
Refractions are not supported when rendering CubeMap, RenderToTexture, or DoubleBSP.