Skip to content

Commit

Permalink
- Use g_sin for the SoftPoly warp effects as Graf suggested. (#1061)
Browse files Browse the repository at this point in the history
  • Loading branch information
drfrag666 committed Mar 31, 2020
1 parent cfafe65 commit cc0594d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/rendering/polyrenderer/drawers/screen_scanline_setup.cpp
Expand Up @@ -421,8 +421,8 @@ static void WriteVaryingWarp1(float posU, float posV, float stepU, float stepV,
float u = posU * w[x];
float v = posV * w[x];

v += sin(pi2 * (u + timer)) * 0.1f;
u += sin(pi2 * (v + timer)) * 0.1f;
v += g_sin(pi2 * (u + timer)) * 0.1f;
u += g_sin(pi2 * (v + timer)) * 0.1f;

u = u - std::floor(u);
v = v - std::floor(v);
Expand All @@ -448,8 +448,8 @@ static void WriteVaryingWarp2(float posU, float posV, float stepU, float stepV,
float u = posU * w[x];
float v = posV * w[x];

v += (0.5f + sin(pi2 * (v + timer * 0.61f + 900.f/8192.f)) + sin(pi2 * (u * 2.0f + timer * 0.36f + 300.0f/8192.0f))) * 0.025f;
u += (0.5f + sin(pi2 * (v + timer * 0.49f + 700.f/8192.f)) + sin(pi2 * (u * 2.0f + timer * 0.49f + 1200.0f/8192.0f))) * 0.025f;
v += (0.5f + g_sin(pi2 * (v + timer * 0.61f + 900.f/8192.f)) + g_sin(pi2 * (u * 2.0f + timer * 0.36f + 300.0f/8192.0f))) * 0.025f;
u += (0.5f + g_sin(pi2 * (v + timer * 0.49f + 700.f/8192.f)) + g_sin(pi2 * (u * 2.0f + timer * 0.49f + 1200.0f/8192.0f))) * 0.025f;

u = u - std::floor(u);
v = v - std::floor(v);
Expand Down

0 comments on commit cc0594d

Please sign in to comment.