User Tag List

Results 1 to 3 of 3

Thread: [REQUEST] Sonic Fade Shader request

  1. #1
    Clicker Fusion 2.5 Developer
    SHINGEN's Avatar
    Join Date
    Apr 2015
    Location
    England
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy [REQUEST] Sonic Fade Shader request

    I am using the SonicFade shader by Looki which is really useful for my game but now I need a second one that fades to white rather than black. I need it to transition levels to bonus levels like in the original Sonic games.
    I know this has been requested by elvisish but I don't think there was ever a solution.
    Below is the code, I believe white is transparant and black isn't i wanted to swap it over but I don't know how to do it. Can someone please help me?

    Code:
    sampler2D Texture0;
    float time;
    float4 a, b;
    
    float STEP = 1/3.0;
    
    float4 ps_main(float2 In : TEXCOORD0) : COLOR0
    { 
    	//Source color
    	float4 ret = tex2D(Texture0, In);
    	float3 fade = 1;
    
    	//Step A: black to A
    	if(time < STEP)
    	{
    		fade *= a.rgb * (time/STEP);
    	}
    	//Step B: A to B
    	else if(time >= STEP && time <= 2*STEP)
    	{
    		fade = lerp(a.rgb, b.rgb, (time-STEP)/STEP);
    	}
    	//Step C: B to white
    	else if(time < 1)
    	{
    		fade = 1 - (1-b)*((1-time)/STEP);
    	}
    
    	//Apply fade
    	ret.rgb *= fade;
    	return ret;
    }
    
    technique Shader { pass P0 { PixelShader = compile ps_2_0 ps_main(); } }

  2. #2
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    652
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Yeah, @fnkycoldmadeanr helped me with this:SonicFadeWhite.zip - it's slightly different now in that the amount is the opposite end of the time slider; I've included an example mfa that shows it flashing in and flashing out if you press F.

    Unfortunately, I have no idea how to convert it to DX11, I'm afraid! Eventually I'll probably just take the SonicFade regular hlsl and fxc and just mod in the differences.

  3. #3
    Clicker Fusion 2.5 Developer
    SHINGEN's Avatar
    Join Date
    Apr 2015
    Location
    England
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice one this is exactly what Im after thanks

Similar Threads

  1. [REQUEST] 3D LUT Shader
    By TreyM in forum Shader Development
    Replies: 24
    Last Post: 21st September 2019, 05:04 PM
  2. Zoom Pixel Shader (Request)
    By Solgryn in forum Shader Development
    Replies: 1
    Last Post: 31st August 2012, 12:46 PM
  3. Matrix transform shader [request]!
    By Saml in forum Shader Development
    Replies: 3
    Last Post: 12th June 2010, 04:17 AM
  4. [REQUEST] Some Shader Effects
    By Game_Master in forum Hardware Accelerated Runtime
    Replies: 3
    Last Post: 13th July 2009, 02:12 PM
  5. Pixel shader request.
    By Nifflas in forum Hardware Accelerated Runtime
    Replies: 5
    Last Post: 8th May 2008, 11:50 AM

Posting Permissions

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