"The extremists are running the country because the moderates got shit to do."
- John Stewart
More pages: 1 2 3 4 5 6 7 8 9 10 11 12
Framework 4 (Last updated: October 25, 2019)
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)
Cloth
Friday, December 19, 2003 | Permalink

Executable
Source code
Cloth.zip (474 KB)

Recommended:
GL_ARB_shader_objects
GL_ARB_vertex_shader
GL_ARB_fragment_shader
GL_ARB_shading_language_100
GL_ARB_vertex_buffer_object
This is one of my coolest demos so far in my own humble opinion.
The demo simulates the physics of cloth. It properly interacts with the spheres it falls over and slides off them due to weight. The code to do this is surprisingly simple. The cloth is a rectangular field of points. Each point connects to its neighbors in all directions through imagined springs. For each frame the force, speed and direction is computed through Newton's simple laws of physics, and the position of each point is updated accordingly. In a second pass the normals are evaluated from the position of each point. The result is a very realistic cloth simulation.

The physics is done on the CPU, but is simple enough to be evaluated on the GPU with the upcoming superbuffers extension.

The lighting is done with GLSL, but there's also a vertex lighting fallback for cards that don't support GLSL. This gives lower quality however, but all cards should be able to run this demo.

2004-01-11:
Updated with more springs, which makes the cloth less stretchable and behave better. A standard GL vertex lighting path was also added.

Portals
Thursday, December 18, 2003 | Permalink

Executable
Source code
Portals.zip (917 KB)

Required:
GL_ARB_shader_objects
GL_ARB_vertex_shader
GL_ARB_fragment_shader
GL_ARB_shading_language_100
GL_ARB_occlusion_query
This is a demo that does portal rendering and checks for portal visibility through occlusion queries. The advantage of doing portals rendering this way is that it's easier to implement than typical portal rendering algoritms, and that it's pixel perfect. The disadvantage is that rendering portals comes at a cost. The more advanced rendering though, the less the workload of rendering portals matters. Normal portal rendering approaches will likely outperform this method slightly, but at a significant cost in implementation time. This method will on the other hand outperform brute force rendering, with little added complexity. The demo has a quite large world for you to navigate through compared to my other demos, which is split into five sectors (basically rooms in this demo). Only the rooms visible will be rendered.

The other cool thing about this demo is that it's my first GLSL demo. So get the latest Cat 3.10 drivers if you want to run this demo. It should run on Radeon 9500 and up, and at some point in the future when nVidia releases GLSL drivers I expect it to run on the GFFX too.

ASCII
Thursday, December 11, 2003 | Permalink

Executable
Source code
ASCII.zip (528 KB)

Required:
Pixel shader 2.0
Vertex shader 1.1
This demo renders a scene with ASCII characters. It's done by rendering a scene normally to a low-res texture, then looking up the closest corresponding character according to the brightness at each texel. The ASCII characters are packed into a 3D texture with characters placed in slices in the depth direction, sorted by average brightness.

Quite cool, but very useless.

Should run on Radeon 9500+ and GFFX.

Water
Thursday, November 20, 2003 | Permalink

Executable
Source code
Water.zip (697 KB)

Required:
Vertex shader 1.1
Pixel shader 2.0
RGBA16 render targets
This demo generates waves on a water surface purely on the GPU. A number of "drops" every second disturbs the surface and a shader takes care of handling the water physics. It is handled through a spring field that is iterated and bumped between two render targets. The spring field contains height and velocity for each pixel on the render target. The drops are created by occasionally throwing in a tiny circle at some random spot on the render target. Another shader then extracts the water normals from the current spring field by applying a sobel filter on the heights. Using this normal a reflection and refraction vector is computed, which is then used mapped into a cubemap for reflection and refraction on the water surface. While the scene of this demo is simple in its arrangement, I would say that the results are pretty good, and this technique can very well be used in more complex scenes.

It should run on Radeon 9500 and up.

2003-11-28:
Updated to support user created waves. Just right-click and move the mouse pointer across the surface. I also added a menu option to turn auto-dripping off.

2003-12-08:
Updated to use fixed point render targets instead. The advantage of this is that we get filtering, which can be used to evaluate the sobel filter in a quicker way.

Roller coaster
Wednesday, November 5, 2003 | Permalink

Executable
Source code
RollerCoaster.zip (889 KB)

Required:
Vertex shader 2.0
Pixel shader 2.0
This was my contribution to the Beyond3D/ATI shader competition. It grabbed a runner up position.

It shows several interesting shaders. It generates the roller coaster track through a vertex shader. It has a lava shader, water shader, wood shader and terrain shader.

It should run on Radeon 9500+ and GFFX.

Sketch
Friday, October 17, 2003 | Permalink

Executable
Source code
Sketch.zip (436 KB)

Required:
Vertex shader 1.1
Pixel shader 2.0
This is a demo that renders the scene to look as if it would have been sketched. This is done by finding edges in the picture. First the scene is rendered to a texture and the normals and the depth are outputted into it. Then a Sobel filter is applied to all components. This will highlight all edges, not only the silhuette against the background, but also internal edges where there's a difference in depth or when the normal changes a lot over a small distance. To get a smoother image, and to give it a fuzzy pencil drawn feeling, the edge value isn't thresholded, but instead I'm outputting the square of the Sobel filter to allow all kinds of shades of gray. Finally a slight blur filter is applied to smooth it out a little.

Should run on Radeon 9500+ and GFFX.

Transparent shadowmapping
Thursday, October 9, 2003 | Permalink

Executable
Source code
TransparentShadowMapping.zip (1.2 MB)

Required:
Pixel shader 2.0
Vertex shader 2.0
Normally shadowmapping uses only a single channel of the texture the scene is rendered to. Using that depth you can extract information about whether the current fragment is in shadow or not. However, this only works for opaque occluders. This demo extends the idea to work for transparent surfaces too, and makes transparent surfaces cast a projection of itself over the scene. To do this not only the depth is rendered to the texture, but also a color. Opaque surfaces renders white along with the depth, while transparent surface renders its color and leaves the depth unmodified. Then by simply multiplying the shadow factor contructed in a normal shadowmapping fashion with the color stored in the shadow map you'll get a nice projection of transparent surfaces over the scene.

The demo should works on Radeon 9500 and up and the GeForce FX.

Self shadowing bumpmapping
Saturday, September 27, 2003 | Permalink

Executable
Source code
SelfShadowBump.zip (1.1 MB)

Required:
Vertex shader version 1.1
Pixel shader version 2.0
This demo does self shadowing bumpmapping. Letting the bumps in the bumpmap cast shadows over the surface really adds a lot to the feeling of depth of bumpmaps. On the bad side of things is that it's not exactly for free, though not horribly expensive either. A horizon map is needed for every texture. The horizon map is a 3D texture of considerable size. For some textures you can get away with a fairly low res horizon map, for others you need a quite large one to get good results.
For the sky I've written a shader that animates some kind of cloudy Quake-looking sky by using a 3D noise.

All shaders are written in HLSL.

The demo should run on Radeon 9500 and up and GeForce FX series.

2003-10-11:
Updated to include a menu item to let you toggle self shadowing on and off.

2004-01-15:
Updated to support offset mapping too. This further adds to the depth feeling of the bumps. You can turn offset mapping and self shadowing off independently to see in what way they contribute to the final picture.
Note, don't extract this demo over the old version. Instead, remove the old demo first and then extract this demo. Otherwise you will get very odd results since it will use old stored horizon maps that doesn't fit this new build.

2004-01-28:
Updated with shadow mapping for global shadows. The shadow mapping is combined with the offset mapping to get the global shadows to fall realistically over the bumpy surface.

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