Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AACS Ray Marching

AACS Ray Marching

2fa9df92d8d7eba3e17207c86f953be3?s=128

Filippo Vitale

February 07, 2018
Tweet

Transcript

  1. February 2018 @filippovitale Ray Marching

  2. http://2017.flatmap.no/talks/vitale

  3. http://jamie-wong.com/2016/07/15/ray-marching-signed-distance-functions/ http://www.iquilezles.org/www/material/nvscene2008/rwwtt.pdf http://www.p01.org/tea_storm/ Ray Marching

  4. Signed Distance Function

  5. https://computergraphics.stackexchange.com/questions/161/what-is-ray-marching-is-sphere-tracing-the-same-thing/162

  6. public class AnimationLoop extends AnimationTimer { public AnimationLoop(Canvas c, long

    t0, double n, double u, double m) {...} private static double computeIntensity(final double x, final double y, final double s, final double t) { double intensity = 1; for (double d = intensity * 4, df = 1; .025 < df * intensity; intensity -= .025) { double X = d * x / s - d / 2; double Y = d * y / s - d / 2; double Z = d / 2 - 9; df = ???; d += df; } return intensity; } @Override public void handle(long currentNanoTime) { double t = (currentNanoTime - t0) / (500 * oneMillisecondInNanoTime); gc.clearRect(0, 0, w, h); // clear the Canvas for (int x = 0; x < n; x++) { for (int y = 0; y < n; y++) { double i = computeIntensity(x, y, n, t); gc.setGlobalAlpha(i); gc.fillOval(x * u, y * u, i * m * 1.4, i * m * 1.4); } } } }
  7. February 2018 @filippovitale $ tail -f questions

  8. February 2018 @filippovitale www.meetup.com/AnnArborFP/ Wed Feb,28 2018 $ tail -f

    questions
  9. Resources - SDF shapes - Sphere Tracing - Ray Marching

    - ShaderToy Shapes - ShaderToy 2d Vine - ShaderToy 3d Vine