Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Banana! #3

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
099103a
+ Base raymarching code with primitives.
mmerchante Feb 26, 2017
49afff9
+ Basic diffuse shading with shadows, plus gamma correction and some …
mmerchante Feb 26, 2017
a459cef
+ Build files
mmerchante Feb 26, 2017
965e4f7
+ Soft shadows with some nice distance fallof
mmerchante Feb 28, 2017
fd792c3
+ Torus, cylinder
mmerchante Feb 28, 2017
13925a8
+ Some translation animation
mmerchante Feb 28, 2017
6c16f1f
+ Implemented ambient occlusion estimation as in the paper "Fast Appr…
mmerchante Feb 28, 2017
5f9e4b1
* Arbitrary transformations
mmerchante Feb 28, 2017
8cd0c2e
+ Added repetition for base scene
mmerchante Feb 28, 2017
339dfe5
+ Banana?
mmerchante Mar 1, 2017
e9f0875
+ Bbbbanana?
mmerchante Mar 1, 2017
adef6e1
+ Papple?
mmerchante Mar 1, 2017
ea82545
+ Banana!
mmerchante Mar 1, 2017
549ba14
* Fix
mmerchante Mar 1, 2017
7dfac2b
* Build
mmerchante Mar 1, 2017
00a305e
* Fix
mmerchante Mar 1, 2017
898cbc5
* Moving textures...
mmerchante Mar 1, 2017
515cbb3
* Build
mmerchante Mar 1, 2017
a714050
* Removed textures
mmerchante Mar 1, 2017
48a3d55
* build
mmerchante Mar 1, 2017
5235812
Update README.md
mmerchante Mar 25, 2017
7d3dcef
Update README.md
mmerchante Mar 25, 2017
eb0ecb7
Update README.md
mmerchante Mar 25, 2017
38881eb
* Minion!
mmerchante Mar 25, 2017
f6336c7
Merge branch 'master' of https://github.com/mmerchante/Project6-RayMa…
mmerchante Mar 25, 2017
22628e9
Update README.md
mmerchante Mar 25, 2017
ae16c42
Update README.md
mmerchante Mar 25, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 5 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,10 @@
# HW 6: Ray marching and SDFs
# Raymarching fun!

## Goal
In this assignment, you will be implementing SDF operators on various primitives and use a ray marcher to render them. Ray marching is a technique for rendering implicit surfaces where the ray-primitive intersection equation cannot be solved analytically.
A small raymarched scene using three.JS and WebGL.

**Warning**: this assignment diverges significantly from marching cubes, so switching options midway can be costly for your time and effort.
This was done as an assignment for a procedural graphics class I took at the University of Pennsylvania.

## Base code framework
## [Try it!](https://mmerchante.github.io/raymarching-fun/)

We have provided a preview scene, and a toggle for the ray marcher rendering. When you correctly implement the ray marcher, the image should match the preview scene containing the simple geometry. Your ray marching calculation should be performed in the fragment shader.

### Ray Marcher (25 pts)

The ray marcher should generate a ray direction, and march through the scene using the distances computed from sphere tracing.

**Note**: Your scene won't be rendered until you have implemented the SDFs for primitives below.

- Generate Rays (15 pts): for each fragment inside the fragment shader, compute a ray direction for the ray marcher
- Sphere Tracing (10 pts): compute the nearest distance from the scene SDFs and update the ray marching's step size.

### SDF (50 pts)
##### Implement primitive SDFs (15pts):
These are simple primitives with well-defined SDFs. We encourage trying other SDFs not listed here, they are interesting!
- Sphere (3pts)
- Box (3pts)
- Cone (3pts)
- Torus (3pts)
- Cylinder (3pts)

##### Useful Operators (15pts)
To create constructive geometry, and interesting shapes (such as holes, bumps, etc.), implement the following operators to combine your primitive SDFs.
- Intersection (2pts)
- Subtraction (3pts)
- Union (2pts)
- Transformation (8pts)
- translation and scaling
##### Compute normals based on gradient (15 pts)

Compute the normals to use for shading your surface.
- Read Chapter 13 of [Morgan McGuire's notes](http://graphics.cs.williams.edu/courses/cs371/f14/reading/implicit.pdf)
##### Material (5pts)
Implement a simple Lambert material. Additional materials can earn extra points.

### Custom Scene (25 pts)
##### Create a mechanical device or a scene of your choice using all operators
- intersection, subtraction, union, transformation (20pts)
##### Animate the scene (5pts)
Use time as an input to some of your functions to animate your scene!

## Extra credits (Up to 30 pts)
- Implement SDF for [Mandelbulb](https://www.shadertoy.com/view/XsXXWS) (10pts)
- You need to implement naive raymarching (not sphere tracing) to get this to work
- Lighting effects
- Soft shadowing using secondary rays (5pts)
- Ambient occlusion (10pts)
- Additional materials besides Lambert. (5pts each)
- Additional SDFs besides the listed primitive. (5pts each)

## Resources
http://graphics.cs.williams.edu/courses/cs371/f14/reading/implicit.pdf

## Submission
- Update `README.md` to contain a solid description of your project
- Publish your project to gh-pages. `npm run deploy`. It should now be visible at http://username.github.io/repo-name
- Create a [pull request](https://help.github.com/articles/creating-a-pull-request/) to this repository, and in the comment, include a link to your published project.
- Submit the link to your pull request on Canvas.

## Deploy
- `npm run build`
- Add and commit all changes
- `npm run deploy`
- If you're having problems with assets not linking correctly, make sure you wrap you're filepaths in `require()`. This will make the bundler package and your static assets as well. So, instead of `loadTexture('./images/thing.bmp')`, do `loadTexture(require('./images/thing.bmp'))`.
![Banana!](/images/minion.png?raw=true "")
Loading