mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
26 lines
653 B
Plaintext
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;
|
||
|
}
|