1 / 15

Raymarching an Infinite City

Alice Yang CIS 565 Final Project. Raymarching an Infinite City. 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.

sven
Download Presentation

Raymarching an Infinite City

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Alice Yang CIS 565 Final Project Raymarching an Infinite City

  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/

  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) • 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 /

  5. 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));

  6. Building Geometry • Union operation: Add roofs and attics to tops of buildings • Subtraction operation: Windows and wall indents

  7. 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 /

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

  9. 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

  10. Live Demo • http://glsl.heroku.com/e#2306.2

More Related