Does a shader for MMF exist to allow RGB adjustment of shadows, midtones, and highlights separately? (Like the way it's done in SweetFX )
SweetFX is basically a custom d3d9.dll hook to inject post processing on DX9 - DX11 games.
Here is the LiftGammaGain.h file from SweetFX:
The shader is configured by the user editing a SweetFX_Settings text file which gets read by the custom d3d9.dll. The Lift, Gamma, Gain section looks like this:Code:/*-----------------------------------------------------------. / Lift Gamma Gain / '-----------------------------------------------------------*/ /* by 3an and CeeJay.dk Version 1.1 */ float4 LiftGammaGainPass( float4 colorInput ) { // -- Get input -- float3 color = colorInput.rgb; // -- Lift -- //color = color + (RGB_Lift / 2.0 - 0.5) * (1.0 - color); color = color * (1.5-0.5 * RGB_Lift) + 0.5 * RGB_Lift - 0.5; color = saturate(color); //isn't strictly necessary, but doesn't cost performance. // -- Gain -- color *= RGB_Gain; // -- Gamma -- colorInput.rgb = pow(color, 1.0 / RGB_Gamma); //Gamma // -- Return output -- //return (colorInput); return saturate(colorInput); }
I think it would be awesome to be able to basically color grade your game in real time to shift the mood of the entire scene, seamlessly. Doing a day to night transition would be theoretically possible.Code:/*-----------------------------------------------------------. / Lift Gamma Gain settings / '-----------------------------------------------------------*/ #define RGB_Lift float3(1.000, 1.000, 1.000) //[0.000 to 2.000] Adjust shadows for Red, Green and Blue. #define RGB_Gamma float3(1.000, 1.000, 1.000) //[0.000 to 2.000] Adjust midtones for Red, Green and Blue #define RGB_Gain float3(1.000, 1.000, 1.000) //[0.000 to 2.000] Adjust highlights for Red, Green and Blue //Note that a value of 1.000 is a neutral setting that leave the color unchanged.










Reply With Quote