An Unnormal Normal Approach to 3D Modeling
Thennormal approach to 3D modeling which lays the foundations for 3D game is, at core, the manipulation of thenvertices of 3D geometry. Essentially, it isna task of defining the 3D positions and inter-relationships of the vertices.nFrom the very first version of 3D Studio to the latest iteration of ZBrush, thenevolution of 3D modeling methodology and toolsets has been almost solely focusing on providing more efficient andnintelligent means to assist 3D artist to performnthis task better.
nnVertex normal is a third aspect ofnvertex manipulation, which is equally, ifnnot more, important to the visual quality of in-gamen3D object. However, this aspect is oftennunderestimated even overlooked and thus greatly underutilized not only bynartists but also tool developers. Utilizing vertex normal to its fullestnpotential is my unnormal approach to 3D modeling.
nn1 The Normal Approach
nn
Speaking from my experience as Graphic Technical Director fornvarious AAA art teams, 3D game artists as a whole rarely deal with vertex normalndirectly in their daily practice, despite certain awareness of its existencenand influence on lighting effect. Normally they would perceive the whole subjectnas a matter of hard or soft edge and approach it with Smoothing Group method,nwhich leads to three common issues, undesired lighting effect, higher in-gamenvertex count and aliased hard edge.
nnSmoothing Group doesn』t grant user full control of vertex normal direction. All the vertex normalsnare aligned to the average direction of all the connected faces without takingnthe face sizes into account, which often produces a curved look on the geometrically flat face when lit in the game. Bevellingnthe edges would alleviate the issue to a certainndegree but doesn』t resolve it entirely.
Figure 1: The vertex normals assigned by Smoothing Group aren』t perpendicular to the faces. Even beveling couldn』t resolve the problem entirely.
The situation described above is often undesired on a rigid object. The most common solution employed by 3D artist is to further subdivide Smoothing Groups until an un-warped look or sharp edge is obtained. Unknown to some 3D artists, Smoothing Group adds an extra and hidden cost to the final vertex count. Vertices thatnconstitute the borders of Smoothing Groups will be duplicated multiple times byngame engine to provide necessary per-vertex normals and thus greatly increasenthe actual in-game vertex count. These additional vertices are not taken intonaccount by DCCs』 statistical functions and often overlooked in the game engine editors.
nnFigure 2: Left: 3ds Max reports 16nvertices in total. Right: Lumberyard reports 48 vertices for the same geometry.
Hard edge with different Smoothing Groups onnboth sides means an abrupt change of pixel normal directions on the screennwhich will inevitable cause the edge appear to be aliased. The solution to thisncomplication relies entirely on the global full-screen anti-aliasing.
nnFigure 3:nLeft: Hard edge in Lumberyard with globalnanti-aliasing disabled. Right: Result with AA enabled. nn2 A Custom NormalnSolution
nn
Naturally, with the understanding of the rootncauses, one would seek to acquire thendirect control of vertex normal to resolve thenabove issues. The course of action would consist of the following parts:n
nnAlign each vertex normalnprecisely according to the directions,nareas, and topology of the connected faces. DCCs such as 3ds Max or Maya donprovide tools for vertex normal rotation on a individual normal level. Once a vertexnnormal bears a custom direction other than the default one assigned bynSmoothing Group, it is then called customnnormal.
Figure 4:n3ds Max does provide basic normal editingnfunctions in the Edit Normals modifier. But the functions are highly limited.
nnMinimize the use of Smoothing Group. Once hard edges are achievable by using custom normals withnselectively placed beveling, the need for Smoothing Group can be quickly diminished to almost zero. An experienced modelerncan manage even one Smoothing Group on complexnobject without compromising the modeling quality. Minimizing Smoothing Group would save a tremendous number of vertices which in turn allows more room fornanti-aliasing the hard edges with custom normals.
Figure 5: Left: Custom normals on anbeveled sharp corner in 3ds Max. Right: The same corner in Lumberyard.
nnBevel the would-be hard edges strategically. Such action wouldncreate a buffer zone between two previously connected faces where the normalndirections of the pixels lie within can be transitioned gradually from one facento another. Through controlling the bevel width, artist can have precise control over the look of the edge. By usingnthe custom normals, the edge anti-aliasing, asnwell as the desired looks of the faces, can be achieved simultaneouslynat no more cost than splitting Smoothing Groups.
nnAlso, all the major export formats, like FBX or OBJ, and majorngame engines, such as CryEngine/Lumberyard and Unreal Editor, have full supportnfor custom normal.
Figure 6: A 3D object as simple as a low-poly car wheelncan have a massive amount of normals to work with. Please note, the normalsnmarked green are the ones have been bended to custom directions.
nnHowever, in reality, 3D artists still rarely take advantage ofncustom normal but abide the old modelingnroutine. Manually bending tens ofnthousands of custom normals is a humanly impossible task, let alone precisennormal alignment. Unfortunately, to this date, neither DC-Cs nor third partyndevelopers can provide a tool that isnadequately intelligent and sufficiently fast to handle the staggering sheernamount of work. The lack of tools is thenmain hurdle that prevents 3D artist fromnexploiting the full potential of custom normal.
nn3 Custom NormalnTool
nn
Custom Normal Tool is my response to the above situation. This tool wasndeveloped with Maxscript as frontend and C#/.NET as backend for 3ds Max user. Despite the unimaginative name, it fillsnthe gap in the custom normal workflow andnmakes this novel modeling approach available to 3D artists.
Figure 7: The interface of CustomnNormal Tool. Behind the standard Maxscript UI is a .NET backend. Besidesnessential normal related functions, it also packs numerous functions that makenthe custom normal work flow more efficient and productive.
nnCustom Normal Tool features
nn- fast processingncapabilities for high fidelity 3D geometry,
- normal batch bendingnfunctions that satisfy all the general needs without needing user to deal with individual normal,
- quick restore function fornthe custom normals disturbed by geometry editing (a known issue in the 3ds Maxnversions prior to 2016).
Figure 8: Left: A wooden bridgenmodeled with conventional methods. Right: Same object using only one SmoothingnGroup with custom normals. Both lower vertex count and better visual resultsnwere achieved at same time.
After much research and many tests, I decided to implement four bending algorithms to satisfynall the major normal bending needs.
nn
AveragednFace Area Align the vertex normal to the average direction of all the connectednfaces, weighted by face areas.
nnLargestnFace Align thenvertex normal to the same normal direction of the largest connected face.
nnCylindricalnFaces Align the vertex normal to the averagendirection of two largest connected faces. Thisnmay seem unusual but is highlyneffective in avoiding banding artifacts on curved or cylindrical structure.
nnSelectednFaces Align the vertex normal to the averagendirection of the selected faces. This providesnfurther flexibility for fine tuning the custom normals in a localized area.
nnWith a combination ofnthe above four bending methods and anlittle practice, manual adjustment of individual vertex normal is rarely needed.
nnPrior to 3dsnMax 2016, it is a known issue that 3ds Max has difficulties in retaining customnnormals upon geometry editing. Changing even one vertex in the geometry would offsetnall the custom normals randomly. It is critical for Custom Normal Tool to havena quick restoration function to overcome this last hurdle for 3D artist. Custom Normal Tool automaticallynstores the last bending operation inside the inherent 8-bit vertex flag. Atnclicking of a button, the tool can quickly fetch the said information and repeatnthe last nnormal bending operation.
Figure 9: Left: Screen capture ofnthe demo video. Right: Screen capture of the workflow video.
nn4 The New Mindset
nn
With features described above and additional functions aim tonbring convenience to the workflow, Custom Normal Tool has been put to use by angreat number of 3D artists and accepted as an indispensable 3D modeling tool.n「This tool revolutionized our modeling mindset,」 quoting a lead artist I worked with for the previous project.
nnMore importantly, equipped with this tool, the 3D artists havenbroadened their mindset to embrace custom normal as a new modeling approach andnconsider vertex normal to be an integral part of the modeling methodology. Thennew mindset eventually led to morenperformance friendly and visually stunning results, and in turn greaterncontribution to the success of the game project.
推薦閱讀:
※webgame為什麼總是倚重冷卻時間這個要素?
※Monster Farm 開發日誌 (二)邊緣檢測
※從零開始手敲次世代遊戲引擎(十)
※Old Man's Journey
※《塞爾達傳說:荒野之息》美術風格剖析