Ported MariENB tonemappers.
This commit is contained in:
parent
e8b7b1c29f
commit
f7c175d1bb
9 changed files with 187 additions and 4 deletions
18
shaders/glsl/mfx_tonemap_hejldawson.fp
Normal file
18
shaders/glsl/mfx_tonemap_hejldawson.fp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
Hejl Dawson tonemap from MariENB
|
||||
People claim this one looks realistic???
|
||||
(C)2012-2023 Marisa the Magician
|
||||
*/
|
||||
vec3 TonemapHejlDawson( vec3 res )
|
||||
{
|
||||
vec3 x = max(vec3(0.),res-.004);
|
||||
return (x*(6.2*x+.5))/(x*(6.2*x+1.7)+.06);
|
||||
}
|
||||
void main()
|
||||
{
|
||||
vec2 coord = TexCoord;
|
||||
vec4 res = texture(InputTexture,coord);
|
||||
vec3 mapped = TonemapHejlDawson(pow(max(res.rgb*texposure,0.),vec3(2.2)));
|
||||
res.rgb = mix(res.rgb,mapped,tblend);
|
||||
FragColor = res;
|
||||
}
|
||||
17
shaders/glsl/mfx_tonemap_reinhard.fp
Normal file
17
shaders/glsl/mfx_tonemap_reinhard.fp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
"Ugly old" Reinhard tonemap from MariENB
|
||||
(C)2012-2023 Marisa the Magician
|
||||
*/
|
||||
vec3 TonemapReinhard( vec3 res )
|
||||
{
|
||||
vec3 tcol = res/(1.+res);
|
||||
return pow(tcol,vec3(1./2.2));
|
||||
}
|
||||
void main()
|
||||
{
|
||||
vec2 coord = TexCoord;
|
||||
vec4 res = texture(InputTexture,coord);
|
||||
vec3 mapped = TonemapReinhard(pow(max(res.rgb*texposure,vec3(0.)),vec3(2.2)));
|
||||
res.rgb = mix(res.rgb,mapped,tblend);
|
||||
FragColor = res;
|
||||
}
|
||||
24
shaders/glsl/mfx_tonemap_uc2.fp
Normal file
24
shaders/glsl/mfx_tonemap_uc2.fp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
"Uncharted 2" tonemap from MariENB
|
||||
(C)2012-2023 Marisa the Magician
|
||||
*/
|
||||
vec3 Uch( vec3 res )
|
||||
{
|
||||
// I have no idea how this works
|
||||
return ((res*(unA*res+unC*unB)+unD*unE)/(res*(unA*res+unB)+unD*unF))-unE/unF;
|
||||
}
|
||||
vec3 TonemapUC2( vec3 res )
|
||||
{
|
||||
vec3 ucol = Uch(res);
|
||||
vec3 uwhite = Uch(vec3(unW));
|
||||
return pow(max(ucol/uwhite,0.),vec3(1./2.2));
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 coord = TexCoord;
|
||||
vec4 res = texture(InputTexture,coord);
|
||||
vec3 mapped = TonemapUC2(pow(max(res.rgb*texposure,0.),vec3(2.2)));
|
||||
res.rgb = mix(res.rgb,mapped,tblend);
|
||||
FragColor = res;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue