mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Update to turbulence PostFX to improve the visual effect of being underwater.
This commit is contained in:
parent
c75d6feb20
commit
8476242bdf
4 changed files with 38 additions and 38 deletions
|
|
@ -26,20 +26,10 @@ uniform float accumTime;
|
|||
|
||||
float4 main( PFXVertToPix IN, uniform sampler2D inputTex : register(S0) ) : COLOR
|
||||
{
|
||||
float reduction = 128;
|
||||
float power = 1.0;
|
||||
float speed = 3.0;
|
||||
float frequency=8;
|
||||
float speed = 2.0;
|
||||
float distortion = 6.0;
|
||||
|
||||
float backbuffer_edge_coef=0.98;
|
||||
float2 screen_center = float2(0.5, 0.5);
|
||||
float2 cPos = (IN.uv0 - screen_center);
|
||||
|
||||
float len = 1.0 - length(cPos);
|
||||
float2 uv = clamp((cPos / len * cos(len * frequency - (accumTime * speed)) * (power / reduction)), 0, 1);
|
||||
return tex2D(inputTex, IN.uv0 * backbuffer_edge_coef + uv);
|
||||
|
||||
// float4 color = tex2D(inputTex, IN.uv0 * backbuffer_edge_coef+(sin*right));
|
||||
// return color;
|
||||
|
||||
}
|
||||
float y = IN.uv0.y + (cos(IN.uv0.y * distortion + accumTime * speed) * 0.01);
|
||||
float x = IN.uv0.x + (sin(IN.uv0.x * distortion + accumTime * speed) * 0.01);
|
||||
return tex2D (inputTex, float2(x, y));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue