Sunday, May 10, 2009

Smoothing vs. Normal Angle

A problem I've been running into lately has been smoothing out polygonal models without smearing their UVs. I'm smoothing them, of course, so that their edges are beveled and broad, rounded surfaces don't become faceted.

My original geometry looked like this:

Notice how the rounded surface consists of about 20 faces (from left to right) that have been cut from about 12 faces, in order to create openings for the windows while preserving the original curvature of the original 12 faces. I also made edge loop cuts to "shore up" the edges and preserve hard edges where I needed them, especially where the rounded part joins the flat part of the facade, as well as the windows, as circled below here:

Upon rendering, there is blatant faceting, a dead giveaway that the building is CG and consists of polygons:
At both far and close angles, the faceting is very obvious.

In modeling my objects, I intended to subdivide them at render time with Renderman, so I would get results like this:
Notice how there is absolutely no faceting at all, and the rainbow grid texture has stayed perfectly in place.

However, Renderman was giving me limited control over its ambient occlusion, among other things, so I tried converting the polygons to subdivisions in both Maya 2008 and 2009, but this warped the UVs, as did Maya 2009's subdividing at render time:
This made my texture maps virtually unusable, as they'd been painted according to the UV layout of the original polygon object. My other attempt at getting rid of the faceting was to smooth out the polygon object, by just doing a Mesh > Smooth operation, using these settings:

This certainly fixed my faceting issue, but it also smeared my UVs:
The smoothed polys I was looking for are circled in green, with the smeared UVs in red:The UV smearing is apparent, even from a wide angle:I did not want to edit my UVs again, because they were too precise for the texture maps I'd created. I also did not want to have to edit my geometry manually, because it ran the same risk of making my textures useless. Luckily, one of my classmates, Thomas Huang, suggested softening the Normals of my geometry. By setting the Normal Angles to 45.0, I was able to give the illusion of a rounded polygonal surface, without changing any geometry or UVs:
The green circles are where the smoothing is apparent, and the red indicates the angles that reveal the silhouette of the geometry, showing that the geometry itself has not been adjusted in any way. These angles don't matter to me though, since they will be occluded by other geometry, such as window sills and frames.

Here's the result of the softened Normals on the whole facade:

This is a huge relief; I don't have to manage any geometry conversions, nor do I have to re-map any UVs; I just have to set a single angle, and I can move on to more important things.

See also: Surface Normal (Wikipedia)

No comments:

Post a Comment