Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Project 7 - Geometry Shaders: Turning a Triangle Model into a Collection of 3D Crosses

Important

Please refer to the glman directory if you would like to try out the shaders.

Visual Demonstration

LOD Quantization Cross Size
Chroma Depth

Shader Implementation

The purpose of this shader project is to create a "Quantized Crosses" effect that subdivides triangles in a 3D model, quantizes (snaps) the vertices to discrete locations, and places 3D crosses at each vertex position. The shader also includes ChromaDepth coloring as an optional feature, which colors objects based on their distance from the viewer.

Implementation Process

I first focused on the geometry shader without doing any lighting in the fragment shader. Everything was going smoothly, but my 3D crosses looked more like 3D L shapes for some reason. I realized my math was slightly off, but that was an easy fix. When I went to implement the lighting, it mostly worked, but the color was always black for some reason. I then realized that the uColor variable is a vec4 and not a vec3, so it all looked right once I got that sorted out.

When I went to do the bonus part, my program kept crashing. The information was pretty straightforward, so I was slightly confused. I kept getting “error C6033: Hardware limitation reached, can only emit 73 vertices of this size.” I did not know why this happened, but it would only occur after I added the depth code. I then found out that if I set the max_vertices in the geometry shader from 78 to 73, it all worked out.

Video Demonstration

Video Demo
Click the image above to watch the demonstration video