Skip to content

Latest commit

 

History

History
64 lines (37 loc) · 1.59 KB

README.md

File metadata and controls

64 lines (37 loc) · 1.59 KB

WebGL Ray Marcher

Created WebGL fragment shaders that utilize raymarching and signed distance functions. To create the fragment shaders, I generated a mesh that maps to the canonical screen space coordinates of the viewport. I have created four different fragment shaders for the program.

Spheres.glsl

Spheres

CubeSphereIntersect.glsl

Cube Sphere Intersection

GrayScaleMandelbulb.glsl

Grey Mandelbulb

PurpleGlowMandelbulb.glsl

Purple Mandelbulb

How To Run Project

The best way to run the project is by using a local HTTP server. The steps to run this project will use Python's local web server package.

Navigate to the directory where the project has been cloned. Then, run the following python command:

python3 -m http.server

Once the server is running locally, connect to it via the proper port number:

localhost:<port number>

How To Change Active Shader

To change out the active fragment shader, modify the line below in the index.html file:

<script id="fragShader" type="x-shader/x-fragment" src=<desired fragment shader> ></script>

Replace <desired fragment shader> with one of the specified fragment shaders above. For example:

<script id="fragShader" type="x-shader/x-fragment" src="Spheres.glsl" ></script>