User Tag List

Results 1 to 2 of 2

Thread: Lift, Gamma, Gain Shader?

  1. #1
    Clicker Fusion 2.5Install Creator Pro
    Fusion 2.5 (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    TreyM's Avatar
    Join Date
    Apr 2011
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lift, Gamma, Gain Shader?

    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:

    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);
    }
    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 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.
    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.

  2. #2
    Clicker Fusion 2.5Install Creator Pro
    Fusion 2.5 (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    TreyM's Avatar
    Join Date
    Apr 2011
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bumping and requesting that post post be moved to the correct section.

Similar Threads

  1. curve maths (depreciating gain) and custom timer
    By SolarB in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 9th November 2012, 01:44 AM
  2. Lift movement help needed please.
    By Worf in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 12th May 2010, 01:38 PM
  3. grav lift
    By jhonson in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 5th December 2008, 12:30 PM
  4. [Request] Gamma Extension
    By CBSection31 in forum Extension Development
    Replies: 5
    Last Post: 24th April 2007, 04:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •