You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw/files/data/shaders/debug.omwfx

46 lines
1.1 KiB
Plaintext

uniform_bool uDisplayDepth {
header = "#{OMWShaders:DebugHeaderDepth}";
default = true;
display_name = "#{OMWShaders:DisplayDepthName}";
}
uniform_float uDepthFactor {
step = 0.1;
min = 0.01;
max = 20.0;
default = 1.0;
display_name = "#{OMWShaders:DisplayDepthFactorName}";
description = "#{OMWShaders:DisplayDepthFactorDescription}";
}
uniform_bool uDisplayNormals {
header = "#{OMWShaders:DebugHeaderNormals}";
default = true;
display_name = "#{OMWShaders:DisplayNormalsName}";
}
fragment main {
omw_In vec2 omw_TexCoord;
void main()
{
omw_FragColor = omw_GetLastShader(omw_TexCoord);
if (uDisplayDepth)
omw_FragColor = vec4(vec3(omw_GetLinearDepth(omw_TexCoord) / omw.far * uDepthFactor), 1.0);
#if OMW_NORMALS
if (uDisplayNormals && (!uDisplayDepth || omw_TexCoord.x < 0.5))
omw_FragColor.rgb = omw_GetNormals(omw_TexCoord) * 0.5 + 0.5;
#endif
}
}
technique {
passes = main;
description = "#{OMWShaders:DebugDescription}";
author = "OpenMW";
version = "1.0";
pass_normals = true;
}