I think the most elegant thing about this method is that it describes a scene in terms of its basic mathematical 3D objects and transformations on them (list here: http://www.iquilezles.org/www/articles/distfunctions/distfun... ) and then exploits the massive parallelism of the GPU for rendering all the pixels.
You can download it from here http://www.pouet.net/prod.php?which=51074 It's been updated to run more reliably (edit: on Vista) but I can't find a version that will run on Win7.
Is the demoscene a good place to get into graphics programming? The prevalence of older methods leads me to believe one could learn in a similar progression to the graphics gurus of today, moving from simpler old methods with performance and size optimization to modern techniques?
This is a really impressive presentation -- after looking on from afar at the seemingly magical works of the demoscene, this finally helped me understand a little bit of how the magic happens. I've only got a bit of GLSL experience so far but now I want to learn a lot more.
Two triangles make a flat screen (a 'quad'), which is sized to fill your actual screen. When you run a pixel shader over the quad, it ends up running for every pixel on your screen. The result is you have the visual effect of the pixel shader giving a very detailed-looking scene, when the actual geometry is as simple as it gets.
Here's an old experiment I did where the pixel shader is running on the faces of a cube http://dgholz.github.io/GLSLSphere/ The cube edges are highlighted in red so you can see them. I like green.
Basically you draw a single quad (2 triangles) covering the entire screen using OpenGL (or DirectX).
A Pixel shader is run when rendering each pixel of the quad. It's only input is often `time` and `resolution`.
At least in GLSL there's a global variable, `gl_Fragcoord` and provides the integer position of the pixel currently being drawn. So for example the pixel at the bottom left is gl_Fragcoord = vec2(0,0). The one directly to the right of that is gl_Fragcoord = vec2(0,1)
Given you're also passed the resolution can get a value that goes from 0 to 1 over the screen with
vec2 zeroToOne = gl_Fragcoord.xy / resolution;
If you were to dump that value directly do the screen you'd get a red gradient going black to red from left to right and a green gradient from black to green going from bottom to top. See http://glsl.heroku.com/e#18516.0
Now it's up to you to use more creative math that given just gl_Fragcoord, resolution, and time write a function that generates an image.
It basically means everything is happening in the shaders, not in geometry. There has to be some vertexes though, and the minimum you can have to cover the screen is two triangles.
algorias|11 years ago
The Google cache version of the pdf doesn't include any images, so I put up a copy over here:
https://dl.dropboxusercontent.com/u/2173295/rwwtt.pdf
vanderZwan|11 years ago
Know of any novel techniques/rehashing of old techniques that have been developed since?
userbinator|11 years ago
Here's a demo of someone playing around with it, complete with a Slisesix-inspired scene: http://www.rpenalva.com/blog/?p=254
This set of slides is also related: http://www.iquilezles.org/www/material/function2009/function...
rogerallen|11 years ago
z303|11 years ago
DanBC|11 years ago
People might enjoy noodling around the Geisswerks pages which have many code snippets around ray tracing; graphic demos; and so on.
http://www.geisswerks.com/
sp332|11 years ago
Edit: I found a similar one on Shadertoy https://www.shadertoy.com/view/lsf3zr
foxhill|11 years ago
hughes|11 years ago
I had no idea IƱigo Quilez's image was produced this way and I'm so glad I had the chance to see how it was made.
Thanks for posting!!
yzzxy|11 years ago
DanAndersen|11 years ago
thisjepisje|11 years ago
falsedan|11 years ago
Here's an old experiment I did where the pixel shader is running on the faces of a cube http://dgholz.github.io/GLSLSphere/ The cube edges are highlighted in red so you can see them. I like green.
greggman|11 years ago
A Pixel shader is run when rendering each pixel of the quad. It's only input is often `time` and `resolution`.
At least in GLSL there's a global variable, `gl_Fragcoord` and provides the integer position of the pixel currently being drawn. So for example the pixel at the bottom left is gl_Fragcoord = vec2(0,0). The one directly to the right of that is gl_Fragcoord = vec2(0,1)
Given you're also passed the resolution can get a value that goes from 0 to 1 over the screen with
If you were to dump that value directly do the screen you'd get a red gradient going black to red from left to right and a green gradient from black to green going from bottom to top. See http://glsl.heroku.com/e#18516.0Now it's up to you to use more creative math that given just gl_Fragcoord, resolution, and time write a function that generates an image.
You can play with that in your browser here, http://glsl.heroku.com and here http://shadertoy.com
bratsche|11 years ago