Game Development Community

Advanced Rendering (Screenshots!)

by Matt Vitelli · in General Discussion · 07/17/2007 (7:58 pm) · 4 replies

Hello everyone, after watching the E3 Halo 3 video carefully, I strongly believe that something of its quality could be done in TGEA without too much work. Most of the lighting methods in that video don't appear to be too advanced. I've also become inspired after reading Wolfgang Engel's literature on 3D rendering. It's really amazing what simple diffuse lighting algorithms can do. Here are some shading techniques that I've added to TGEA. What's more, these all run under pixel shader 2.0 and run fairly well on old hardware.

Here we have all 3 shading methods in use:

i63.photobucket.com/albums/h138/eternaldark112/reflections1.png

Here is the Lambertian Diffusal method based off of Nvidia's Dusk example:

i63.photobucket.com/albums/h138/eternaldark112/lambertnvidia.png

Here is the Phong lighting technique in use with a low specular power:

i63.photobucket.com/albums/h138/eternaldark112/phong.png

Here are 2 images of the Ward reflection model in action:

i63.photobucket.com/albums/h138/eternaldark112/ward1.png

i63.photobucket.com/albums/h138/eternaldark112/ward2.png

The next task is getting multiple dynamic lights working. Any comments/feedback would be appreciated.

-Matt Vitelli

#1
07/17/2007 (11:51 pm)
Looks nice for tgea, about adequate as far as next gen engines go.

I'm not sure whether you're using per pixel or per vertex lighting, but if it's per vertex you may want to consider a per pixel lighting algorithm.
#2
07/18/2007 (7:43 am)
Well, technically lighting is calculated in the vertex shader to an extent regardless of whether or not you're using per-pixel lighting. The phong technique has some visual problems, but that's due to the geometry of the mesh. Apart from calculating the light vectors through the vertex shader, these all use per-pixel lighting techniques.
#3
07/19/2007 (5:43 am)
It would be nice to see the 3 shaders applied to exactly the same mesh with the same lights, that would make it easier to see what's different...
Out of interest, which light vectors do you calculate in the vertex shader?
I am interested because I usually find it much faster to do all the calculations in the pixel shader. I think this is because of one or more of the following reasons:
- these meshes usually have more vertices than pixels (it depends on your scene of course, but that's usually the case)
- there are way more pixel pipelines than vertex pipelines on most video cards
- there are intrinsics like 'lit' which do all the calculations in one go, so splitting the calculations is not very convenient as you would be using more instructions.
By the way, Halo 3 looks really ugly in my opinion :)
#4
07/19/2007 (9:26 am)
Well, the light vector is just a 3-dimensional vector that uses the VC_LIGHT_DIR1 register. I think you're misunderstanding me when I said calculations were done in the vertex shader. The basic algorithms for Phong and Ward lighting are calculated through the pixel shader, yes. But obviously they're nothing without vertex shader computations that have a dramatic impact on the visual quality of the scene.