### Fizzle Fade Improved

#### Fizzle Fade Improved

Steve_Yorkshire
Posts: 208
Joined: Tue Feb 03, 2015 10:30 pm

I always thought that the stock fizzle fade looked a bit like venetian blinds opening across one plane - so I added another plane!

At the bottom of shaders/common/torque.hlsl:

/// Called from the visibility feature to do screen/// door transparency for fading of objects.void fizzle(float2 vpos, float visibility){   // NOTE: The magic values below are what give us   // the nice even pattern during the fizzle.   //   // These values can be changed to get different   // patterns... some better than others.   //   // Horizontal Blinds - { vpos.x, 0.916, vpos.y, 0 }   // Vertical Lines - { vpos.x, 12.9898, vpos.y, 78.233 }   //   // I'm sure there are many more patterns here to   // discover for different effects.      //yorks old fizzle out   //float2x2 m = { vpos.x, 0.916, vpos.y, 0.350 };   //clip( visibility - frac( determinant( m ) ) );      //yorks new fizzle in    float2x2 m = { vpos.x, 0.916, vpos.y, 0.350 };    float2x2 n = { vpos.x, 0.350, vpos.y, 0.916 };    clip( visibility - frac( determinant( m ) ) );    clip( visibility - frac( determinant( n ) ) );}  #endif // _TORQUE_HLSL_

All this does is make it fizzle on both x and y planes equally. And remember, translucent materials do proper alpha fading without this fizzle effect.
Fizzle on dudes!

#### Re: Fizzle Fade Improved

Steve_Yorkshire
Posts: 208
Joined: Tue Feb 03, 2015 10:30 pm

Obviously this is dx only (I've not done any messing around with openGL) so if someone else wants to fiddle with shaders/common/gl/torque.glsl feel free to knock yourself out. Having a quick look it has some comments about creating patterns.

/// Called from the visibility feature to do screen/// door transparency for fading of objects.void fizzle(vec2 vpos, float visibility){   // NOTE: The magic values below are what give us    // the nice even pattern during the fizzle.   //   // These values can be changed to get different    // patterns... some better than others.   //   // Horizontal Blinds - { vpos.x, 0.916, vpos.y, 0 }   // Vertical Lines - { vpos.x, 12.9898, vpos.y, 78.233 }   //   // I'm sure there are many more patterns here to    // discover for different effects.      mat2x2 m = mat2x2( vpos.x, vpos.y, 0.916, 0.350 );   if( (visibility - fract( determinant( m ) )) < 0 ) //if(a < 0) discard;      discard;}#endif //TORQUE_PIXEL_SHADER

#### Re: Fizzle Fade Improved

Duion
Posts: 845
Joined: Sun Feb 08, 2015 1:51 am

It is not the end of the file for me, are you running an older version?
Better say directly what to replace and not just "at the bottom"

Hm I tried it out and something has changed on the fading, but hard to tell if it is better or not. Would need some direct comparisons.

#### Who is online

Users browsing this forum: No registered users and 1 guest