raytracing how to

Raytracing

A breakdown of how to use shaders and the gpu to explore the world of raytracing. I add a new bit here and there as inspiration strikes.

The fundamentals I learned from Inigo Quilez's live demo. I also recommend checking all the great wisdom at his site.

Raytracing


galton board

Galton Board

Demonstration of the natural binomial distribution using the Matter.js 2D physics engine.

Galton Board, Bean Machine, quincux - all the names for this thing are great.

Galton Board


a multi-user, cyberpunkscape

Wat

A multi-user virtual hangout place reminiscent of Neuromancer, Snow Crash, Tron and pretty much any other 80's to 90's rendition of what computers are all about. Anachronism at its finest.

WASD for movement, SHIFT for runs, SPACE to jump, mousedrag to look around, ' to yell a bit, and " to leave a permanent post. If you yell an imgur link, that image gets posted to the world where you are. So far no one has thrown out any dongs, but no promises. User beware!

Built using Mongo and Express running on Node. Socket.io instead of Angular, so not quite MEAN. First crafted on cloud9, but thrown onto Amazon Web Services to get some permanency. Currently the link goes off domain to AWS, because my current host does not support Node. Given how crazy cool Node is, this strikes me as a strong argument for shifting Monogon.net over to AWS completely.

Wat


reimann sum visual guide

Riemann Sum Visualizer

A quick tool to demonstrate how a Riemann Sum works.

Riemann Sum


The super swords of something

Cards

A multiplayer, interactive deck of tarot cards that the Goodjers over at Gamers With Jobs used to play a long form "collaborative storytelling rpg" called The Unmarked. The game has since completed and can either be listened to in podcast or video form.

At the time of playing The Unmarked, only the players had access to the site. The goal was to emulate a group of people sitting at the same table, and flipping cards. The results of the cards flips would dictate how the story progressed, and all players would see the same result real-time. Game master Rob Daviau had the power to disable specific cards and shuffle the deck.

Initially I was only responsible for the frontend, with the backend a Laraval project for another Goodjer. Eventually I got fed up with our slow solution for keeping all players synchronized, so I up and learned Node and socket.io. This instance connects all visitor to the same "deck".

Click a face down card to flip it. Click a face up card to get a better look at that card. 'S' shuffles.

Cards


asteroids, all of them

Asteroids

An animated representation of all observed asteroids in 3D. Positions for each asteroid are approximated on the gpu by way of a custom vertex shader.

By default only 50,000 asteroids are loaded, but up to 688,004 may be observed at a time if you have the hardware to handle it.

Thanks to NASA for orbital elements of the asteroids and planets, and thanks to Scott Manley for making the original videos that made me want to see this in 3D bad enough to make it.

50,000 200,000 688,000


a little game: put eight queens in their place

Eight Queens

Can you place eight queens on a chess board such that no queen may take another? From observing people attempt this challenge, I have noticed that the time it takes to find a solution is directly proportional to the age of the person. Also adults tend to find the same solution. Go figure.

This was also my first brush with javascript, and a nice project to get a handle on interactivity in this environment. Neat things in javascript are so much easier to share than Python!

Take the Eight Queen Challenge


solitaire chess

Solitaire Chess

A chess based version of solitaire, and my first experiment in ThreeJS. The goal is to keep taking pieces on the board with any other piece until there is only one left.

The algorithm for generating a new board will always provide one that can be solved, but could be enhanced to filter out less interesting permutations.

Play Solitaire Chess


a comparison of scales

Scale Compare

A comparison of scales for a few scifi ships and Halo. Earth for scale. The Halo ring is spinning at an appropriate rate to generate one earth gravity on the surface.
A version with the massive ringworld from Larry Niven's series is also in the works, but the terrain is procedurally generated on the gpu and may be too much for some users' machines to handle.

Thanks to NASA for the hi res textures for the Earth, and to BOLL at halo.bungie.org for the Halo texture.

View Comparison WIP Ringworld


worlds within worlds

N-body Gravity Sim

General purpose computing on graphics processing units is pretty neat. At 16,000+ particles some pretty nice proto-galaxy stuff starts to appear. Have yet to see spiral galaxy arms arise, yet, but maybe it just hasn't run long enough. Zurich did it with 18.6 million. Downright wasteful!

The gpgpu crunching in the background requires floating point textures, which a lot of mobile devices are not going to even attempt to support. So that'll just be a white screen. On a desktop or laptop with a more proper gpu, it would be wiser to attempt the smaller 4,096 particles version first.

4,096 Particles 16,384 Particles

if gnats ruled the world

Point Cloud Terrain

Using the power of point clouds to render terrain data is great. First attempt was Olympus Mons, tallest mountain in the solar system. So tall you could walk out of the Martian atmosphere! I've been playing around with scaling the points in the vertex shader to better hide the gaps without protruding too much. So far the best has been a discrete partial derivative. This effect pulses on and off to better judge how effective it is, along with a redness to indicate severity of slope.


Thanks, MOLA for the points.

Second about a square kilometer of the trails behind NCAR. Here two layers are compared to determine the difference between ground and vegetation, and color is passed along as vertex colors.

Thanks, Open Topography for the points.

Thanks, Geospatial Data Abstraction Library for analysis and conversion tools.

By default each pointcloud presents less data than is available to spare unwitting gpu's. The hashtag parameter scales down, so if you would like to see higher resolution, put in a smaller number. Be warned, olympus at #1 is 3804^2 points. That's probably too many.

NCAR Trails Olympus

Another take on the NCAR trails, but rendered with Potree, which dynamically loads the points nearer the viewer from the server.

NCAR Potree

gnarly shapes

Orbit Trap Fractal

Construct your own fractal by tweaking a complicated, complex function. Like sand art but for grown ups. Thanks to Dr. Sisson for introducing and explaining the concept.


Orbit Trap Fractals


Mistakes and Errata

noisy smoke
Crystal Smoke

GPU Advection leads to beautiful crystal smoke.

Deeno
Deeno

An exercise in moving the bones of a skinned dino mesh.

atomic rainbow
Atomic Rainbow

Gravity leads to an atomic rainbow display.

Conway's Game of Life
Game of Life

A simple GPU exercise, Conway's Game of Life.


Who?

Monogon.net is a playground for Daniel Martin to easily share things he has made. Daniel Martin is a thing for turning calories into triangles. Triangles are nice because if you get enough of them to cooperate, you can do anything.

More specifically he wields
Python,
Javascript,
C++,
Mathematica,
Java,
C#

and, wherever possible, shaders to make computers do his bidding. Preferably in parallel.

Perhaps you like triangles. Perhaps you like them so much that you would like some yourself, and would like to alter Daniel Martin so that he turns money into calories into specific triangles.

Or maybe you found a typo.

Either way Daniel Martin can be reached at:

danny dot craig dot martin at gmail dot com