TSBK03 Geometry and tesselation demos

Geometry and tesselation shaders are additional shader stages that add a lot of possibilities.


Triple Stanford geometry shader demo


In my opinion, the geometry shader stage is the most important one of these, since it has so many applications, and its initial performance problems for tesselation is pretty much solved with instancing. Here is my “Triple Stanford” demo, which means that it is a demo that includes three simple geometry shaders. It isn’t high tech but may help you get started with geometry shaders.


Skärmavbild 2017-10-12 kl. 09.52.11


download


New version modernized/tested under Linux:


download


Tesselated triangle


Tesselation shaders are specialized on tesselation, and therefore the easiest way to do flexible tesselation. Here is my extremely simple tesselation of a single triangle:


Skärmavbild 2017-10-12 kl. 09.52.57


download


Updated version:


download


Heavy metal teapot


This demo is really still in its infancy. It needs some corrections and improvements, but I think it can still be a demonstration on how to do this, namely displacement mapping.


Displacement mapping is “bump mapping for real”, deforming a model after a bump map. This time we don’t just change the normal vectors (although that should also be included which it isn’t here) but change the geometry so there are actual protrusions, they can’t be cut off when you have a view that goes outside the rectangle.


Again, this is just a draft at this point! Corrections are welcome!


Skärmavbild 2017-10-12 kl. 10.06.09


download


New version tested under Linux:


download


Geometry shader instancing

Skärmavbild 2024-10-04 kl. 14.23.20

Minimalistic demo of how instancing is performed with geometry shaders, improving parallellism.


download


Hairy stanford


Geometry shader for visualizing normal vectors, resulting in a first step towards hair generation

Skärmavbild 2024-10-04 kl. 14.26.52


Note: I made a mistake with two shaders, with a version not supported on a Mac. Just change back to 150, or anything supported.


download


The Candide face model tesselated in a geometry shader.

Skärmavbild 2024-10-04 kl. 14.29.45

The demo will intentionally run into a max level when it does not allocate enough data per run.


download


Adjacency demo

Skärmavbild 2024-10-04 kl. 14.34.46

This demo shows how adjancey data can be created (brute force) and applied to create a simple outline.


download




This page is maintained by Ingemar Ragnemalm.