Presentation is loading. Please wait.

Presentation is loading. Please wait.

Alice Yang CIS 565 Final Project. Ray Marching/Sphere Tracing  Starting from eye, proceed in small steps along ray.  Distance Estimator tells you how.

Similar presentations


Presentation on theme: "Alice Yang CIS 565 Final Project. Ray Marching/Sphere Tracing  Starting from eye, proceed in small steps along ray.  Distance Estimator tells you how."— Presentation transcript:

1 Alice Yang CIS 565 Final Project

2 Ray Marching/Sphere Tracing  Starting from eye, proceed in small steps along ray.  Distance Estimator tells you how close you are to object.  When you are close to a certain threshold, stop.  Coloring by number of steps taken gives us cheap AO with no need for lights. Source: http://blog.hvidtfeldts.net/index.php/2011/06/distance-estimated-3d-fractals-part-i/http://blog.hvidtfeldts.net/index.php/2011/06/distance-estimated-3d-fractals-part-i/

3 Framework  The entire project is contained in a fragment shader written in GLSL  Code can be viewed and run on GLSL Sandbox (http://glsl.heroku.com/e#2306.2)http://glsl.heroku.com/e#2306.2  Project built off of Paulo Falcao’s basic raymarch framework, extended to support a number of additional features

4 Domain Repetition Source: http://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm / http://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm /

5

6 Building Variation  Find “seed” constant for every building as input into random float generator  vec2 pos = vec2(ceil(p.x/c.x), ceil(p.z/c.z));

7

8 Building Geometry  Union operation: Add roofs and attics to tops of buildings  Subtraction operation: Windows and wall indents

9 Building Geometry: Windows  Create 2D cross and repeatedly subtract from building bodies  Insert inner structure to prevent building from looking hollow  “free” variation from random heights applied afterwards Source: http://www.iquilezles.org/www/articles/menger/menger.htm / http://www.iquilezles.org/www/articles/menger/menger.htm /

10

11 Textures  Mostly flat colors since project focuses on geometry  Half of the city samples from procedural brick texture.

12  Constant values for brick and mortar color as well as brick size and brick percentage  After position is calculated, every other row is offset by half a brick’s width  Step function: If the fract(position) is less than brick percentage, use brick color. Otherwise use mortar color

13

14

15 Live Demo  http://glsl.heroku.com/e#2306.2 http://glsl.heroku.com/e#2306.2


Download ppt "Alice Yang CIS 565 Final Project. Ray Marching/Sphere Tracing  Starting from eye, proceed in small steps along ray.  Distance Estimator tells you how."

Similar presentations


Ads by Google