Making shaded wireframe rendering
This tutorial answers following questions:
- How to render wireframe in V-Ray or Mental Ray?
- How to perform the isoline render?
- How make a post production to a wireframe rendering?
Most of 3d artists who at least once made a really nice visual, surely shared it, for example, in the public 3d galleries for getting reviews and feedback. After what, the commenters like a flash flooded a work with the requests to show the mesh of the model or even of the whole scene. Moreover, the providing the visual with its wireframe is simply required by rules of many galleries for work acceptance.
Many of those who want to learn something from the more experienced colleagues, follow or run by themselves the W.I.P. (Work In Progress) threads on a 3d forums of numerous CG portals. They also need to have a presentable way to demonstrate the mesh of the created model.
Who of 3d artists has not wanted to make money by selling own models from the first pages of the popular online shops such as Turbosquid or The3dstudio, and many others? You've probably noticed that beside the strict technical information, such as the polygon and vertex count, textures or rigging presence and other, almost all great models have beautiful wireframe images. This not only attracts the attention, but also straightly helps a buyer to estimate the quality of the model itself.
Probably, the most interesting case, which simply requires the wireframe demo, is the flattering question: "Photo or rendering?". Especially often such a question may arise when the unusual for this field products are rendered. For example, they can be the foodstuffs rendering for the printing promo-production. Of course, it is better to see once than to hear or read a hundred times. And the most conspicuous response, as well as the disappointment for all the skeptics, is a public demonstration of the wireframe.
Still, it is not worth to leave a wireframe as a prerogative for a cg-community discussions only. It plays not less important role in the portfolio of any talented cg-artist, whose works often are hardly distinguishable from a real photo by an eye of an usual viewer, which is neither professional visualizer nor modeling ace. After all, the end consumers of the renderings are not very 3d technology sophisticated. Not every architect, designer, and even engineer can distinguish the photorealistic pro's rendering from a banal photo with ease. So it is for them the evident demonstration of the mesh absolutely essential. The wireframe image is a most convincing argument, which obviously shows that the observing image is computer-generated.
So how can we demonstrate the mesh and their persuasive tech view and, in the same time, save the presentability of the model?
The most easy way is to grab a screenshot of a program viewport.
In case when the demonstration of the mesh is needed for confirm the computer origin of the visual, screengrab of a viewport from the same camera angle as it is on the visual is the most cogent.
Despite the impressive appearance of the mesh cobwebs, the derived picture can not be called presentable. This image looks dirty and will rather worsen the portfolio or W.I.P., spurning the viewers by its excessively rawness. Especially when it shows the camera angle with green and orange Safe Frame like it is on 3ds Max for example.
V-Ray solution: theory
A quite another matter is a nice white model, with lighting and shading of a full-fledged rendering, covered with black contrast edges. This is a such an interesting and presentable method of mesh demonstration that sometimes it's much pleasing than the final visual with all of the textures and materials :)
Making this like rendering is quite simple. Most modern render engines have a special shader, which allows to visualize edges of a model as a texture.
In V-Ray, the specialized parametric texture VRayEdgesTex is responsible for that. This is a simple map that have only four parameters.
Color is a slot with a color sample. Defines the color of the rendered edges.
Suffice it to click the colored field, that is white by default, and to select in the opened Color Selector window the desired color. As a rule, the most preferable is black. But, anyway, it's a matter of taste.
Hidden edges option lets to render the hidden edges.
As is known, the polygons are only the way of presenting the sets of triangles. All 3d meshes are assembled out of triangles and, for convenient work, they are considered as polygons, while being triangles by their nature. The activation of the Hidden edges function lets to render this hidden triangles edges.
There are two parameters in the Thickness zone that responsible for the thickness of the rendered edges.
World units parameter lets to specify the edges thickness in a scene measurement units. Such as millimeters, centimeters, inches, and so on, accordingly to the units set in the main scene Units Setup.
Pixels parameter lets to set the edges thickness in pixels. How many pixels set there, so many pixels the edges will be rendered with, regardless of a final rendering resolution.
When we choose the method of setting the edges thickness in pixels, we must bear in mind that the edges thickness always remains the exact pixels number, and does not decrease or increase with zooming in or zooming out to a different scene parts like it is with World Units edges thickness.
V-Ray solution: practice
For using the VRayEdgesTex map, first, the base material, VRayMtl for example, must be selected and applied with a VRayEdgesTex map to a Diffuse slot. Second, the edges thickness should be set.
To select the main filling color we must set the color of the Diffuse channel of the VRayMtl material.
For example, if we want to make the rendering of the white models with black edges, we need to set the Diffuse color of the VRayMtl to white. And the edges color, which is defined by a Diffuse slot of the VRayEdgesTex map, to black.
V-Ray solution: tricks
Usually, the wireframe rendering is made of a whole scene at once. In this case there is no need to set VRayMtl with a VRayEdgesTex map in a Diffuse slot to an each scene object, corrupting their settings of original materials. It is quite simpler to use global override material function of the V-Ray renderer. This function lets to render a scene with a single material and to save the materials settings from changing. The function is available from the V-Ray: Global switches rollout on the V-Ray tab of the Render Scene (F10) dialog. To use this override, we need to open this rollout and find the Orerride mtl checkbox in the Material section. After checking it, the global material override slot and the Override Exclude... button become available. The needed override material must be placed to an Override mtl slot. That is the pre-tuned VRayMtl with a VRayEdgesTex map in a Diffuse slot.
The function Override Exclude... lets to locally set the objects that shouldn't be overridden with a Override Mtl material.
When a scene contains the opaque objects only, everything is quite elementary. But in a case when the scene has a transparent objects, such as glass or, like we have, the transparent packing film over the mackerel itself, not everything is coming out like expected. If we apply VRayMtl with VRayEdgesTex map in a Diffuse slot, the film stops to be transparent and covers the fish model. The same is true for the crystal vase, through which the flowers stems wouldn't be visible; or a glass of the car model, through which the cabin become invisible.
The way out of this situation is a leaving the such transparent objects with their native materials. In most cases this is the most rational solution. The transparent material does not break the overall picture and, quite the contrary, makes it more interesting.
The case with the VRay Displacement is worth to be mentioned separately. As is known, the displacement is a way of creating geometry based on texture; it is performed by dividing the mesh of an original object to a number of sub-triangles and displacement theirs vertices in accordance with the texture of a Displacement slot. Despite the availability of the work the VRayEdgesTex on a displaced objects, it shows the edges of the original mesh only and do not show the number of new edges that were created with Displacement even if the Hidden Edges option is on.
More information about VRayEdgesTex map can be found in the â V-Ray help index on a spot3d.com pages.
Another quite important aspect of the rendering of the mesh is the iteration count of its smoothing, of course if the model has appropriate properties. If the number of the smoothing iterations is too high, the wireframe rendering may appear very heavy and dingy.
Every author has a not subdivided low-poly option of the made model. As a rule, this option is more preferable for presentable rendering of the mesh's edges. Sometimes, the subdivided option also looks good, but only if it has a minimal number of smoothing iterations.
It is worth to mention one more important mode of the mesh display. This mode is the way of displaying a model with isolines. It is the mode, which the model is presented in, when it is with the applied NURMS (Non-Uniform Rational Mesh Smooth) or subdivision surface in a 3ds Max viewport. Despite this mode, the high-poly mesh is seen, not the isolines, on the rendering. The same situation we can observe in a viewport if we convert the NURMS-subdivided model to an editable poly, or apply any modifier. The esthetic mesh of a smooth curves will become a model with dense and dirty topology, like on the previous image. Anyway, there is actually a special isoline mode that lets to have nice isolines not in viewport only, but also in a rendering. To use it, one have to use a Turbosmooth modifier. It is present at the Subdivision Surfaces section of a Modifiers submenu of the main 3ds Max menu.
The main parameter of this modifier is the Iterations parameter that defines the power of mesh smoothing.
To render the model with isolines, we got to set the checkbox Isoline Display. If the model has the smoothing already, for example Use NURMS Subdivision of an Editable Poly instruments, it should be certainly turned off.
We should be careful with TurboSmooth. The fact is that for correct display of the isolines, the TurboSmooth modifier literally creates the such model, removing "extra" edges not only on rendering, but also on the model itself. The result of the converting such model to editable poly is an ugly mesh with a number of missing edges or, conversely, extra vertices. This peculiarity many of the beginners consider as bug of 3ds Max. But this is not actually a bug, it's rather a not very suitable naming of the function. Particularly, the word Display a somewhat confusing by making one to think that the changes on the mesh are on the viewport displaying stage only. But again, this is not so.
The most of the modern rendering engines allow to render wireframe in almost similar way.
Mental Ray solution
In the Mental Ray renderer this is done using the standard built-in 3ds Max shader named Composite.
When creating the Composite material, the slot Base Material has already a preset default Standard material. It's its color will define the main filling color of the wireframe rendering. Therefore, if we want the white model with the black edges, its color must be set to white as a first thing.
After this, the Mat. 1 slot must be applied with an another Standard material that defines the edges color. Like in a case with the material in a Base Material slot, the Diffuse color must be set to black accordingly.
This is the end of the main material setup. All that's left to do is to check the Wire checkbox of the current material, thus telling the renderer that edges only must be rendered in this material. The result of this action instantly becomes visible in the viewport. But in spite the viewport show the edges alone, without faces, the Mental Ray will make all faces filled with the Base Material. They wouldn't be invisible, as it can be assumed when looking into the viewport. For the visualized mesh edges thickness, the parameter Size is responsible, which is in the Wire zone in the Extended Parameters rollout of the Standard material parameters. Like in the case with the V-Ray renderer's VRayEdgesTex, the thickness of the rendered edges may be specified in Pixels, as well as in Units. The radio near the mentioned parameters lets to choose the desired one.
The current composite material works correctly with the Mental Ray only. But the native 3ds Max Scanline engine also supports it. Scanline renders similarly to the viewport look, that is the mesh alone, without the faces filling.
Compositing render using Photoshop
Many of those who visited the 3d works galleries or the professional's portfolios, probably have paid their attention to the nice renderings where the fine saturated model with textures and shaders smoothly turns into the black and white wireframe at a half. Such a metamorphosis indirectly emphasizes the rendering's photorealism and severs all sceptic questions about the image origin. This is not only professional, but gallant too.
Making of this like image doesn't take much efforts. To begin with, we need the two renderings and some familiarity with the raster 2d editor. The needed images are the wireframe rendering and the final color rendering. The well-known Adobe Photoshop is a great tool for such purposes.
Suppose the final rendering file name is final.jpg and the wireframe one - wire.jpg.
To begin compositing, we need to open the both files in Photoshop. After that we need to paste the wire.jpg image to a new layer above the final.jpg. Such a way we get the document with the two layers, where the lower Background layer is the final rendering image, and the second top layer is the wireframe rendering. This can be done via the clipboard, by copying the wire.jpg image and pasting it into the opened final.jpg file. Then, we got to apply a layer mask to an upper layer. It is showed as a little icon (rectangle with a circle inside) on the Layers panel (F7) bottom.
When the layer mask is applied, the last we need to do is to customize it. The essence of the mask in Photoshop is the same as it is in the 3ds Max masks. The dark area of the mask covers the corresponding area of an image, which is it applied with, and the light areas leave the same image areas visible. To achieve the desired half-transparency effect, we need to use the Gradient Tool (G) and make the smooth black-to-white gradient on the mask. Thus, we get the gradually covered part of an upper layer.
Compositing render using 3ds Max only
Due to considerable cost of the compositing software, such as Photoshop, After Effects and others, there actually is a compositing potential in a rendering application itself. This is useful for the relatively small studios and freelancers with little budget especially.
Such a simple compositing can be elementary performed with a help of the standard 3ds Max map called Mix and unpopular Render Map function. We just need to put the final.jpg image to a Color #1 slot, the wire.jpg image to a Color #2 slot, and the parametric gradient map, for example Gradient or Gradient Ramp, into the Mix Amount slot. Then, we go back to the Mix map level and click the right mouse button on a material sample slot (the sphere) and choose the Render Map... item.
The Render Map dialog will open, in which we should specify the map calculation parameters, press the Render button and save the obtained result as it usually done in the standard framebuffer.
There are even the specialized maps, the role of which is a performing more difficult compositing calculations. Particularly, the V-Ray renderer has a specialized map for these purposes called VRayCompTex, which allows to perform most of the mathematical calculations with images. They are addition, subtraction, multiplication and others that are applicable for difficult compositing situations.
Show your mastery in a best way, freely demonstrate the mesh of a complex model to publicity, proud of your work, and this surely will be appreciated by your colleagues and potential clients.
Have a nice wireframe visuals and presentable portfolios!
Your questions and opinions regarding this tutorial please leave in comments ;)
The tutorial is written and prepared by:
Anton (RenderStuff)3d rendering artist at Ren3d with more than eight years of experience in photorealistic 3d rendering. Author of all RenderStuff rendering tutorials and much of the CG images on this site.
Your questions and suggestions regarding this tutorial feel free to write in comments below.