moddable post-processing pipeline

This commit is contained in:
cody glassman 2022-05-13 18:58:00 -07:00
parent e7fb8b6fd8
commit 04843fed6d
130 changed files with 8645 additions and 608 deletions

View file

@ -0,0 +1,26 @@
uniform_float uFactor {
step = 0.1;
min = 0.01;
max = 20.0;
default = 1.0;
}
fragment main {
omw_In vec2 omw_TexCoord;
void main()
{
float depth = omw_GetDepth(omw_TexCoord);
float zNear = omw.near;
float zFar = omw.far;
omw_FragColor = vec4(vec3((2.0 * zNear) / (zFar + zNear - depth * (zFar - zNear))) * uFactor, 1.0);
}
}
technique {
passes = main;
description = "Visualizes the depth buffer.";
author = "OpenMW";
version = "1.0";
}

View file

@ -0,0 +1,45 @@
main_pass {
wrap_s = clamp_to_edge;
wrap_t = clamp_to_edge;
internal_format = rgba;
source_type = unsigned_int;
source_format = rgba;
}
uniform_float uGamma {
default = 1.0;
step = 0.01;
min = 0.0;
max = 5.0;
description = "gamma level";
}
uniform_float uContrast {
default = 1.0;
step = 0.01;
min = 0.0;
max = 5.0;
description = "constrast level";
}
fragment main {
omw_In vec2 omw_TexCoord;
void main()
{
vec4 color = omw_GetLastShader(omw_TexCoord);
color.rgb = (color.rgb - vec3(0.5)) * uContrast + 0.5;
color.rgb = pow(color.rgb, vec3(1.0 / uGamma));
omw_FragColor = color;
}
}
technique {
description = "Main pass.";
version = "1.0";
author = "OpenMW";
passes = main;
hdr = false;
}