"You cannot strengthen the weak by weakening the strong. You cannot help the wage-earner by pulling down the wage-payer. You cannot help the poor by destroying the rich. You cannot help men permanently by doing for them what they could and should do for themselves."
- Abraham Lincoln
More pages: 1 ... 3 4 5 6 7 8 9 10 11 12
Framework 3 (Last updated: February 6, 2017)
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)
VolumetricLighting II
Sunday, June 1, 2003 | Permalink

Executable
Source code
VolumetricLightingII.zip (453 KB)

Required:
GL_ARB_fragment_program
GL_ARB_vertex_program
This demo shows a way to create volumetric lighting. Unlike my previous volumetric lighting demo, which did it in the vertex shader, this one does it in the fragment shader. This means better quality and no tesselation needed, but at a performance cost. I'm also using a different method to create the effect, which is less complex and gives better results in general. It computes the smallest distance from the light to the ray between the camera and the fragment and lets the light volume brightness decay according to it.

This demo runs fairly slowly, should run fine in 1024x768 or so though. There are plenty of ways to optimize it though had I cared enough, so it's not really that the technique in itself is very slow (though maybe not very fast either), but rather that I draw a full pass of the whole scene for every light.

Should run on Radeon 9500+ and GeForce FX.

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 (3.5 MB)

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.

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.

Phong illumination
Thursday, February 13, 2003 | Permalink

Executable
Source code
PhongIllumination.zip (1.5 MB)

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.

Soft coronas
Monday, January 27, 2003 | Permalink

Executable
Source code
SoftCoronas.zip (2.1 MB)

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.

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