Real Time OpenGL Rendering
This is a real-time rendering assignment. It uses GLSL for high-quality shading per-pixel. There is a bug during parsing that makes it only import OBJ files that have normals specified -- this is dumb particularly because I end up discarding the provided normals to recalculate them anyways).I've set it up to be fairly easy to define the scene and materials in C++. Hopefully I can expand this, though, to parse some sort of file. Currently, it renders in a single pass.
Features
- Imports OBJ meshes (that have normals).
- Generates single-pass GLSL Materials where each one supports:
- only generates code for required maps/lights (ie. if the material doesn't enable an environment map, environment map GLSL code doesn't get generated.
- color, specular, ambient texture maps
- 1 environment cube map
- uniform color, specular, ambient, emit, and reflectance (for env map)
- up to 8 lights for now
- up to 8 shadow maps if hardware supports enough texture units
- Directional Lights with Shadows -- for these, scaling up the light also scales up the shadow buffer region.
- Spot Lights where Shadows should work, but are broken right now...
- Point Lights without Shadows
- Supports Zorin interpolative subdivision on triangle meshes.
- Interactive interface (can move/rotate/resize objects and lights)
Video
Here is a scene with a ground, a high-poly dragon model, and a zorin subdivided genus-4 object. There are two buttons on the left: one toggles environment maps and the other toggles shadows. This was recorded on a GeForce 9600. On my laptop with an integrated GeForce 7400, it gets a stack overflow if I use over the 2 texture units it has -- OpenGL is supposed to guarantee at least 8 (stupid integrated card...).Get better quality version -> here <-
Source
Here is a bunch of code and some various scene files. It requires SDL, OpenGL, GLSL, freetype2, /usr/share/fonts/TTF/arial.ttf . I've only really tested this on Linux and nVidia cards.Link: here