GEOG 497
3D Modeling and Virtual Reality

3.5 Optimization and Rendering


3.5 Optimization and Rendering

3D modeling allows us to recreate objects or invent new objects using different 3D modeling programs yet; there are limitations to what even modern-day computers can handle in terms of 3D modeling. What exactly does this mean? Essentially, 3D modeling involves lots of information relating to points and lines connected to one another across a coordinate plane. The more points and lines you use in a 3D model, the more work a computer must do to allow you to visualize those points and lines as a 3D model. Aside from the hardware, many software also has limits on the number of points and lines or geometry it can handle. Now think ahead to software such as game engines. Such software can now be used to add information to the geometry you provide in 3D models to produce interactions such as movement. The added information can start to cause lag, slowing the intended interaction so that it is no longer occurring in real-time. So how do you prevent this?

The gaming industry has developed several techniques, termed optimization methods that assist with this issue of too much geometry. Optimization helps you to maintain the highest level of detail (LoD) with as little geometry as possible. So, what exactly is level of detail? Level of detail relates to the amount of realism a 3D model and ultimately a 3D scene can have through geometry and materials. Typically, the more geometry a 3D model has, the more realistic it will appear.

Three samples of number of faces (1409, 288, 216) shows varying levels of detail
Three different levels of detail
Credit: SketchUp

Geometry is generally measured in terms of weight by either Faces (Quads) or Triangles. Some software refers to Faces as Polys or Polygons as they have four sides. Heavy models have more Faces or Triangles while Light models are the opposite. The goal is to maintain the same base shape but have different amounts of detail. For example, curved shapes take up a lot more geometry than square shapes.

Thinking back to our original issue of preventing lag or slow movement, obviously, Light models are best, but are they realistic enough? Level of detail refers to a scale of geometry weight. Some software is capable of handling 3D scenes with a mix of LoD models, where 3D models that are in focus are Heavy models but models out of focus are Light. This suggests that one needs to have both Heavy and Light models of all geometry in a scene. While this is often the case for video game development, it certainly is not good for everyone. So how else can we address this issue?

Rendering is one of the keys to creating realistic models and scenes. It requires you to add Materials (otherwise known as Textures) to your 3D models. Additionally, you introduce Light sources to the scene your 3D model(s) are in to increase the realism. Increasing the realism through materials and light sources offsets the need for detailed geometry. You use a Render Engine, there are many options in SketchUp as Extensions, to calculate the influence of the Light sources and Materials on your geometry in a scene. Keep in mind Rendering in itself only generates a static image. It can be used to render animations as video files as well, but this does not necessarily help with our issue for interactive environments. Rendering in real-time is another option but it will take up even more computer resources when combined with all your geometry and interactions in a scene. So, how do we make static rendering appear as if it were in real-time?

The gaming industry considered another solution to this issue, Texture-Baking, Render-to-Texture or Light-Mapping. This allows your 3D geometry to be associated with a render-generated material that stores all of the render results on each surface or face. This can be a time-consuming process but what it allows you to do is to add detailed information in the form of an image file like a JPEG or PNG instead of having a lot of extra geometry. We will not go into the details of this now but this technique allows you to make sure what you see, in say Sketch Up rendered also shows up in other software where you may want to import your 3D model/3D scene.

What we will introduce here, however, is Face Normals. Face Normals are part of the Material process. Have you ever noticed in SketchUp, before you add materials that some surfaces appear as a different color? This has to do with the Face Normal. Face Normals indicate which direction a material should be facing. If all face normals are correct, all your geometry would have the same color from the same viewpoint. In rendering terms, normal tells the computer where the front side of a surface is so it can show materials and apply the lighting correctly.

fence or railing in gray
Face Normals
Credit: SketchUp

Flipping the Face Normals on the Grey geometry in the image will correct the color difference so all normals are facing the same direction. Now, why is this important? There are two main reasons, one of which I mentioned earlier. First, if you use a Rendering Engine, even in SketchUp, you need the computer to know which side is up so the lights work correctly. Second, while not necessarily critical in SketchUp itself but when importing your model to other software, the materials may not show up at all because the other software cannot tell which side of a Face is the front side where a material is applied. This can be challenging to correct in another software that may not be designed to handle this issue, such as a game engine. It is easiest to fix Face Normals before you apply materials but it can be done after materials have been added in your 3D modeling software.

Ultimately, the solution you choose is up to you and based on the needs of your project. However, the best practice is to focus on Lightweight models and if the detail is not enough, to add a little extra geometry to see what will work. Relying on materials is necessary for Lightweight models as the materials can replace details you did not model. Correcting Face Normals is necessary for making sure those materials and also light sources show correctly in other software. Whether you use a Rendering Engine or not, you still need to use materials that help with adding detail to your 3D models.

To learn more about Optimization for SketchUp please check out the Knowledge Base article Making a detailed model in a lightweight way.