Since the last tutorial I made, in which I tried to explain the advantages of using subdivision surfaces was quite a success and attracted a lot of positive reactions, I was encouraged to try and share some more of my experience as a 3d artist with you. Again, I will try to address a relatively simple topic, which might add a little more quality into your renderings and 3d artwork.
My name is Ivan, and today, I will try to shed a little light on the subject of wire frame rendering. I think, I don’t need to explain what a wire frame is. Everyone knows them, everyone likes them, they can give your rendering the futuristic digital look you want, but it is not always easy to achieve this effect, like shown in the picture bellow:
Since some of the renderers out there have tools, which are specifically designed to create the wire frame effect, I won’t address them. You can always look them up in your renderer´s manual (for example the EdgeTex material in Vray).
But there is still a majority of software out there, which do not possess the tools to help you render a wire frame, like Luxology´s Modo for example, which I am going to use during this tutorial.
The first thing, that comes to mind, is to create a mesh, that will render as a wire frame. In 3ds Max, you can use the Lattice modifier, in Modo, there is a special script to do this. You might just be satisfied with this solution, but there are a lot of downsides to this technique.
Firstly, it is not possible to use this with a subdivision surface. Another downside is the increased polycount, which slows down your view port reaction times and consumes a great amount of resources at render time. Furthermore, since you have a whole bunch of extra geometry in your scene, which consists of subtle profiles and cuts into another surface, you need a whole lot more samples for ray tracing, and are still bound to have some artifacts in your rendering after an increased amount of time. I haven’t really experimented with this technique in Modo, so I can’t offer you a picture, but I’m sure you can imagine this. And if you are curious about this plug-in, you can easily look up the script or some examples.
The road I tend to take is an image texture (like the ones in the picture above). It is easily done, consumes an ignorable amount of resources and gives you quite a good control of the outcome. For this approach, you have to have basic knowledge about UV mapping and projection, which I am not going to explain thoroughly in this tutorial, there are a whole bunch of tutorials on this topic, and the steps can differ a bit depending on the software you use.
The first texture-based technique, I am going to show you (and yes, I am keeping the best for the grand finale), is based on the so-called Barycetric projection. What this basically does, is to take every single polygon and stretch it into the UV space (more specifically: the square between the 0,0 and the 1,1 coordinates). In the end, you get something like this:
As you can see, the projection is not perfect, as it only works correctly with quads, and triangles and n-gons can’t be properly stretched into the quadratic UV space. Now, all that needs to be done is to apply a framed square texture, as the one in the second picture, tagged as a barycentric wire frame texture . As you can see below, although this method has its drawbacks, the final render doesn’t look that bad (picture below).
You can probably see one thing though, the line width is not constant throughout the model (I intentionally made the wire frame thick, so you can get a better view of the differences in width). This is one of the drawbacks of barycentric projection. All the polygons get stretched to the same size in the UV-projection space, but their sizes in the XYZ space differ, which creates a size distortion…
And now, to the method you have all been probably waiting for, the one I consider to be the best workaround, if your software doesn’t have a generic Edge-based texture:
The first step would be to completely unwrap your model (to unwrap a model means to create UV mapping coordinates for every single polygon). This might sound scary at first, if you haven’t done much unwrapping up until now, but a good UV map is a vital part of every good 3d model. You should get used to creating UV coordinates for your models, not only because of the wire frame-workaround, but also because of later export (for example: the .obj file format doesn’t save partial UV-s, only those, which include every single polygon) or texture baking. This is how an unwrap can look like:
As you can see, there is a lot of unused space, which of course is not the optimal solution, but will have to do for the purposes of this tutorial. But be assured, this unused space is not the result of my laziness to scale up some of the parts to get the maximum out the pixels of the map we are going to create. If you draw textures, it is only natural, that the parts of your model, which need a higher detailed texture will take up more UV-space, than those, which aren’t as exposed in the final render. In that case, it would make sense to use as much texture-space for the detail-demanding parts as possible, but our purposes are a little different now. We need to make sure, the overall proportion-ratios of the polygons in UV space to those in the XYZ space are as constant possible (a great tool to help you do this is Modos new distortion view, that gives polygons colors, depending on their surface size ratio between the UV and XZY spaces) . This is to prevent the distortion of the line width, like we had in the barycentric-projection method.
If you feel, that this uneconomic UV layout might waste your resources, or just want to have a good looking texture, you can always add another UV map with a proper layout (as I mentioned in my earlier tutorial about subdivision surfaces, a mesh can have multiple UV maps applied to it at the same time) and bake the texture in it from the one we are going to make.
Once the unwrap is done, we have to export our wire frame from UV space into a 2d editor ( Adobe Photoshop in my case), to do a little tweaking. In modo, the process is fairly easy:
As shown on the picture above: texture export UVs to EPS (with the right UV map selected) and all that is left is to choose a location to save the file to. Now, we have to fire up Photoshop (or any other 2d editor you like to use) and import the EPS file.
If you choose a big enough resolution, your EPS file should look something like the picture above. Do not get scared, if you can’t see anything in the EPS file yet. Now we add a Stroke style to the layer, to make the wire frame visible, you can try a few different stroke widths and colors, to see which one you like the most.
After this, you just save the image as a raster file, a Jpg or a Png. The Png has the advantage of an integrated Alpha channel, so you don’t have to mask the wire frame texture afterwards, if you want to use a more complex material, or you can simply use the the wire frame texture as a layer mask inside your 3d software’s material editor and edit the wire frames color with the layer, that is masked by the wire frame texture.
This is what you get, if you use the image map we created with the UV coordinates it was originally created from:
So… that’s it! Hope you learned something new and enjoyed reading this tutorial.
This time, I won´t add the model I used for download, because it´s the famous Utah Teapot (the first 3d model ever created, that wasn’t a cube, sphere or cylinder). This 3d model is one of the basic primitive objects, that are part of most of today’s software’s object libraries.
Now it´s time to experiment yourself, have fun! If you liked this tutorial, don’t hesitate to leave a comment, that might help me improve my future tutorials or suggest topics, that interest you, but aren’t well covered anywhere.