Game Development Community

Normals in Constructor

by Ryan Mounts · in Constructor · 08/26/2008 (10:39 am) · 4 replies

One of my biggest complaints (and it's really not even a complaint :) concerning the DIF creation pipeline is the lack of control over vertex normals. I realize there's an autosmooth feature, but that still doesn't give you much control over how the surfaces are actually smoothed and does not allow for smoothing across faces of touching brushes. The problem becomes apparent when you try to create complex, organic type geometry. There is an abrupt lighting discontinuity between brushes due to the lack of proper normal information.

i291.photobucket.com/albums/ll284/rmounts/UnevenLighting.jpg
This unnatural shading between brushes is emphasized even more when using the AO resource (as above). With that said, it'd be nice to be able to specify your normals explicitly. In particular, I'm interested in being able to write out my normals from 3dsmax into the CSX format and have Constructor read them in. Obviously this isn't very useful for people who don't have 3dsmax (or similar programs that can export to CSX). To make it useful to others, it'd require some kind of graphical interface to the normal data from within Constructor itself, plus probably some very basic normal manipulation tools. And that would be no small task, I understand!! But just changing the CSX format to include normals would be an awesome addition for me.

Anyway, I was curious if others were interested in this sort of feature, or if I was the only one. :) If not, maybe we could discuss the feasibility of such a thing, pros/cons, etc.

#1
08/26/2008 (10:56 am)
If this information were present, would it even be used inside the engine?
#2
08/26/2008 (11:51 am)
Yes, the individual lexel normals are interpolated across the lightmap to allow for Phong-like shading. This is how you can create smooth cylinders and such with autosmooth. Upon export, Constructor will average the vertex normals between adjacent faces that lie within the autosmooth threshold and write them out to the DIF file. So the normal information already exists in Constructor (unless they're simply calculated upon export) and are used for lighting in the engine, there's just no access to the artist.
#3
08/27/2008 (12:16 pm)
Here's a more technical pic showing the problem in a custom debug render mode I made to show the vertex normal vectors. This is with a smooth threshold value of 0.02 in Constructor, which should basically smooth almost everything. You can see that each brush's normals are averaged correctly, producing smooth shading around the ring segments of the tube. The normals between the brushes are not getting averaged however (even though some of the normals already practically lie on top of each other), resulting in faceted shading along the length of the tube. I was reading one of Matt Fairfax's Constructor updates from a while back, and he mentioned that normals should be getting smoothed between brushes, but this doesn't seem to be happening.

i291.photobucket.com/albums/ll284/rmounts/VertexNormals.jpg
#4
08/28/2008 (10:35 pm)
Would this also improve the smoothing / shading of baked in static meshes?