15
RAYMARCHING AN INFINITE CITY Alice Yang CIS 565 Final Project

Raymarching an Infinite City

  • Upload
    sven

  • View
    110

  • Download
    0

Embed Size (px)

DESCRIPTION

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. - PowerPoint PPT Presentation

Citation preview

Page 1: Raymarching an Infinite City

RAYMARCHING AN INFINITE CITY

Alice YangCIS 565 Final Project

Page 2: 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.

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/

Page 3: Raymarching an Infinite City

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

Page 4: Raymarching an Infinite City

Domain Repetition

Source: http://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm /

Page 5: Raymarching an Infinite City
Page 6: Raymarching an Infinite City

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

Page 7: Raymarching an Infinite City
Page 8: Raymarching an Infinite City

Building Geometry Union operation: Add roofs and attics to

tops of buildings Subtraction operation: Windows and

wall indents

Page 9: Raymarching an Infinite City

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 /

Page 10: Raymarching an Infinite City
Page 11: Raymarching an Infinite City

Textures Mostly flat colors since project focuses

on geometry Half of the city samples from procedural

brick texture.

Page 12: Raymarching an Infinite City

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

Page 13: Raymarching an Infinite City
Page 14: Raymarching an Infinite City
Page 15: Raymarching an Infinite City

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