Uploaded September 2023 | Updated September 2026, 3 weeks ago
This week we have a quick look at why small values of Refraction clip and how we can make a simple, non-destructive, edit to the shader file to fix this.
//clip if the distortion distance (squared) is too small to be noticed
//this will result in a less expensive apply pass since the clipped pixels won't set stencil to pass
if (TryToClip)
{
#if OVERRIDE_DISTORTION_CLIP
clip(dot(BufferUVDistortion, BufferUVDistortion) - .00000001);
#else
clip(dot(BufferUVDistortion, BufferUVDistortion) - .001);
#endif
}
If you have any questions about Game Art VFX or the Unreal Engine then email me: tharlevfx@gmail.com
Check out my longer tutorials available on Gumroad: tharlevfx.gumroad.com
Or you can find more of my work on my website: tharlevfx.com
or check out my work on the Unreal Marketplace:
unrealengine.com/marketplace/profile/tharlevfx
or follow me on Twitter: @tharlevfx
If you'd like to support the channel then follow me on Patreon: patreon.com/tharlevfx
This week we have a quick look at why small values of Refraction clip and how we can make a simple, non-destructive, edit to the shader file to fix this.
//clip if the distortion distance (squared) is too small to be noticed
//this will result in a less expensive apply pass since the clipped pixels won't set stencil to pass
if (TryToClip)
{
#if OVERRIDE_DISTORTION_CLIP
clip(dot(BufferUVDistortion, BufferUVDistortion) - .00000001);
#else
clip(dot(BufferUVDistortion, BufferUVDistortion) - .001);
#endif
}
If you have any questions about Game Art VFX or the Unreal Engine then email me: tharlevfx@gmail.com
Check out my longer tutorials available on Gumroad: tharlevfx.gumroad.com
Or you can find more of my work on my website: tharlevfx.com
or check out my work on the Unreal Marketplace:
unrealengine.com/marketplace/profile/tharlevfx
or follow me on Twitter: @tharlevfx
If you'd like to support the channel then follow me on Patreon: patreon.com/tharlevfx










