In my DFA class, we just had an assignment called "Blue Sky" where we had a week and a half to make something cool visually using whatever medium we wanted. I've been really fascinated by the demoscene recently, so I decided to make a demo-ish thingamabob for the project. After a lot of reading, I implemented a basic raymarcher in a GLSL shader. For those unfamiliar with raymarching, it's an algorithm with some similarities to raycasting, except to find intersection points, the ray iteratively marches forward until its distance to the closest surface reaches zero. To determine this distance, the current position of the ray is plugged into a distance function, which procedurally generates an isosurface and associates which part of the surface is assigned to which BDRF material. Portions of this distance function used time as an input, as can be seen with the octopus and waves. The application as a whole is built on Iñigo Quílez's It was lots of fun, made me learn a lot, and gave me one of those "I have an endless amount of knowledge left to learn" moments.
Here's a video!
And here's the primary sources I used as reference:
http://www.iquilezles.org/
http://www.mazapan.se/news/2010/07/15/gpu-ray-marching-with-distance-fields/
http://en.wikipedia.org/wiki/Rotation_matrix (still working on the 3D math bit >_>)
http://www.khronos.org/files/opengl-quick-reference-card.pdf
Huwaah! That's really cool!
ReplyDelete