- Ray marching of distance fields done on the Gpu inspired by IQ demo “Slisesix” and Shadertoy. The video shows two scenes rendered with a pixel shader: the simple scene showing basic distance fields and the more elaborated one, showing procedural distance fields and shading.
This test is heavily inspired by the IQ’s work done on ray marching and his several raymarched demos. The test builds the pixel shader, which is the ray marcher, on the fly everytime the shader changes. The algorithm is as straightforward as cast a ray, sample the distance in a position and advance to the next with the distance obtained until you reach a minimun distance or a maximun number of iterations. The distance fields are functions like spheres, cylinders and torus. The fun comes with the csg operators you can use like union or difference. I have had a great amount of fun developing the procedural distance fields but requires a lot of tweaking and time.
- Left click plus mouse movement to rotate the camera around the center of the scene.
- Opengl 2.0
- Microsoft Visual Studio 2010
- Windows 7 x64
Develop/Build/Test Machine Specs
- Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
- 3072 Mb RAM
- Nvidia GeForce GTX 260
- Nvidia Driver Version: 260.99
- Microsoft Windows 7 Professional x64
- Raymarching distance fields by IQ
- Sphere tracing:a geometric methodfor the antialiased raytracing of implicitsurfaces by John C. Hart
- Terrain raymarching by IQ
- Rendering worlds with two triangles with raytracing on the GPU in 4096 bytes by IQ
- Behind elevated by IQ
- Making graphics in 4 kilobytes by IQ
- Better fog by IQ
- Shadertoy by IQ
- Fog in GLSL by oZone3D.Net
- Gpu Gems 2. Chapter 19. Generic refraction simulation by Tiago Sousa