"It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration."
- Edsger Dijkstra
More pages: 1 2 3 4 5 6 7 8 9 10 11
Framework 3 (Last updated: October 4, 2009)
Framework 2 (Last updated: October 8, 2006)
Framework (Last updated: October 8, 2006)
Libraries (Last updated: September 16, 2004)
Really old framework (Last updated: September 16, 2004)
Electro
Wednesday, May 28, 2003 | Permalink

Executable
Source code
Electro.zip (88 KB)

Required:
GL_ARB_fragment_program
GL_EXT_texture3D
Here another low instruction count wonder. It's a electric flash kind of procedural texture in a style similar to those seen in Unreal/UT, except this is done in a shader, thus hardly requiring any AGP bandwidth while offering better quality and cost scaling well with size on screen. I couldn't do this effect in just 8 instructions like the Fire demo below, but had to settle for 9 instructions. Though in practice it runs faster than the Fire demo since it uses less complex instructions and no dependent texture reads.

Should run on Radeon 9500+ and GeForce FX.

Detail Preserving Simplification
Friday, May 23, 2003 | Permalink

Executable
Source code
DPS.zip (3612 KB)

Required:
GL_ARB_fragment_program
GL_ARB_vertex_program

Recommended:
GL_ARB_vertex_buffer_object or GL_ATI_vertex_array_object
This is a demo of the Detail Preserving Simplification technique. Instead of using a fatass model with zillions of triangles you use a less complex model but use a normal map to get all the detail from the high resolution model but at a much more affordable performance hit.

The model is the famous Stanford bunny and the normal map was generated with ATi's NormalMapper utility available on the developer pages.

To compare different modes, hit the keys 1,2 and 3. It will toggle between DPS, normal lowres and normal hires. Notice how DPS has all the image quality of the hires model, but without the performance hit. Instead the performance is very close to that of a normal lowres model.

Should run on Radeon 9500+ and GFFX.

Fire
Wednesday, May 14, 2003 | Permalink

Executable
Source code
Fire.zip (88 KB)

Required:
GL_ARB_fragment_program
GL_EXT_texture3D
This demo shows how to create a procedural fire in a fragment program. The cool thing is that this is achieved in only 8 instructions.

I did something similar in RenderMonkey during my time at ATi. That DX9 HLSL shader was fairly complex though and had many parameters you could tune. In an application you have more flexibility however, so large parts of the calculations can be preprocessed on the CPU. By carefully tuning the parameters passed to the shader I could reduce the number of instruction quite a lot.

It should run on Radeon 9500+ and GFFX.

Glow
Sunday, May 4, 2003 | Permalink

Executable
Source code
Glow.zip (399 KB)

Required:
GL_ARB_fragment_program
GL_ARB_vertex_program
WGL_ARB_render_texture/GLX_ATI_render_texture
This demo shows how to get glow into the scene. The idea is simple. Just render the object you want to be glowing into a texture, then apply a blur filter and add that on top of the scene in the final pass. Since we're blurring anyway the texture you render to doesn't need to be very large, in fact, I used 128x128 but even smaller would have been quite fine too. To get perfectly fine blurring I first apply a blur filter, then blur the blur, and for final perfection, blur the blurred blur. The last blurring pass can often be skipped, but I had fillrate to burn anyway. In order for the glow to be more visible I applied a simple trick that expanded the object slightly along its normals when I render it to the texture.

It should run on Radeon 9500+ and on GeForce FX.

Phong illumination
Thursday, February 13, 2003 | Permalink

Executable
Source code
PhongIllumination.zip (1494 KB)

Required:
Pixel shader v2.0
Vertex shader v2.0
R32F cube render targets.
This is another phong lighting with shadows demo. The difference compared to earlier work is that this one uses Direct3D, R32F shadow cubemaps are used, the squared distance is stored in the shadow map and a multiplication factor is used instead of bias for a nice speedup.

This is the illustrating code for the "Fragment level Phong illumination" article available in the new Articles section.

Mandelbrot set rendering
Thursday, February 13, 2003 | Permalink

Executable
Source code
MandelbrotSet.zip (153 KB)

Required:
Pixel shader 2.0
This is a demo very similar to my previous Mandelbrot demo. The difference is that this one is written in Direct3D and some minor changes I've done in the final color selection.

This demo is the illustrating code for my new "Mandelbrot set rendering" article available in the new Articles section.

2003-05-30:
Updated with a zoom console command to let you define an exact zoom for comparion purposes.
Type "zoom" to get the current (left, top, right, bottom) coordinates.
Type "zoom left, top, right, bottom" to set the zoom. You can cut'n'paste from a previous "zoom" command.

Soft coronas
Monday, January 27, 2003 | Permalink

Executable
Source code
SoftCoronas.zip (2128 KB)

Required:
GL_NV_occlusion_query
GL_ARB_vertex_program
GL_ARB_texture_env_dot3
GL_EXT_texture3D
GL_EXT_texture_edge_clamp
This demo utilizes occlusion queries to create soft coronas. By querying the number of fragments that passes the depth test I can get a good figure on how visible the fire is. The more pixels visible, the stronger corona, quite simple. The effect will be that as you close in on the light you'll get a stronger corona. If you go behind an occluding object the corona softly fades away.

For this demo I have also added a nice tune for the mood, Antissa by E.S. Posthumus (the song is available for download from their site), so make sure you have OpenAL installed and that you have the libvorbis dlls.

Should run on Radeon 8500/GF3 and up.

Volumetric lighting
Sunday, January 12, 2003 | Permalink

Executable
Source code
VolumetricLighting.zip (565 KB)

Required:
Vertex shader 2.0
Pixel shader 1.0
This demo does a volumetric lighting effect for an arbitrary number of light volumes by using a vertex shader. The demo calculates the sum of the distances through the light volumes of the ray from the camera to the vertex. This is a fairly complex calculation, even though I suspect there exist a simplier solution that what I implemented. So in the 128 instruction of vertex shader 1.1 I would at most be able to fit 2 volumes. But with vertex shader 2.0 I can use a loop to support an arbitrary amount of light volumes without going through the instruction barrier and don't need to use different shaders depending on what number of light volumes I use.

The good thing about this technique is of course that it's cheap from a fillrate point of view as it runs in a vertex shader. Fillrate usually is the limiting factor, not so in this demo though. It would be better to do this kind of calculation on fragment level though, but that would make even the 9700 pro beg for mercy.
The backside of this technique is that it requires a decent amount of tesselation to give good results. The original UT level (DM-Fractal) I used had too few polygons so I tesselate it into smaller polygons at load time for better quality.

Should run on Radeon 9500/9700 and Parhelia.

More pages: 1 2 3 4 5 6 7 8 9 10 11