contrast and gamma post-processing effect added
initial values are set to approximate vanillamoveref
parent
49e2b14d05
commit
cee72d021d
@ -0,0 +1,24 @@
|
||||
compositor brightness_contrast_gamma
|
||||
{
|
||||
technique
|
||||
{
|
||||
// render scene into texture
|
||||
texture SceneBuffer target_width target_height PF_A8R8G8B8
|
||||
|
||||
target SceneBuffer
|
||||
{
|
||||
input previous
|
||||
}
|
||||
|
||||
target_output
|
||||
{
|
||||
input none
|
||||
|
||||
pass render_quad
|
||||
{
|
||||
material mat_brightness_contrast_gamma
|
||||
input 0 SceneBuffer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
material mat_brightness_contrast_gamma
|
||||
{
|
||||
pass
|
||||
{
|
||||
vertex_program transform_vertex
|
||||
fragment_program openmw_brightness_contrast_gamma_fragment
|
||||
|
||||
depth_check off
|
||||
|
||||
texture_unit SceneBuffer
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
#include "core.h"
|
||||
|
||||
#ifdef SH_FRAGMENT_SHADER
|
||||
|
||||
SH_BEGIN_PROGRAM
|
||||
shInput(float2, UV)
|
||||
shSampler2D(SceneBuffer)
|
||||
shUniform(float2, contrast_invGamma) @shSharedParameter(contrast_invGamma)
|
||||
SH_START_PROGRAM
|
||||
{
|
||||
shOutputColour(0) = shSample(SceneBuffer, UV);
|
||||
|
||||
// contrast
|
||||
shOutputColour(0).xyz = (shOutputColour(0).xyz - float3(0.5,0.5,0.5)) * contrast_invGamma.x + float3(0.5,0.5,0.5);
|
||||
shOutputColour(0).xyz = shSaturate(shOutputColour(0).xyz);
|
||||
// gamma
|
||||
shOutputColour(0).xyz = pow(shOutputColour(0).xyz, contrast_invGamma.yyy);
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,7 @@
|
||||
shader_set openmw_brightness_contrast_gamma_fragment
|
||||
{
|
||||
source brightness_contrast_gamma.shader
|
||||
type fragment
|
||||
profiles_cg ps_2_x ps_2_0 ps fp40 arbfp1
|
||||
profiles_hlsl ps_2_0
|
||||
}
|
Loading…
Reference in New Issue