1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-01 03:21:41 +00:00
OpenMW/files/data/shaders/internal_distortion.omwfx
2023-12-21 10:56:38 -08:00

26 lines
653 B
Plaintext

fragment main {
omw_In vec2 omw_TexCoord;
void main()
{
const float multiplier = 0.14;
vec2 offset = omw_Texture2D(omw_SamplerDistortion, omw_TexCoord).rg;
offset *= multiplier;
offset = clamp(offset, vec2(-1.0), vec2(1.0));
float occlusionFactor = omw_Texture2D(omw_SamplerDistortion, omw_TexCoord+offset).b;
omw_FragColor = mix(omw_GetLastShader(omw_TexCoord + offset), omw_GetLastShader(omw_TexCoord), occlusionFactor);
}
}
technique {
description = "Internal refraction shader for OpenMW";
version = "1.0";
author = "OpenMW";
passes = main;
flags = hidden;
}