mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-09 12:07:51 +03:00
moddable post-processing pipeline
This commit is contained in:
parent
e7fb8b6fd8
commit
04843fed6d
130 changed files with 8645 additions and 608 deletions
26
files/vfs/shaders/displaydepth.omwfx
Normal file
26
files/vfs/shaders/displaydepth.omwfx
Normal 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";
|
||||
}
|
45
files/vfs/shaders/main.omwfx
Normal file
45
files/vfs/shaders/main.omwfx
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue