[3D Rendering Tutorial]
3D Procedural Materials
Tom Arah finds a near-ideal, near-universal solution for generating 3D materials – and you can begin benefiting for free.
When judging 3D applications, attention is usually focused on their modeling capabilities. But when it comes down to what really matters, the final rendered output, the model’s shape is often less important than its surface appearance. In fact you can guarantee that no matter how good the models in your scene, if the materials aren’t right, the results will look unrealistic and amateurish. Conversely, even simple meshes can look entirely believable if the surface appearance is perfect. Despite its crucial importance, however, material handling is an area that is generally overlooked. What’s more, it’s an area that can be radically improved.
It’s their materials that bring 3D objects to life.
Materials are largely taken for granted because, to begin with at least, all 3D applications take a similar approach. 3D renders are built on the way that the scene’s objects interact with the scene’s lighting. This is almost always handled through materials, generally referred to as “Shaders”, built up of numerous interacting parameters. To produce a shader for a realistic orange in 3ds max, for example, you first specify an orange colour for the main Diffuse parameter and by default this is also automatically copied to the Ambient setting which is designed to interact with the scene’s indirect lighting. Then using the Specular Highlight, Specular Colour and Glossiness parameters you control the shininess of the orange, in other words the size, focus and colour of its highlight when illuminated directly.
So far so good, but of course a perfectly smooth, uniformly coloured sphere is only an approximation of the real thing. The universal solution is to turn to “Mapping”. Rather than a single flat colour, mapping means that you can specify a full-colour bitmap image generally referred to as a Texture Map. Applying a scanned-in photo of some real orange skin as a texture map to the Diffuse setting in the Maps rollout in 3ds max’s Material editor (or the equivalent in any other 3D application) immediately brings the orange to realistic life. Even better, the same texture map can be dragged to the Bump map setting where its brightness levels are used to simulate the object’s surface relief, in this case producing the effect of realistically pitted orange peel.
Combining lighting-based shader parameters and texture maps is the stock-in-trade of the 3D artist and, whatever application you use, enables just about any material and surface appearance to be recreated. After all, all you need is a JPEG, BMP or TIFF of the real thing which can then be easily tweaked or radically altered in any bitmap editor. And, although the memory requirements can rise quickly with high-resolution texture maps, their rendering is straightforward and in many cases can be made even quicker by the use of widely available or easily created low-resolution seamless texture tiles (see RW 118). Overall the use of texture maps for producing 3D materials is simple, flexible, fast and all-encompassing. Problem solved?
Most 3D applications handle materials through shaders and texture mapping.
Not exactly. Texture maps are always going to be central to 3D work but they certainly aren’t perfect. To begin with, all bitmaps have a fixed resolution which means that, if the mapped object is viewed from too close, its quality deteriorates and eventually collapses. Another problem is that any photo used as the basis of the texture map is by its nature pre-lit which can cause false lighting cues (say if the bumps in your orange peel were originally lit from the left but you want them lit from the right) again destroying the carefully built illusion of reality. And while photos are great for capturing and recreating exterior surfaces they are much less successful when it comes to volumetric effects such as fire and smoke, especially when these need to vary over time during animation.
Even for straightforward surface materials, texture maps are fundamentally limited. By their nature bitmaps are 2D planes, but the whole point of 3D is to go beyond this. The solution of course is to wrap the 2D image around the 3D model but this can never be perfect. For common shapes, such as our spherical orange and cubes and cylinders, most 3D applications provide dedicated projections designed to make the mapping work as well as possible. For more complex shapes advanced UV Mapping breaks the texture map down into discrete picture elements that are fixed to the underlying co-ordinates of the polygonal mesh, again trying to keep distortion and visible seams to the minimum. It’s not ideal and for some materials the whole mapping approach just breaks down. While a wood-based texture map works perfectly for a table top, for example, it will never look right wrapped around a wooden bowl because the ring pattern in wood isn’t a surface, it’s truly three dimensional.
Ultimately texture mapping - though generally successful when handled carefully - is a crude workaround. So is there an alternative? The answer is yes: Procedural Textures. These are textures that are procedurally, that is algorithmically, defined. Crucially, despite their mathematical basis, procedural textures don’t have to look computer generated – far from it. Let’s move on from our simple orange to the humble, though considerably more challenging, potato. To generate a realistic procedural potato, you would need to create a colour pattern based on varying patches of brown with the odd darker eye formation and some surface cracking, overlaid with areas of varying amounts of dirt which would also express a grainier relief to suggest soil. By breaking it down like this, each element can be mathematically described as recoloured gradient grayscale patches, veins, noise and so on which, when coloured and combined together, produce the desired result – a believable potato material.
Although purely mathematical, procedural textures can produce stunningly naturalistic results
The advantages of procedural textures are multiple. In fact all the major limitations of texture maps are addressed. To begin with, procedural textures are infinitely scalable with the final optimal resolution only determined during rendering (memory requirements are also minimal). Because they are generated from scratch, they produce no false lighting cues so fit in perfectly within their scenes. Again because they are generated, they can handle otherwise difficult materials such as fire and water as easily as any other and, by changing parameters over time, these materials can be simply and realistically brought to life as animations.
Most importantly, procedural textures can be applied to any 3D shape with no distortion or seams. For our bowl, for example, the surface would look just as if it had been carved out of a real block of wood. The generated mapping of procedural textures provides another advantage over simple mapping – the texture itself can be varied according to scene-based factors, such as distance and angle, which opens up a number of effects such as automatically adding dust, rust or snow to the top of a surface hugely boosting believability. Finally, they provide one more unbeatable advantage: because they are mathematically described, procedural textures can be quickly tweaked to produce a completely new and original material fine-tuned to the task in hand.
The advantages are compelling - but so are the downsides. To begin with, it’s important to recognize that we’re talking about generating and regenerating the texture as required for every render – and the more complex the texture the slower this will be. Against that, ever faster systems make the processing overhead more bearable while professional packages can ease the pain, for ongoing test renders at least, with options for temporarily hiding objects or swapping materials. The most advanced even let you “bake” your procedural textures into texture maps (though you then lose editability and must bear in mind resolution issues and so on).
The biggest downsides though aren’t intrinsic but come down to implementation. Whereas the support for material shaders and texture mapping is universally recognized as central, the support for procedural textures is seen as an optional extra. As such, different applications provide widely ranging procedural texture functionality and, within even the best, the support is ad hoc and arbitrary – providing the ability to create simplistic wood or fire textures, for example, but not clouds or smoke. And, in case you’re wondering, you can forget about finding a ready-to-go potato material. Worse, for those rare applications that do try to deliver a more flexible and powerful general purpose procedural engine, such as Poser with its node-based shader trees, the result is almost inevitably a minefield that will send non-technical users running.
This really isn’t good enough. What is needed is a more universal procedural solution: more universal in terms of application support; in terms of the textures that can be generated; and in terms of end user accessibility. And that’s exactly what a little-known program called DarkTree 2.5 from Darkling Simulations provides (demo version included on CD or from www.darksim.com).
As a standalone third-party program DarkTree is immediately universal in terms of application support as you can take advantage of it whichever 3D modeler you use (a particular advantage when many use more than one). And as soon as you open DarkTree, it’s also clear that the program takes a much more all-encompassing approach to just what textures you can expect to create procedurally. Using the Library panel you can explore the hundreds of presets provided and the range is extraordinary: bricks, moss, planking, stucco, leather, snow, sand, lunar rocks, solar flares, cave walls, glass blocks and so on. More to the point the quality is exceptional. Most 3D applications’ in-built wood or marble textures look like pale imitations, the DarkTree versions look like photos. Or rather they don’t look like photos; they look like the real thing.
The obvious question is how is each texture created? To find out you simply double-click on it to load it into its own editing window. Here you’ll see that each texture is built up of a number of components arranged as interconnected sockets on a grid board. DarkTree 2.5 provides no less than 106 of these components divided into categories such as Pattern (for man-made repeating patterns), Natural (for random patterns such as clouds and venation), Control (for randomizing regional elements) and Generator (for mathematical functions). Most powerful of all is the single Shader component which is optionally placed in the first Root socket. This operates much like the 3ds max shader system I described earlier enabling 3D materials to be built up of numerous interacting light-based parameters each procedurally defined. The parameters provided include the standards such as diffuse, specular, glossiness, bump and transparency, as well as rarer options such as alpha, metal highlight and a clear coat specular layer with customizable thickness.
Components are the key to DarkTree’s texture editing.
The key to creating your own textures in DarkTree is how you manage these components and involves four main steps. First you add new components simply by dragging and dropping from the Component Bin tab that runs down the left of the screen. Second you set up each component’s broad parameters, double-clicking to open them up into their own dedicated Component Editor window. Third you connect the components up to each other by right-clicking on the Outgoing Links area, selecting a parameter and then dragging out a wire to connect it to the desired target. Finally you hone the end result by again returning to the individual component editors or, more powerfully, by pulling out the most important input parameters from wherever they appear in the texture tree as “tweaks” which are then conveniently collected together under their own Tweak Editor tab for easy experimentation and fine-tuning.
The principles are straightforward but it’s wrong to pretend that you’ll be creating your own potato texture – or giraffe skin, or starfield or whatever - within a few minutes. Realistic textures are often built up of dozens of interacting components and the number of parameters and possible interactions is virtually limitless. Complexity is inevitable but DarkTree does everything it can to keep this to a minimum. Each component has a thumbnail reflecting its current state, for example, and within the editor you can view the effect of changes not only on the current component, but on its parent or on the final texture itself. Throw in an excellent PDF manual and online help and, remembering that the best way to ease yourself in to DarkTree is by exploring and editing the presets, it’s clear that this is about as easy as a procedural texture engine can hope to be.
So once you’ve chosen, edited or created your procedural texture, how do you go about using it? At any point you can drag the texture to the scalable Examine window and, using a screen capture utility, quickly copy the results to the clipboard or a file. This is also true of the save-disabled Demo version (included on the cover CD) which makes it a fantastic option for creating flat ,screen-resolution textures for use in 2D apps such as Illustrator. Of course the main point of DarkTree though is to use it for 3D work and, for this, you need the full version’s Bitmap Renderer. This lets you output to any resolution, supports alpha transparency, and provides two main output options: Render Shaded, which uses distant lighting to ensure even effects, and Render Channels, which breaks the image down into raw colour, bump and specular maps to be recombined in your 3D app for the highest quality. DarkTree 2.5 also supports planar, spherical, cylindrical and cubic output to cut down on mapping problems. Most impressive of all, it can output UVW bitmaps to wrap around Lightwave or Wavefront objects without distortion or seams – effectively pre-baking the texture to the model.
Working like this combines the benefits of procedural textures and texture maps – but let’s face it, having to export and import texture maps is less than convenient and a major deterrent to use. This is where Darkling Simulations provides its real masterstroke. Using its dedicated plug-ins, called “Simbionts”, you can edit and apply DarkTree materials (either fully shaded DSTS files or colour DSTC, percent DSTP and bump DSTB map files) directly from within a number of the major 3D applications. So far an impressive range of plug-ins to work with 3ds max, LightWave, Cinema4D, trueSpace, Animation:Master and RenderMan is available from www.darksim.com/html/download_simbiont2.html (and on the cover CD).
Each Simbiont integrates into its host differently depending on the host’s plug-in API but, in each case, allows DarkTree textures to be loaded, scaled and applied, and optionally opened into DarkTree 2.5 itself for editing. Often full editing like this isn’t necessary as, if the texture creator has added tweaks during the design process, these are made available via the Simbiont enabling the texture to be fine-tuned or radically altered in situ. Install the Simbiont for your favourite application and suddenly you have access to a huge range of customizable procedural textures that can be applied to your objects without distortion, seams or resolution problems and that mesh perfectly with the scene’s lighting. The real jaw-dropper is the sheer quality of the end results – by comparison texture maps look anaemic and unrealistic.
Simbionts enable you to apply DarkTree textures directly from within supporting applications.
But the best is to come. Each of the Simbiont plug-ins is provided for free! That’s totally free: you don’t need to have DarkTree itself to use any DarkTree texture (though of course this opens up far more editing power for the power user). It’s an amazing act of generosity to the 3D community, but there are sound business reasons for it too. In particular it makes DarkTree itself, which retails at $419, a much more attractive proposition for 3D studios who only need to buy one copy to equip a team of designers with all the procedural textures they need.
But the ambition is much larger than this. The real intention is to develop DarkTree along more Open Source lines to truly become as open and universal a solution as possible. It’s a two-pronged strategy. First it’s important to get developers involved. Here the release of DarkTree 2.5 was particularly important as it provided free API access to the underlying DarkTree engine to encourage third-party developers to extend it with new components and to integrate it ever more closely into as many applications as possible. Just as important is the encouragement to end users to freely share the textures that they create. Here the Repository at Darkling Simulations’ site www.darksim.com/Repository/ comes into play enabling users to post their efforts and to download textures that others have posted.
So is the strategy working? The answer is mixed. Third-party plug-ins have been developed for Mental Ray and Softimage XSI again available via www.darksim.com. The Repository offers over 300 additional textures in a wide range of categories from plants to skin, buildings to terrains and almost all of astonishing quality – including an excellent ready-to-use potato skin! The bad news is that the collection hasn’t been updated since the end of 2003 and the monthly texture challenge has been long discontinued.
It’s all a bit disappointing, but thankfully one developer has risen to the challenge - and with a vengeance. Worcester-based Richard Jennings at www.shaders.co.uk has produced the Enhance:DT add-on pack (demo on CD) using the DarkTree API to create no less than 150 extra components in 14 new categories – Skin, Space, Water and so on - that work in exactly the same way as DarkTree’s own (even the component help files are fully integrated). Using these added components you can create your own new Dark Tree textures in entirely new areas. By far the easiest option though is to take advantage of the provided presets - especially as the pack adds another 1800 to choose from!
The Enhance:DT pack provides 1800 ready-to-use procedural textures.
This is exciting stuff. Particularly when you remember that, if your 3D application is supported by a Simbiont, you can benefit from Enhance:DT even if you don’t have DarkTree itself (though Richard please provide thumbnails and more tweaks to make this approach even more powerful). This means that with the repository files, those included with the DarkTree demo and others picked up on the Web you can immediately access over 2500 procedural textures for an outlay of just $69, the cost of Enhance:DT. It’s hard to imagine a better deal. Or a better way to appreciate and get into DarkTree itself.
Of course this is the real goal: to increase the number of texture designers and so the number of freely available DarkTree textures which in turn will encourage more developers to build the DarkTree engine into their products and in turn create more users and so on. If it succeeds, the end vision is clear and truly universal: a virtually limitless pool of freely available, high quality, easily customizable, resolution-independent, perfectly mapping, perfectly integrating procedural textures accessible by all users directly from any and all 3D applications. Let’s just hope something like it comes to pass.
Hopefully you've found the information you were looking for. For further information please click here.
For free trials and special offers please click the following recommended links:
For further information on the following design applications and subjects please click on the links below:
[3D], [3ds max], [Adobe], [Acrobat], [Cinema 4D], [Corel], [CorelDRAW], [Creative Suite], [Digital Image], [Dreamweaver], [Director], [Fireworks], [Flash], [FreeHand], [FrameMaker], [FrontPage], [GoLive], [Graphic Design], [HTML/CSS], [Illustrator], [InDesign], [Macromedia], [Macromedia Studio], [Microsoft], [NetObjects Fusion], [PageMaker], [Paint Shop Pro], [Painter], [Photo Editing], [PhotoImpact], [Photoshop], [Photoshop Elements], [Publisher], [QuarkXPress], [Web Design]
To continue your search on the designer-info.com site and beyond please use the Google and Amazon search boxes below:
|designer-info.com: independent, informed, intelligent, incisive, in-depth...|
All the work on the site (over 250 reviews, over 100 articles and tutorials) has been written by me, Tom Arah It's also me who maintains the site, answers your emails etc. The site is very popular and from your feedback I know it's a useful resource - but it takes a lot to keep it up.
You can help keep the site running, independent and free by Bookmarking the site (if you don't you might never find it again), telling others about it and by coming back (new content is added every month). Even better you can make a donation eg $5 the typical cost of just one issue of a print magazine or buy anything via Amazon.com or Amazon.co.uk (now or next time you feel like shopping) using these links or the designer-info.com shop - it's a great way of quickly finding the best buys, it costs you nothing and I gain a small but much-appreciated commission.
Thanks very much, Tom Arah
[DTP/Publishing] [Vector Drawing] [Bitmap/Photo] [Web] [3D]
[Articles/Tutorials] [Reviews/Archive] [Shop] [Home/What's New]