Ported MariENB tonemappers.

This commit is contained in:
Marisa the Magician 2023-09-04 23:43:11 +02:00
commit f7c175d1bb
9 changed files with 187 additions and 4 deletions

View file

@ -65,6 +65,43 @@ Class MariFXHandler : StaticEventHandler
Shader.SetEnabled(p,"mfx_dirt",mfx_dirtenable);
Shader.SetUniform1f(p,"mfx_dirt","dirtmc",mfx_dirtmc);
Shader.SetUniform1f(p,"mfx_dirt","dirtcfactor",mfx_dirtcfactor);
// TONEMAP
switch ( mfx_tenable )
{
case 1:
Shader.SetEnabled(p,"mfx_tonemap_reinhard",true);
Shader.SetEnabled(p,"mfx_tonemap_uc2",false);
Shader.SetEnabled(p,"mfx_tonemap_hejldawson",false);
Shader.SetUniform1f(p,"mfx_tonemap_reinhard","texposure",mfx_texposure);
Shader.SetUniform1f(p,"mfx_tonemap_reinhard","tblend",mfx_tblend);
break;
case 2:
Shader.SetEnabled(p,"mfx_tonemap_reinhard",false);
Shader.SetEnabled(p,"mfx_tonemap_uc2",true);
Shader.SetEnabled(p,"mfx_tonemap_hejldawson",false);
Shader.SetUniform1f(p,"mfx_tonemap_uc2","texposure",mfx_texposure);
Shader.SetUniform1f(p,"mfx_tonemap_uc2","tblend",mfx_tblend);
Shader.SetUniform1f(p,"mfx_tonemap_uc2","unA",mfx_una);
Shader.SetUniform1f(p,"mfx_tonemap_uc2","unB",mfx_unb);
Shader.SetUniform1f(p,"mfx_tonemap_uc2","unC",mfx_unc);
Shader.SetUniform1f(p,"mfx_tonemap_uc2","unD",mfx_und);
Shader.SetUniform1f(p,"mfx_tonemap_uc2","unE",mfx_une);
Shader.SetUniform1f(p,"mfx_tonemap_uc2","unF",mfx_unf);
Shader.SetUniform1f(p,"mfx_tonemap_uc2","unW",mfx_unw);
break;
case 3:
Shader.SetEnabled(p,"mfx_tonemap_reinhard",false);
Shader.SetEnabled(p,"mfx_tonemap_uc2",false);
Shader.SetEnabled(p,"mfx_tonemap_hejldawson",true);
Shader.SetUniform1f(p,"mfx_tonemap_hejldawson","texposure",mfx_texposure);
Shader.SetUniform1f(p,"mfx_tonemap_hejldawson","tblend",mfx_tblend);
break;
default:
Shader.SetEnabled(p,"mfx_tonemap_reinhard",false);
Shader.SetEnabled(p,"mfx_tonemap_uc2",false);
Shader.SetEnabled(p,"mfx_tonemap_hejldawson",false);
break;
}
// COLOR GRADING
Shader.SetEnabled(p,"mfx_grading",mfx_gradeenable);
Shader.SetUniform3f(p,"mfx_grading","grademul",(mfx_grademul_r,mfx_grademul_g,mfx_grademul_b));
@ -389,6 +426,18 @@ Class MariFXHandler : StaticEventHandler
case 11:
CVar.FindCVar('mfx_paintenable').ResetToDefault();
break;
case 12:
CVar.FindCVar('mfx_tenable').ResetToDefault();
CVar.FindCVar('mfx_texposure').ResetToDefault();
CVar.FindCVar('mfx_tblend').ResetToDefault();
CVar.FindCVar('mfx_una').ResetToDefault();
CVar.FindCVar('mfx_unb').ResetToDefault();
CVar.FindCVar('mfx_unc').ResetToDefault();
CVar.FindCVar('mfx_und').ResetToDefault();
CVar.FindCVar('mfx_une').ResetToDefault();
CVar.FindCVar('mfx_unf').ResetToDefault();
CVar.FindCVar('mfx_unw').ResetToDefault();
break;
}
}
}