1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 08:45:39 +00:00
openmw/files/data/shaders/debug.omwfx

46 lines
1.1 KiB
Text
Raw Normal View History

uniform_bool uDisplayDepth {
2022-12-22 17:53:49 +00:00
header = "#{OMWShaders:DebugHeaderDepth}";
default = true;
2022-12-22 17:53:49 +00:00
display_name = "#{OMWShaders:DisplayDepthName}";
}
uniform_float uDepthFactor {
step = 0.1;
min = 0.01;
max = 20.0;
default = 1.0;
2022-12-22 17:53:49 +00:00
display_name = "#{OMWShaders:DisplayDepthFactorName}";
description = "#{OMWShaders:DisplayDepthFactorDescription}";
}
uniform_bool uDisplayNormals {
2022-12-22 17:53:49 +00:00
header = "#{OMWShaders:DebugHeaderNormals}";
default = true;
2022-12-22 17:53:49 +00:00
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);
#endif
}
}
technique {
passes = main;
2022-12-22 17:53:49 +00:00
description = "#{OMWShaders:DebugDescription}";
author = "OpenMW";
version = "1.0";
pass_normals = true;
}