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

25 lines
653 B
Text

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;
}