<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Displayhack</title>
	
	<link>http://www.displayhack.org</link>
	<description>Because code is beautiful</description>
	<lastBuildDate>Sun, 21 Oct 2012 17:42:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/displayhack" /><feedburner:info uri="displayhack" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>displayhack</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Sculpture 3D</title>
		<link>http://feedproxy.google.com/~r/displayhack/~3/5OoG30wa8Kw/</link>
		<comments>http://www.displayhack.org/2012/sculpture3d/#comments</comments>
		<pubDate>Mon, 08 Oct 2012 20:12:09 +0000</pubDate>
		<dc:creator>Ollie "Cosmic" Borgardts</dc:creator>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[Making-of]]></category>

		<guid isPermaLink="false">http://www.displayhack.org/?p=1649</guid>
		<description><![CDATA[Hi, I&#8217;m a digital artist and I live in a small town in the south of Germany. I&#8217;m fascinated by the 3D tools and techniques available these days, and above all the possibilities that open up for an artist using them. Sculpture3D from cosmicollie on Vimeo. There are many applications out there—some even available for ]]></description>
				<content:encoded><![CDATA[<p>Hi, I&#8217;m a digital artist and I live in a small town in the south of Germany. I&#8217;m fascinated by the 3D tools and techniques available these days, and above all the possibilities that open up for an artist using them.</p>
<p><iframe src="http://player.vimeo.com/video/46879024?title=0&amp;byline=0&amp;portrait=0&amp;color=f00800" frameborder="0" width="621" height="349"></iframe></p>
<p><a href="http://vimeo.com/46879024">Sculpture3D</a> from <a href="http://vimeo.com/user8231514">cosmicollie</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>There are many applications out there—some even available for free—that offer endless options for creating high-end digital content. I&#8217;m a longtime Maya user, and as I started learning it fifteen years ago, I was blown away when I realized what can be done with it. But some time later, I stumbled upon a program called Zbrush from the company Pixologic. The first time I tried out this software, I instantly knew it was the perfect tool for me. It is no animation package, but is very focused on sculpting and painting directly onto 3D models, and you can do this with an high amount of detail without losing track of brushstrokes. It&#8217;s simply amazing. You can get a free trial version from their website and try it for yourself. There is a huge community and a lot of free tutorials,  ranging from beginning to very advanced, that take you by the hand.</p>
<p>As I said, you can do incredibly detailed models and sculptures for video games, movies, concept art, or matte paintings with Zbrush. But as much as I like doing this kind of work, I always missed something: the ability to touch my 3D creations in the real world. If a traditional painter or sculptor creates a piece of art, you can walk around it and really see that it was handmade by a human being. Most people have the belief that if you create works with computers that it&#8217;s easy, and computer art doesn&#8217;t have the valence of work done &#8220;in the real world&#8221;. But we demosceners all know that it is not the computer that does the work for you, but the person sitting behind it. I think the problem was the same when people first connected their guitars to electrical power. I don&#8217;t want to have to use clay or paint to create my works to get respect as an artist. I want to use digital tools with all the benefits of the digital realm to do the same as a traditional artist does, but I also want the same fame and respect for my work as well. Not an easy task :)</p>
<p>So I stumbled upon a technique called rapid prototyping. It&#8217;s nothing really new and is used in the automotive industry, for example. If an engineer designs a blinker enclosure for a car, he actually prints out a plastic version of the 3D data set and places it on the car. If it fits well, the object goes into production. But in the art field I&#8217;ve seen very few people using this technique to bring their works to the real world. In the last few years this expensive technique has gotten more and more popular, and above all—affordable. There are many 3D printing services out there that can print out your works for a fair price. For the past four months, I was working on a big project I did on my own. Everyone I told about this was just blown away—there was no one who said &#8220;Meh, that&#8217;s boring and not real&#8221;—they even strengthened my idea that I have to show people what is possible and what you can create if you&#8217;re just willing to learn how sculpting on a computer works.</p>
<p><img class="alignleft" style="border: 10px solid white; margin: 10px;" src="http://www.displayhack.org/wp-content/uploads/SculptureLovers.jpg" alt="" width="430" height="140" />So I started thinking about what to create. I wanted to address a broad audience, but I didn&#8217;t want my work reduced to a mass production. I wanted to make something accepted by both younger and older generations of people, and improve my traditional anatomical sculpting skills, but I also wanted to make something which is hip so younger people could say &#8220;Hey, that&#8217;s cool.&#8221;</p>
<p>So I thought about it for a very long time, and I came to the conclusion to fuse the style of traditional sculpture you see in churches with something like street art—like graffiti—and I started to arrange some rough blocks on the digital canvas. I wanted to have the scene set on a huge graffiti background —but as some sort of mountain or rocky massive thing. I decided to create some sort of diorama where the scene takes place, and I wanted to tell a story. I planned to have a loving couple in it, and a threat like the Devil.</p>
<p>So the days went by and the creation evolved. I wanted to get more weight in it because of the Devil&#8217;s power, so I added an angel in front of the couple to give them some protection. In many sculptures and paintings you see Death placed in the highest position, but I didn&#8217;t want to present him that way. <img class="alignright" style="border: 10px solid white; margin: 10px;" src="http://www.displayhack.org/wp-content/uploads/harlequin.jpg" alt="" width="410" height="580" />In my sculpture Death is placed at the lowest position—I disarm him. He got old—he&#8217;s using a cane. I turned him into a harlequin by adding flowing clothes and a hat with dice on it, but he is still dangerous and holds an ace of spades in his hand as a sign of seduction. The Devil is not the guy who seduces in my scene, but Death. The scene got too imbalanced by having only this small angel protecting the lovers against Death and the Devil. So another two elements went into the composition: a seraph flying high above the scene, and a guard on a horse watching the events from a distance and bringing balance to everything. Modeling everything took a very long time. I had to improve my knowledge of anatomy at the same time.</p>
<p>I took anatomy courses from the artist Ryan Kingslien, who runs Zbrush workshops and founded the Visualarium. I had to rearrange and throw away lots of work in finding the <img class="alignleft" style="border: 10px solid white; margin: 10px;" src="http://www.displayhack.org/wp-content/uploads/anatomyKnowHow.jpg" alt="" width="448" height="237" />right composition. There were many technical matters to keep in mind, because with the 3D printing technique you have to follow several rules and conventions so the art can actually be printed.</p>
<p>I wanted the Devil to hold a mace with a long chain on it. For the chain, there were many long pieces hanging loose in the air so they could break if it got too long, so I had the idea to align the thin chain in regular gaps like the structure of pieces of fabric or cloth, so that they strengthened and held the delicate structure.</p>
<p>Another obstacle that had to be overcome: sculpting cloth that looks right is really hard to do. So I opened up Blender to do <img class="alignleft" style="border: 10px solid white; margin: 10px;" src="http://www.displayhack.org/wp-content/uploads/DigitalCloth.jpg" alt="" width="173" height="125" />initial dynamic simulations to create what I was after.  That was a really hard and very tedious. A lot of trial and error. The fabric didn&#8217;t float the way I wanted it to, but in the end, with a lot of tweaking the elements by hand in Zbrush, I finally made it. The structure of the cloth was created with a plugin called NoiseMaker. The &#8220;only&#8221; thing you have to do is to have a clean UV layout for the cloth. The object was done after four months of work—I think it looks cool, although I&#8217;m aware that I still have to improve my anatomy skills.</p>
<p>When it came to printing the sculpture, another shock was inevitable. I searched for a <img class="alignright" style="border: 10px solid white; margin: 10px;" src="http://www.displayhack.org/wp-content/uploads/ALotOfSubTools.jpg" alt="" width="269" height="145" /> company to do the printing and found Shapeways in the Netherlands. They are cool, but their pipeline only alows a 1 million poly count. My model had 26 million polys at that time. Oh my. Ok, there&#8217;s a plugin which ships with Zbrush called Decimation Master, and<br />
it does a really awesome job reducing the number of polys in the object without losing its details and overall shape. But I had to do it for every single subtool each by each, and there were many of them :)</p>
<p>Ok. I reduced my model to a poly count of about 1 million, sent it to Shapeways, and wanted it to be printed in stainless steel. Yes, you heard right. Stainless steel. To 3D print in metal, a printer places fine layers of particles in cross sections on top of each other and then the whole thing goes into an oven where it is sintered. Just like a motor block.</p>
<p>Ok, I&#8217;m an artist, and my budget is in some ways very limited. I found out that if I wanted to print it in steel, I could only afford a print that&#8217;s around 14 cm in height. C&#8217;mon, I thought—that&#8217;s not fair. 1200 euro for a sculpture I worked so hard on, and I only get this size? I went through a very frustrating process to make all this, trust me, but I am a bullhead and wanted to have this sculpture I worked so hard for. Furthermore, Shapeways told me that this model could not be printed 14 cm high because the smallest parts in it would get so tiny that the printer couldn&#8217;t do it. So I powered up my calculator and did some arithmetic to find out what it would cost if I sized up the model to fit the specifications. The formula is easy: 1 cubic centimeter of stainless steel costs 20 dollars. If you double the size of it, you multiply by a factor of 8 and you get 160 dollars. The whole model resized so that the smallest elements could be printed would have cost me around 9000 dollars. So I thought about hollowing the object to save material. Days went by in doing this properly. The price didn&#8217;t change very much. After all of these calculations, I decided to print it out in a lower priced material. I chose nylon. Two weeks later the box arrived, and I could hold the sculpture in my hands, which were shaking from happiness when I did the unboxing :)</p>
<p><img src="http://www.displayhack.org/wp-content/uploads/Sculpture3Dprint.jpg" alt="" /></p>
<p>Guys, it is cool to create something like this on the computer —but seeing it as a physical object in the real world is breathtaking. Even the photos I took for this article can&#8217;t nearly show how amazing it looks in reality. I also did a lot of renderings from the scene and edited them in Photoshop. I created a photo book from all the prints, and I also wanted this book to be something special. There are so many providers out there offering photo book printing, but I wanted something really classy. So I found a company called Cinebook. They make high-end photo books which are a bit pricey, but the quality you get justifies the price. I&#8217;ve never seen any print that looks as sharp and crisp as what the guys from this company can produce.</p>
<p>I still wanted to see and feel how a metal version would look. So I designed an two finger ring in tiki style and printed it in stainless steel. Guys, this is so amazing. The details are all there and I can wear it and have it with me to show everybody what I&#8217;m doing. I wanted to take photos of someone wearing this ring, so a good friend of mine put it on and even cleaned his fingernails for the photoshoot, but I told him: &#8220;erm, this doesn&#8217;t look right— that&#8217;s not the look I&#8217;m after&#8221;. So I went to the local Harley Davidson guy and asked him if he could wear it for a picture. <img class="aligncenter" style="border: 10px solid white; margin: 10px;" src="http://www.displayhack.org/wp-content/uploads/AlohaTikiCurlyCross-630x172.jpg" alt="" width="441" height="120" /></p>
<p>At first he was a little bit annoyed, but the grumpy look on his face vanished and we made some cool photos. Thank you Mammut!—that´s his name—for your help. He also was fascinated by the technique and can imagine ordering steel skulls with flames for his next custom bike. :)</p>
<p>I want to show people my work and I&#8217;m hoping for a great audience, so I also did a free ebook available for the Ipad. I did lots of editing and added lots of movies and keynotes to it. At this point I want to say thank you to Marc Ewald from the Netherlands. He&#8217;s a composer and he created the music for the intro movie of the sculpture. Please download your free copy here:</p>
<p><img class="wp-image-1637 aligncenter" title="FreeBookIpad" src="http://www.displayhack.org/wp-content/uploads/FreeBookIpad-150x100.jpg" alt="" width="150" height="100" /></p>
<p><a href="http://itunes.apple.com/de/book/sculpture-3d/id552730881?mt=11&amp;uo=4" target="itunes_store"><img class="aligncenter" style="border: 0px none;" src="http://r.mzstatic.com/images/web/linkmaker/badge_bookstore-lrg.gif" alt="Sculpture 3D - Oliver •cosmic• Borgardts" /></a></p>
<p>I&#8217;m aware of the fact that there are lots of Android users out there, and people using other ebook formats. Exporting the book to PDF is technically possible, but it would be like printing out a movie on paper. I&#8217;m sorry for that, but there won&#8217;t be a format supporting other devices. If you want to take a look at the renderings you can do this without the book at my website under the gallery tab, or you can just look at my Facebook page to keep up to date with what I am working on.</p>
<p>See, I want to do art—I want to create things with value. And I really love what I&#8217;m doing. I don&#8217;t want to do stuff for mass production, but things that individual people like. Just like they do when they go to the tattoo artist they trust to get THE special kind of artwork they want. I can create belt buckles, busts of your children, emblems, pendants, sculptures, rings, earrings, canes, custom figures for tabletop role playing games, and so on and so forth.</p>
<p style="text-align: center;"><img class="alignnone" style="border: 10px solid white; margin: 10px;" src="http://www.displayhack.org/wp-content/uploads/pendant.jpg" alt="" width="288" height="161" /></p>
<p>The possibilities of this technique combined with good sculpting skills are endless. This is a brand new market and in the future everyone will have a 3D printer at home. Remember paying lots of money for a simple CD burner? Now you get them for almost nothing. And as easy and comfortable as the modelling tools might be, the skills you need to do really great work—sculpting, knowledge of human anatomy, style, and artistic ability—will still be in great demand because it is not the machine doing the work, but the person behind it.</p>
 <p><a href="http://www.displayhack.org/?flattrss_redirect&amp;id=1649&amp;md5=6a12d0c7d4923923e8dd4207badafa82" title="Flattr" target="_blank"><img src="http://www.displayhack.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/displayhack/~4/5OoG30wa8Kw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.displayhack.org/2012/sculpture3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=displayhack&amp;popout=1&amp;url=http%3A%2F%2Fwww.displayhack.org%2F2012%2Fsculpture3d%2F&amp;language=en_GB&amp;category=text&amp;title=Sculpture+3D&amp;description=Hi%2C+I%26%238217%3Bm+a+digital+artist+and+I+live+in+a+small+town+in+the+south+of+Germany.+I%26%238217%3Bm+fascinated+by+the+3D+tools+and+techniques+available+these+days%2C+and+above...&amp;tags=blog" type="text/html" />
	<feedburner:origLink>http://www.displayhack.org/2012/sculpture3d/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=sculpture3d</feedburner:origLink></item>
		<item>
		<title>Making the Machine – part 1</title>
		<link>http://feedproxy.google.com/~r/displayhack/~3/y3ykKyYq71U/</link>
		<comments>http://www.displayhack.org/2012/making-the-machine-part-1/#comments</comments>
		<pubDate>Fri, 18 May 2012 08:15:26 +0000</pubDate>
		<dc:creator>Gargaj / Conspiracy</dc:creator>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[Making-of]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[behind the scenes]]></category>
		<category><![CDATA[demoscene]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[making]]></category>
		<category><![CDATA[modelling]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[series]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[techniques]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.displayhack.org/?p=1492</guid>
		<description><![CDATA[Preamble In hopes that most people enjoy makingof&#8217;s as much as I do, the following series of articles would be an attempt to describe the creation process of my Revision demo called &#8220;Machine&#8221; by Ümlaüt Design, both from a technical and artistic standpoint, and perhaps shed some light on a few easily avoidable mistakes I&#8217;ve ]]></description>
				<content:encoded><![CDATA[<h3>Preamble</h3>
<div id="attachment_1501" class="wp-caption alignright" style="width: 330px"><a href="http://www.displayhack.org/wp-content/uploads/machine.png" rel="lightbox[1492]"><img class="size-midthumb wp-image-1501 " title="Machine" src="http://www.displayhack.org/wp-content/uploads/machine-320x200.png" alt="" width="320" height="200" /></a>
<p class="wp-caption-text">Ödönke bánt.</p>
</div>
<p>In hopes that most people enjoy makingof&#8217;s as much as I do, the following series of articles would be an attempt to describe the creation process of my <a href="http://www.revision-party.net/">Revision</a> demo called &#8220;<a href="http://www.pouet.net/prod.php?which=59148">Machine</a>&#8221; by <a href="http://umlaut.hu/">Ümlaüt Design</a>, both from a technical and artistic standpoint, and perhaps shed some light on a few easily avoidable mistakes I&#8217;ve made along the way.</p>
<p>A disclaimer: I&#8217;m not aiming this to be a tutorial or a white paper; if you&#8217;re a competent demomaker, you will probably not find anything novel in these texts. This is more aimed at people wanting to get into demomaking, but are perhaps intimidated by the chore, or maybe made a few simple demos, but are unsure how to direct them better or approach the production process easier. Note that I&#8217;m not a very good visual effect coder, so don&#8217;t expect a lot of linear algebra. I&#8217;ll also try to keep a lot of the actual maths / technical stuff to the minimum, or at least digestible to a non-technical / artist audience.</p>
<h3>Preparations</h3>
<p>I first had the idea to do a demo for Revision around February. Reasons were simple: I haven&#8217;t done a demo for several years at that point (meaning actually worked on one instead of just supplying music), and I felt I needed to do something to get back into the loop, and to stay sane. Another motivation was that I found out about <a href="http://assimp.sourceforge.net/">ASSIMP</a>, a fantastic little loader-library for 3D formats; I would often discard ideas for a demotool simply because I felt the management of a 3D content pipeline was a right pain: I tried stuff like <a href="http://www.codercorner.com/Flexporter.htm">Flexporter</a> or writing my own plugin, but it just never worked out quite right, and I also realized that to be really effective (and perhaps somewhere down the line, artist-friendly), I would need to use standard formats like <a href="http://collada.org/">COLLADA</a>. So often I shelved ideas because of this, but then ASSIMP came along and I was in a sense reinvigorated, knowing that there&#8217;s a whole open source project who&#8217;ll gladly deal with these kind of problems.</p>
<div id="attachment_1509" class="wp-caption alignright" style="width: 330px"><a href="http://www.displayhack.org/wp-content/uploads/machine_flailotron.png" rel="lightbox[1492]"><img class="size-midthumb wp-image-1509" title="Machine_Flailotron" src="http://www.displayhack.org/wp-content/uploads/machine_flailotron-320x200.png" alt="" width="320" height="200" /></a>
<p class="wp-caption-text">An early concept model of the first robot.</p>
</div>
<p>My plan was simple: I had a track from around 2007 influenced heavily by Drew Cope&#8217;s <a href="http://www.tokyoplastic.com/drummachine.html">Drum Machine</a> animation, and I realized I never got around to making anything with it, so finishing the track already put me in a good position. I also had some really rudimentary basecode from around that time for the next generation of ÜD tools we wanted to make &#8211; this certainly spared me some time to mess around with datafiles and parsers and loaders. Of course this was by no means finished, but it was a good start.</p>
<p>So I started planning:</p>
<ul>
<li>I had roughly two months. First, I really don&#8217;t like party coding. (Why code in Germany when I can code at home any time I want? It&#8217;s a waste of a good time.) Second, my current portable computer is a netbook; a fantastic little machine for everything other than Shader Model 3.0 demos. These all meant that I had to finish at least a day before the party.</li>
<li>Already had the soundtrack (or at least something that needed a day of work at most to finish), and it wasn&#8217;t particularly long either.</li>
<li>Some basecode, mostly just boilerplate <a href="http://en.wikipedia.org/wiki/Standard_Template_Library">STL</a>-like stuff.</li>
<li>One person project &#8211; you&#8217;d think after 12 years in the scene I would know some willing graphics artists, but the problem here is that they were either uninterested or unavailable at the time, and my concept wasn&#8217;t fully fledged either, as I was anticipating to make some of the stuff up as I went along. (Plus there&#8217;s something to be said about masochism, megalomania and lack of human skills, but that&#8217;s a different story &#8211; let&#8217;s not dwell on that.)</li>
</ul>
<div id="attachment_1510" class="wp-caption alignright" style="width: 330px"><a href="http://www.displayhack.org/wp-content/uploads/machine_theplan.jpg" rel="lightbox[1492]"><img class="size-midthumb wp-image-1510" title="Machine_ThePlan" src="http://www.displayhack.org/wp-content/uploads/machine_theplan-320x200.jpg" alt="" width="320" height="200" /></a>
<p class="wp-caption-text">Demomaking. Serious business.</p>
</div>
<p>I also planned what I&#8217;ll be needing:</p>
<ul>
<li>I&#8217;ll need a tool. You can argue about handcoding, but no. For the stuff I planned, razor-sharp editing and continuous flow, you&#8217;ll need a tool. And no, <a title="Syncing your real-time graphics right" href="http://www.displayhack.org/2011/syncing-your-real-time-graphics-right/">GNU Rocket</a> won&#8217;t cut it &#8211; it just wasn&#8217;t precise enough or convenient enough for what I wanted. I&#8217;m a firm believer in that if you spend a week on writing a tool that saves you a week somewhere down the line, do it.</li>
<li>I&#8217;ll need a 3D engine that can somehow load an animated 3D mesh and display it. I&#8217;ve written a few of these so I wasn&#8217;t concerned, although I really wanted it to be non-hacky this time, i.e. unified lighting, material system, and hopefully looking the same in the tool as in the modeller.</li>
<li>I&#8217;ll need a couple of effects. Nothing special &#8211; I&#8217;m not good at them, so I&#8217;ll just keep them basic but hopefully interesting.</li>
<li>A LOT of content. I was originally planning about 3-4 scenes, but listening to the music, I had to realize I needed at least double that.</li>
</ul>
<p>I made a rough timeline for the project: about two weeks for the tool, two weeks for the engine + loader + effects, two weeks for content, and I allocated the last two weeks to edit the demo together. This last point might sound like an overkill, but I really wanted the demo to look polished and feel well thought-out, and I was also aware that making a demo, being a <a href="http://en.wikipedia.org/wiki/Non-linear_editing_system">non-linear</a> process, sometimes involves you going back to previous steps and fixing content or code in the phase when you&#8217;re supposed to edit (in film, I suppose this is what you&#8217;d call &#8220;re-shooting&#8221;), so in a sense I left myself some headroom to fail.</p>
<h3>The tool</h3>
<div id="attachment_1504" class="wp-caption alignright" style="width: 330px"><a href="http://www.displayhack.org/wp-content/uploads/machine_toolempty.png" rel="lightbox[1492]"><img class="size-midthumb wp-image-1504" title="Machine_ToolEmpty" src="http://www.displayhack.org/wp-content/uploads/machine_toolempty-320x200.png" alt="" width="320" height="200" /></a>
<p class="wp-caption-text">2012.02.11 &#8211; We all start somewhere.</p>
</div>
<p>I decided early on what I wanted my tool NOT to be: I didn&#8217;t want to write a content tool. I had no room (and in this case, no time) to make a full-fledged 3D editor, even to just place cameras or tweak materials. I decided that I&#8217;m better off to do those in the content package and then just make sure it looks as close (within reason) as possible. All I really wanted is to manage resources (to an extent), composite, but most of all, edit. That was it.</p>
<p>I also decided that since I don&#8217;t have much time, I needed to tone down on functionality: the basic idea of a tool is to make certain things easier, case in point editing and scratching back and forth in the demo. That&#8217;s all I wanted to have. The underlying system was capable of managing resources, loading them, reloading them, etc., but since my internal format was XML, I decided that as long as it doesn&#8217;t get too tedious, everything else I could just do by hand. Now, it&#8217;s up to each and every demomaker to decide what&#8217;s tedious and what&#8217;s not &#8211; for me, copy-pasting XML tags to insert a new envelope was a perfectly acceptable trade, even if I had to do it several times; compared to adding GUI to a &#8220;New Effect&#8221; window with foolproofing and all, it was really just a minor nuisance. Of course, I&#8217;ll finish the GUI properly at some point, sure, but then and there I had two months, of which I allocated two weeks for the tool. From scratch. I had to create a triage.</p>
<p>As far as the tool&#8217;s interface goes, I went back to what I&#8217;ve been using a lot: music editors, specifically <a href="http://en.wikipedia.org/wiki/Digital_audio_workstation">DAW</a>&#8216;s. DAW&#8217;s have a particular way of arranging envelopes, clips, loops, and they allow a really precise level of editing, but the thing that struck me the most about them is how much ease they have developed over the years. I used to be a tracker person, and my switch to DAWs was somewhat bumpy, but now I don&#8217;t regret it &#8211; adaptive grids, triplet beats, beat snapping, envelopes, these are all things that one can use for a demotool and gain a lot of strength with them. With that in mind, I set out to essentially build a DAW by my own rules.</p>
<p>The underlying system was simple:</p>
<ul>
<li>I can load an arbitrary number of plugins.</li>
<li>These plugins can produce an arbitrary number of resource loaders and effects. These are <a href="http://en.wikipedia.org/wiki/Factory_method_pattern">object factories</a> that can instance any number of effects or resources.</li>
<li>I have a common resource pool where I manage the outputs of the loaders: Textures, meshes, videos, shaders. If there&#8217;s a loader for it, it goes here. Resource loaders can also use this pool if they depend on other resources (e.g. 3D scenes can reach for textures already loaded)</li>
<li>Each effect can specify a set of resources (by type) to use. None of them HAVE to be there &#8211; it&#8217;s a plugin&#8217;s responsibility to fall back gracefully.</li>
<li>Each effect can specify a set of parameters to be wired out to envelopes or left as a static value.</li>
<li>The demo then loads plugins, instantiates the loaders and effects, loads the resources, feeds them to the effects, loads the envelopes, and runs.</li>
</ul>
<p>That&#8217;s it. That&#8217;s all I needed at the moment.</p>
<div id="attachment_1517" class="wp-caption alignright" style="width: 330px"><a href="http://www.displayhack.org/wp-content/uploads/machine_toolearly.png" rel="lightbox[1492]"><img class="size-midthumb wp-image-1517" title="Machine_ToolEarly" src="http://www.displayhack.org/wp-content/uploads/machine_toolearly-320x200.png" alt="" width="320" height="200" /></a>
<p class="wp-caption-text">2012.02.16 &#8211; GUI shaping up slowly. Note the time signature change.</p>
</div>
<p>Early on one of the things I thought about is having arithmetic envelopes, i.e. I would be able to have two splines create an envelope by adding, multiplying, and so on (e.g. a pulsating beat that gets progressively stronger), but I ditched the idea (AFTER I wrote the code for it) because it was a hassle to manage, and I had a better idea: if it&#8217;s all just envelopes creating floating point values, why not subclass them? So right now I have one subclass for static values, one for a standard spline-based envelope, and then if I need specific GUI functionality later, I can just implement a new type. This all might sound like an overkill (I haven&#8217;t actually implemented new ones yet), and certainly arguing about GUI design can be pretty pointless, but I thought about how I would imagine an envelope to e.g. switch between cameras conveniently: with an ordinary spline-based system, you can set your splines to flat and just move your points up and down until it crosses to another integer value, but it sounds like a nightmare from a convenience point-of-view (and due to the time constraint, this is what I ended up using, so I can confirm it too). A better idea, of course, would be displaying the GUI itself as a list of ranges (i.e. &#8220;between 2:00 and 3:00, the value is constantly 7&#8243;), and not just a spline &#8211; like the pattern editor for the <a href="http://illformed.org/plugins/glitch/">GlitchVST</a>. While you could argue that this way you&#8217;re actually spending time on removing functionality, my perspective is that for certain parameters (colors are a good example too), a specific GUI feels much better, and with a subclassed GUI, that&#8217;s fairly easy to do without having to break something else. Once again, this might sound like a tangent, but the idea is this: As long as it spits out a floating point number, anything goes, and a bit of forward thinking pays off later.</p>
<p>One thing I kinda forgot about initially and then just sorta chose the simplest solution to take care of it was the actual rendering range, i.e. if there are all these possible envelope types, how does the demo know if it&#8217;s time to render an effect or if it&#8217;s time to leave it alone. This I decided to leave up to the discretion of the actual envelope class: each class had a bool function that returned whether according to that envelope, something should be happening or not, and when all envelopes said &#8220;true&#8221;, I rendered the effect. Constant values always returned true, and splines returned true if the play cursor was over one of their clips (= the white boxes visible on the screenshot below). This provided fairly convenient control over when effects were active or inactive, and again, with a different envelope type, I would&#8217;ve been able to define a whole new behaviour if I wanted to.</p>
<p>Another thing before I forget: For splines, I didn&#8217;t limit myself to a 0.0-1.0 range. When I did my first 4k synth, I realized a lot of the fun stuff comes from the out of range values, and if you want to extend your animation with 20 more frames, you don&#8217;t have to re-sync your entire demo. (This, by the way, is a hindsight. I did make this mistake.) Of course the question is, how to fit an infinite range to a GUI like this? Well, I went for the simple and stupid solution &#8211; default range is 0.0-1.0, a rightclick menu of &#8220;Set Range&#8221; can change that to anything. This is purely a GUI thing and the demo doesn&#8217;t even have to care about this.</p>
<p>As far as GUI goes, I went with <a href="http://en.wikipedia.org/wiki/Microsoft_Foundation_Class_Library">MFC</a> for a number of reasons: I&#8217;m really familiar with it, having worked with it for a number of years, I find it not only reliable, but also very convenient, however the REAL real real reason was <a href="http://msdn.microsoft.com/en-us/library/bb984433.aspx">docking panes</a>. I fell in love with the Visual Studio-style docking panes on first sight and I wanted them in my tool for ages, not only because they&#8217;re really easy to rearrange, but I also wanted to have a level of multi-monitor support where I can see the demo on one monitor and edit the envelopes in the other &#8211; just like in a convenient DAW. (That hissing sound you just heard was the Ableton camp. Heh heh.) So for that I needed my docking panes to be able to leave the main window and maximize on the other screen.</p>
<div id="attachment_1513" class="wp-caption alignright" style="width: 330px"><a href="http://www.displayhack.org/wp-content/uploads/machine_toolsplines.png" rel="lightbox[1492]"><img class="size-midthumb wp-image-1513" title="Machine_ToolSplines" src="http://www.displayhack.org/wp-content/uploads/machine_toolsplines-320x200.png" alt="" width="320" height="200" /></a>
<p class="wp-caption-text">2012.02.19 &#8211; The basic spline editor.</p>
</div>
<p>Another reason I enjoyed MFC was the library perks of the <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">Document/View model</a> &#8211; anything that keeps me from having to manage stuff like &#8220;Do you want to save the changes?&#8221; and the clipboard and keyboard shortcuts and loading bars and the whole New Document business is a bliss. To peek ahead a few weeks, somewhere down the line I occasionally found myself working with multiple UDS project files to cut down loading time and then just eventually manually merging them, all thanks to the fact that I was able to do a &#8220;New Document&#8221; trick fairly fast. (And yes, some of this sounds like an epiphany of a 3 year old finally figuring out how a toilet works, but hey. As said, it&#8217;s been years.)</p>
<p>The first iterations of the tool were obviously puritanical, but I wanted the idea to be clear from the word go &#8211; the View has a rendering window in the middle, rendering in the exact same resolution the demo is running in (optimally &#8211; resolutions can vary but there&#8217;s always an intended one, in this case 720p), and everything else is in panes, toolbars, menus, keyboard shortcuts, etc. One positive thing about MFC (and WINAPI in general, I guess) is that it encourages redundancy in GUI: if you have a menu item, you can immediately add it to the toolbar, assign an accelerator, and so on. It&#8217;s free, and it makes the GUI adapt the user instead of the other way around.</p>
<p>Now, this isn&#8217;t strictly code-related, but it&#8217;s worth mentioning that I noticed an interesting trick a few days into the development: I worked better, when I left basic stuff unfinished at the end of the day. My reasoning for this was that if I&#8217;ve done a 100% job that day, the next day I&#8217;d sit down in front of Visual Studio, and spend time wondering how to jump into the next task; I would start to procrastinate. However, when leaving really run-of-the-mill stuff unfinished, I would often spend the next day thinking about how I will solve a particular solution, and by the time I got home, I just jumped into the project and fixed the problem, and essentially carried on working without losing momentum. This worked best when the problem at hand was as simple as it gets: reproducible crash bugs, broken colors, textures being upside down, stuff you&#8217;re able to debug and fix in your sleep. But because they&#8217;re so easy, you don&#8217;t feel as if there&#8217;s a mountain to climb for the next task; by the time you fixed it, you&#8217;re &#8220;warmed up&#8221; and ready for the next big chunk. I highly recommend it if you feel that you&#8217;re able to lose motivation in democoding.</p>
<p>After I reached a satisfying stage with the basic envelope GUI, I switched to the next step: the underlying engine.</p>
<h3>The engine</h3>
<p>I had a pretty good idea from the get-go of what I wanted my engine to achieve, both as far as timing and compositing goes and as far as rendering goes:</p>
<p>For each &#8220;effect&#8221;:</p>
<ol>
<li>Load some sort of standard mesh format</li>
<li>Use incoming splines to animate camera, light and meshes</li>
<li>Render in multiple passes, perform <a href="http://en.wikipedia.org/wiki/Compositing">compositing</a></li>
</ol>
<div id="attachment_1520" class="wp-caption alignright" style="width: 330px"><a href="http://www.displayhack.org/wp-content/uploads/machine_enginenormals.png" rel="lightbox[1492]"><img class="size-midthumb wp-image-1520" title="Machine_EngineNormals" src="http://www.displayhack.org/wp-content/uploads/machine_enginenormals-320x200.png" alt="" width="320" height="200" /></a>
<p class="wp-caption-text">2012.02.21 &#8211; FK in action, rendering normals.</p>
</div>
<p>Step one used to be a huge pain; my first demos used to use 3DS files, but they&#8217;re a bit outdated by now, and they&#8217;ve always been a bit of a nuisance to handle. Later I made my own file format using Flexporter, a step above 3DS files but still a fairly dodgy solution: you&#8217;re using middleware to create even more middleware &#8211; things just go wrong. Finally, I attempted to write my own exporter, and that just ended up being torturous, because of the intricacies of the tools&#8217; inner workings. At around 2007, as a result of this, I spectacularly gave up trying to create a content-pipeline, and with it, making demos.</p>
<p>Revelation came in the form of <a href="http://www.pouet.net/topic.php?which=8334">a set of Pouët posts</a> talking about a library called ASSIMP, a 3D mesh loader library that takes dozens of known 3D formats and loads them into a unified data structure. Not only that, but it&#8217;s also able to do a bunch of really cool transformations on it, and it comes with a set of fun little tools to test your meshes as well. I took a look at the API, and I was sold immediately. I did some tests, and it worked so well that I decided to start integrating it into the engine with newfound enthusiasm.</p>
<p>Of course, it wasn&#8217;t all fun and games &#8211; the 3DS loader in ASSIMP is still kinda broken, but the COLLADA importer works. The COLLADA exporter for MAX, however, is rather lacking. The solution in this case was <a href="http://opencollada.org/">OpenCOLLADA</a>, a unified exporter for MAX and Maya, which is slightly improved. A weird thing I noticed is that I had to flip my cameras around to get them to face the right way &#8211; this might be a bug in my code, but unfortunately ASSIMP&#8217;s reference viewer doesn&#8217;t use cameras, so I have no way to check. In any case, with the loader slowly creeping in the engine, and step 2 already mentioned above (splines and envelopes &#8211; I&#8217;m jumping a bit in chronology here), I was ready to tackle step 3.</p>
<p>Over the years I&#8217;ve done some intermediate rendering stuff, but I never really built a comprehensive engine where everything was combined with everything, and this time I really wanted to do something that &#8220;just works&#8221;. My wishlist was simple:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Forward_kinematics">Forward kinematics animation</a>. This is easy on paper, comes from step 1, but of course the whole row-major/column-major/nodegraph/LHS/RHS matrix quagmire can take up a bit of time to sort out.</li>
<li>&#8220;Correct&#8221; lighting, i.e. lighting done in the tool, and not the usual &#8220;it looks kinda okay if I change this to 0.5&#8243; debacle.</li>
<li><a href="http://en.wikipedia.org/wiki/Normal_mapping">Normal maps</a>. I&#8217;m a huge sucker for bump maps, and I&#8217;m sure I&#8217;ll die happy if they&#8217;re the last thing I see.</li>
<li><a href="http://en.wikipedia.org/wiki/Motion_blur">Motion blur</a>. Ever since the <a href="http://www.pouet.net/prod.php?which=50483">Realtime Generation invitation</a> I&#8217;ve been infatuated with realtime motion blur, because I realized what a nice subtle film-like quality it adds to everything.</li>
<li><a href="http://en.wikipedia.org/wiki/Shadow_mapping">Shadowing</a>. Again, not a big thing, but it does make a considerable difference.</li>
</ul>
<div id="attachment_1521" class="wp-caption alignright" style="width: 330px"><a href="http://www.displayhack.org/wp-content/uploads/machine_engineshadow.png" rel="lightbox[1492]"><img class="size-midthumb wp-image-1521" title="Machine_EngineShadow" src="http://www.displayhack.org/wp-content/uploads/machine_engineshadow-320x200.png" alt="" width="320" height="200" /></a>
<p class="wp-caption-text">2012.02.24. &#8211; Shadow maps up and running.</p>
</div>
<p>This all doesn&#8217;t sound like a big thing, but I wasn&#8217;t sure how to manage all of this, as far as rendering order, render targets, etc go. The first &#8220;a-ha!&#8221; moment came when I started looking into <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb206299%28v=vs.85%29.aspx">D3DXEffect</a>. Granted, after about 7-8 years of it being released, perhaps it was bloody time, but I guess I was always wary of particularly high level stuff. This time, it came like a breath of fresh air &#8211; all the tedious pass management is in there and more. The only problem was render targets.</p>
<p>Luckily, I came across a little note in the SDK about <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb206299%28v=vs.85%29.aspx#Add_Information_to_Effect_Parameters_with_Annotations">annotations</a>. Annotations are essentially meta-data that allows the coder to assign variables and values to passes, and then read them back once the pass is running. This gave me the freedom I needed; I built my little system like so:</p>
<ul>
<li>During initialization, the effect plugin builds the required render targets and depth buffers, and stores them in a <a href="http://en.wikipedia.org/wiki/Associative_array">dictionary</a>, designated by some sort of identifier e.g. &#8220;shadowmap&#8221; or &#8220;velocitybuffer&#8221;. (Later I built a facility where the effects would be able to request render targets from the engine core, and the core would either allocate a new one or hand out one of the older ones, depending on the parameters. This cut down on the video memory usage considerably.)</li>
<li>The .fx file is built in a way that all the passes designate which buffer they want to render to. The actual rendering code then loops through the passes, sets up the render target, and pushes out all the draw calls. Also, since I designed .fx files to be handled as resources, I was able to switch between them easily during editing, changing one rendering chain to another.</li>
<li>Because I wanted to do some compositing / VFX / etc., I extended this by adding another flag to specify whether the current pass is a &#8220;scene&#8221;-pass or a &#8220;post-processing&#8221;-pass. In the latter case, instead of pushing out the scene&#8217;s 3D geometry, the engine would simply render a 2D quad, and I&#8217;d be able to use the results of the previous passes as input.</li>
</ul>
<p>Down the line, I also realized that if I wanted to integrate &#8220;hard-code&#8221; effects into the chain, I could just insert a pass where I render the geometry, and specify an annotation that e.g. I want to render the color pass into a certain buffer, but I want to use the depth values of the previous render. That way, my &#8220;effect&#8221; would be correctly occluded by the geometry around it.</p>
<p>To this end, I even introduced flags to specify that during certain passes, while the setup of the matrices would remain the same, the effect would &#8220;skip&#8221; rendering the 3D scene-graph and instead would render the custom effect code. Additionally, I subclassed my renderer, and made sure that all the &#8220;custom&#8221; code would remain in a separate class &#8211; this wasn&#8217;t necessary, but it made sure that my actual engine code remained lean and effective, and more importantly, reusable.</p>
<p>An example &#8220;technique&#8221; for one of the custom passes would end up looking something like this:</p>
<pre class="brush: hlsl; title: ; notranslate">technique StandardRender
{
  pass passShadow&lt;string renderTarget=&quot;shadow&quot;;&gt;
  {
    AlphaBlendEnable = false;
    vertexShader = compile vs_2_0 vsDepthToColor();
    pixelShader  = compile ps_2_0 psDepthToColor();
  }
  pass passBlobObjectsShadow&lt;bool blobs=true; string clear=&quot;&quot;; string renderTarget=&quot;shadow&quot;;&gt;
  {
    vertexShader = compile vs_2_0 vsDepthToColor();
    pixelShader  = compile ps_2_0 psDepthToColor();
  }
  pass passVelocity&lt;string renderTarget=&quot;velocitybuffer&quot;;&gt;
  {
    vertexShader = compile vs_2_0 vsVelocity();
    pixelShader  = compile ps_2_0 psVelocity();
  }
  pass passBlobObjectsVelocity&lt;bool blobs=true; string clear=&quot;&quot;; string renderTarget=&quot;velocitybuffer&quot;;&gt;
  {
    vertexShader = compile vs_2_0 vsVelocity();
    pixelShader  = compile ps_2_0 psVelocity();
  }
  pass passRender&lt;string renderTarget=&quot;colorbuffer&quot;;&gt;
  {
    vertexShader = compile vs_3_0 vsRender();
    pixelShader  = compile ps_3_0 psRender();
  }
  pass passBlobObjects&lt;bool blobs=true; string clear=&quot;color&quot;; string renderTarget=&quot;blobbuffer&quot;; string depthTarget=&quot;colorbuffer&quot;;&gt;
  {
    vertexShader = compile vs_3_0 vsRenderBlobObjects();
    pixelShader  = compile ps_3_0 psRenderBlobObjects();
  }
  pass passBlur&lt;bool postProcess=true; string renderTarget=&quot;blurbuffer&quot;;&gt;
  {
    vertexShader = compile vs_3_0 vsPostProcess();
    pixelShader  = compile ps_3_0 psBlur( 2.0, samBlobmap );
  }
  pass passBlur2&lt;bool postProcess=true; string renderTarget=&quot;blur2buffer&quot;;&gt;
  {
    vertexShader = compile vs_3_0 vsPostProcess();
    pixelShader  = compile ps_3_0 psBlur( 4.0, samBlurmap );
  }
  pass passBlur3&lt;bool postProcess=true; string renderTarget=&quot;blurbuffer&quot;;&gt;
  {
    vertexShader = compile vs_3_0 vsPostProcess();
    pixelShader  = compile ps_3_0 psBlur( 8.0, samBlur2map );
  }
  pass passComposite&lt;bool postProcess=true; string renderTarget=&quot;backbuffer&quot;;&gt;
  {
    vertexShader = compile vs_2_0 vsPostProcess();
    pixelShader  = compile ps_2_0 psComposite();
  }
}</pre>
<p>Nice and clean, and more importantly: doesn&#8217;t require touching the source.</p>
<div id="attachment_1522" class="wp-caption alignright" style="width: 330px"><a href="http://www.displayhack.org/wp-content/uploads/machine_enginecomposite.png" rel="lightbox[1492]"><img class="size-midthumb wp-image-1522" title="Machine_EngineComposite" src="http://www.displayhack.org/wp-content/uploads/machine_enginecomposite-320x200.png" alt="" width="320" height="200" /></a>
<p class="wp-caption-text">2012.02.26. &#8211; Motion blur and lighting.</p>
</div>
<p>As far as the actual shading/effects go, I chose simple methods: I restricted myself to a single spotlight source (which worked well with the concept I had in mind), so I was able to do rudimentary <a href="http://http.developer.nvidia.com/GPUGems/gpugems_ch11.html">PCF shadow mapping</a>, which is jaggy as hell, but for some reason it worked really well with the gritty textures I was making. For normal maps, I used simple hand-painted stuff, and ran them through <a href="http://developer.nvidia.com/nvidia-texture-tools-adobe-photoshop" class="broken_link">NVIDIA&#8217;s Texture Tools</a>. For the motion blur, I used basic <a href="http://http.developer.nvidia.com/GPUGems3/gpugems3_ch27.html">velocity buffering</a>, which I achieved by doubling all my matrices: before I render anything, I pre-transform all my node matrices according to my animation values. (Since the cameras and lights are all just nodes in the scene-graph, these also transform with it for free and come with all sorts of fun perks &#8211; but more on this later.) Then I do another transformation calculation, but with my epsilon value subtracted from my animation timer. This will give me two matrices for each draw call, one being slightly behind in time compared to the other. Then for the velocity pass, I simply calculate their screen-space position and calculate their difference vector, which I store into an D3DFMT_G32R32F buffer, and then use that later as a directional blur input. This method is obviously not perfect, but my assumption was that motion blur is only visible when there&#8217;s fast motion, so while it doesn&#8217;t necessarily look good on a screenshot, in motion it does give that subtle film-like feel to the demo which I was looking for.</p>
<p>So I had my basic engine and tool-chain ready. It was time to sit down and come up with what I considered the hard part: content.</p>
<p><em>[to be continued, in theaters near you]</em></p>
 <p><a href="http://www.displayhack.org/?flattrss_redirect&amp;id=1492&amp;md5=11559c96f647af2ef0de78106e1a4985" title="Flattr" target="_blank"><img src="http://www.displayhack.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/displayhack/~4/y3ykKyYq71U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.displayhack.org/2012/making-the-machine-part-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=displayhack&amp;popout=1&amp;url=http%3A%2F%2Fwww.displayhack.org%2F2012%2Fmaking-the-machine-part-1%2F&amp;language=en_GB&amp;category=text&amp;title=Making+the+Machine+%26%238211%3B+part+1&amp;description=Preamble+In+hopes+that+most+people+enjoy+makingof%26%238217%3Bs+as+much+as+I+do%2C+the+following+series+of+articles+would+be+an+attempt+to+describe+the+creation+process+of+my+Revision...&amp;tags=behind+the+scenes%2Cdemoscene%2CGPU%2Cmaking%2Cmodelling%2Cprogramming%2Cseries%2Cslider%2Ctechniques%2Cwindows%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.displayhack.org/2012/making-the-machine-part-1/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=making-the-machine-part-1</feedburner:origLink></item>
		<item>
		<title>The great demoscene sourcecode giveaway</title>
		<link>http://feedproxy.google.com/~r/displayhack/~3/3TVgI6gQ1GI/</link>
		<comments>http://www.displayhack.org/2012/the-great-demoscene-sourcecode-giveaway/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 16:05:46 +0000</pubDate>
		<dc:creator>Bent Stamnes</dc:creator>
				<category><![CDATA[Collections]]></category>
		<category><![CDATA[Features]]></category>
		<category><![CDATA[Frontpage]]></category>
		<category><![CDATA[demoscene]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[sourcecode]]></category>

		<guid isPermaLink="false">http://www.displayhack.org/?p=1447</guid>
		<description><![CDATA[Something really interesting started happening a few days ago, when the well-known demoscene group Farbrausch released the source codes for most of their projects and tools, including the coveted Werkkzeug 3 demo-making tool, as well as their compression techniques and the V2 software synthesizer. This extremely cool action seemed to trigger what can almost be ]]></description>
				<content:encoded><![CDATA[<p style="text-align: left;">Something really interesting started happening a few days ago, when the well-known demoscene group <a href="http://farbrausch.de/">Farbrausch</a> released the source codes for most of their projects and tools, including the coveted Werkkzeug 3 demo-making tool, as well as their compression techniques and the V2 software synthesizer.</p>
<p>This extremely cool action seemed to trigger what can almost be described as &#8220;an avalanche of sources&#8221; because other demo groups and individuals started following their lead. Since this happened in various places online and in different shapes and forms, we decided that the best thing to do would be to simply collect all of them in a single post.</p>
<h3>The source code packs</h3>
<p>Below you can find links to the different source code packs as released by the various groups, plus links to example demos from each group. Enjoy!</p>
<h4>Farbrausch</h4>
<p>Known for both 64k intros as well as demos, this German group has released the sources for their demo tool and many of their productions, including the now famous Kkrieger &#8212; the 96k 1st person shooter game.</p>
<p><strong>Included productions:</strong> <a href="http://www.pouet.net/prod.php?which=4484">fr-013: flybye</a>, <a href="http://www.pouet.net/prod.php?which=5571">fr-022: ein.schlag</a>, <a href="http://www.pouet.net/prod.php?which=8367">fr-029: dopplerdefekt</a>, <a href="http://www.pouet.net/prod.php?which=8696">fr-024: welcome to&#8230;</a>, <a href="http://www.pouet.net/prod.php?which=9424">fr-030: candytron</a>, <a href="http://www.pouet.net/prod.php?which=15092">fr-038: theta</a>, <a href="http://www.pouet.net/prod.php?which=30244">fr-043: debris</a> and <a href="http://www.pouet.net/prod.php?which=12036">kkrieger (beta)</a><br />
<strong>Download:</strong> <a title="Farbrausch sources" href="https://github.com/farbrausch/fr_public">Github</a></p>
<h4>Conspiracy</h4>
<p>Hungarian demo group known for their award and competition winning 64k intros. Included are the sources for two versions of their tool &#8212; aDDict and aDDict 2 (<em>Advanced Digital Dynamite Intro Creation Tool</em>).</p>
<p><strong>Included productions:</strong> <a href="http://www.pouet.net/prod.php?which=9438">Project Genesis</a>, <a href="http://www.pouet.net/prod.php?which=10130">A Place Called Universe</a> and <a href="http://www.pouet.net/prod.php?which=25774">Chaos Theory</a>.<br />
<strong>Download:</strong> <a title="Conspiracy sources" href="http://conspiracy.hu/releases/Conspiracy_Source_Pack.zip">ZIP-archive</a></p>
<h4>Excess</h4>
<p>This Norwegian group is known for making demos, and have released the sources for their DX9 graphics engine as well as all demos made using that engine, including their sync tool called GNU Rocket, used to direct them.</p>
<p><strong>Included productions:</strong> <a title="Scyphozoa by Excess" href="http://www.pouet.net/prod.php?which=33721">Scyphozoa</a>, <a title="Regus Ademordna by Excess" href="http://www.pouet.net/prod.php?which=50136">Regus Ademordna</a>, <a title="Easter Guardians by Excess" href="http://www.pouet.net/prod.php?which=56218">Easter Guardians</a>, <a title="Cortex Sous-Vide by Excess" href="http://www.pouet.net/prod.php?which=58005">Cortex Sous-Vide</a>, <a title="GNU Rocket" href="https://github.com/kusma/rocket">GNU Rocket</a> (tool) and <a href="https://github.com/kusma/vlee/tags">more demos made with the same engine</a>.<br />
<strong>Download:</strong> <a title="Excess sources" href="https://github.com/kusma/vlee">Github</a></p>
<h4>Moppi</h4>
<p>Memon of Moppi, the finnish demogroup known for very stylish and trip-hop-ish demos, released the sources for their tool Demopaja. The tool was used in such legendary demos as <a href="http://www.pouet.net/prod.php?which=3286">Gerbera</a> and <a href="http://www.pouet.net/prod.php?which=12031">the Assembly 2004 invitation</a>. Unfortunately, the ZIP-archive does not include the datafiles for these demos, so you won&#8217;t be able to poke around with those, but the tool itself is very nice.</p>
<p><strong>Included productions:</strong> None, but ships with sample effects.<br />
<strong>Download:</strong> <a href="http://digestingduck.blogspot.com.au/2012/04/demopaja-sources.html">Mikko&#8217;s blog</a></p>
<h4>Andromeda Software Development</h4>
<p>Navis of ASD also contributed to the source code giveaway. Now, this piece is perhaps less of a sourcecode giveaway and more of a piece of C code as directed by David Cronenberg. Either way you look at it, it is an interesting peek into the programming mind behind some of the most memorable demos of the last decade.</p>
<p><strong>Included productions:</strong> <a href="http://www.pouet.net/prod.php?which=57446">Spin</a> (well, sort of..)<br />
<strong>Download:</strong> <a href="http://www.asd.gr/%7Enavis/part_start_lines.cpp">part_start_lines.cpp</a></p>
<h3>Anti-virus false positives</h3>
<p>Due to the nature of how demoscene productions often push the limits in terms of compression and algorithmic content, they tend to be flagged by anti-virus software (like Microsoft Security Essentials), but this is <a href="http://scene.org/faq.php#general">simply a false positive</a> due to lack of whitelisting. All of the source code and executables linked to above are absolutely clean, we assure you.</p>
<p>&nbsp;</p>
 <p><a href="http://www.displayhack.org/?flattrss_redirect&amp;id=1447&amp;md5=f76aca503753d138de893d392dea8053" title="Flattr" target="_blank"><img src="http://www.displayhack.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/displayhack/~4/3TVgI6gQ1GI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.displayhack.org/2012/the-great-demoscene-sourcecode-giveaway/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=displayhack&amp;popout=1&amp;url=http%3A%2F%2Fwww.displayhack.org%2F2012%2Fthe-great-demoscene-sourcecode-giveaway%2F&amp;language=en_GB&amp;category=text&amp;title=The+great+demoscene+sourcecode+giveaway&amp;description=Something+really+interesting+started+happening+a+few+days+ago%2C+when+the+well-known+demoscene+group+Farbrausch+released+the+source+codes+for+most+of+their+projects+and+tools%2C+including+the+coveted+Werkkzeug...&amp;tags=demoscene%2Cprogramming%2Cslider%2Csource%2Csourcecode%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.displayhack.org/2012/the-great-demoscene-sourcecode-giveaway/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=the-great-demoscene-sourcecode-giveaway</feedburner:origLink></item>
		<item>
		<title>GenShaders – Part 1</title>
		<link>http://feedproxy.google.com/~r/displayhack/~3/qKJbVVMHu3k/</link>
		<comments>http://www.displayhack.org/2012/genshaders-part-1/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 10:30:15 +0000</pubDate>
		<dc:creator>Cody Brocious</dc:creator>
				<category><![CDATA[Frontpage]]></category>
		<category><![CDATA[Series]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[series]]></category>
		<category><![CDATA[webgl]]></category>

		<guid isPermaLink="false">http://www.displayhack.org/?p=1431</guid>
		<description><![CDATA[I recently embarked on a new experiment which I believe will be of particular interest to the Displayhack audience. I started with a fairly simple question: is it possible to use genetic algorithms to generate coherent, aesthetically pleasing textures? As the idea evolved in my mind and in conversations with friends, I decided to build ]]></description>
				<content:encoded><![CDATA[<p>
I recently embarked on a new experiment which I believe will be of particular interest to the Displayhack audience.<br />
I started with a fairly simple question: <strong>is it possible to use genetic algorithms to generate coherent, aesthetically pleasing textures?</strong></p>
<p>As the idea evolved in my mind and in conversations with friends, I decided to build a simple app to test out the concept and write about it as it progressed.</p>
<p>Before I dive in, give the current version a shot. You can access the bleeding edge at <a href="http://demoseen.com/genshaders/">demoseen.com/genshaders</a> and the current version at <a href="http://demoseen.com/genshaders-1/">demoseen.com/genshaders-1</a> &#8211; I wanted to keep these separate so that you could see where I was at each point.</p>
<div class="alert white">Note: You need a WebGL-friendly browser for this to work.</div>
<h3>First Steps</h3>
<p>My first thought for an interface was a simple 4&#215;3 grid of WebGL canvases. Why WebGL? It&#8217;s easy, fast, and shaders can be used to generate the textures. The design was largely inspired by the Chrome new tab page &#8212; hey, it works!</p>
<p>From there, I had to actually start generating shaders. I decided that the best place to start was doing it purely randomly, so I created a shader builder based on a few simple practices:</p>
<ul>
<li>The code of the shader was gl_FragColor = vec4($genValue$, $genValue$, $genValue$, 1.0); Meaning each value going into the output color was generated separately.</li>
<li>The genValue function &#8212; during shader generation &#8212; would randomly return one of the following:
<ul>
<li>An existing value (initially either the X or Y coord for the current pixel)</li>
<li>A random float</li>
<li>Two other genValue&#8217;d expressions combined with a random arithmetic operation</li>
<li>A genValue&#8217;d expression passed through a function such as sin, cos, tan, sqrt, etc</li>
</ul>
</li>
</ul>
<p>Based on that simple practice, I got some really interesting results:</p>
<p style="text-align: center;"><a href="http://i.imgur.com/nTnwH.png" rel="lightbox[1431]"><img class="aligncenter" src="http://i.imgur.com/nTnwH.png" alt="" width="353" height="172" /></a></p>
<p>But around this time, I realized that my initial concept of this being something that would allow you to drill down to get the exact texture you want, as a standalone tool, was simply not the best way to use this.</p>
<h3>Evolution #1: Time</h3>
<p>I mentioned earlier that genValue could pass back an existing value. Well, the first step I took away from generating static textures was to throw time (as floating point seconds) into the mix. Immediately, shaders that looked completely uninteresting before started looking amazing. Everywhere you looked, there was action. You&#8217;d get everything from old-school plasma effects to amazing shifting colors and rays of light.</p>
<p>Once I saw the effects of this, I decided to expand it. Instead of just floats and unary functions, I created vector creation methods and expanded the function catalog to include binary float functions (e.g. mod, atan, pow). But as the complexity increased, so did the odds of it going off the deep end; it&#8217;d often get into a loop where it was calling genValue/genVec* hundreds of times, recursively and causing stack overflows, or creating shaders so large that they simply wouldn&#8217;t compile. To get around this, I added a level value to each generator function, so that it could keep track of how deep it was in the hierarchy at any point.</p>
<p>One nice thing about having the level value around was that I could point the random generator in the right direction; if I was more than <em>n</em> levels deep, I wouldn&#8217;t generate vectors, for instance, because I knew it was highly likely that they&#8217;d end up tanking the rest of the code. I spent a while just tweaking the values here to get to a place where things compiled quickly and still looked good.</p>
<p>I tried to get a screenshot of this step that really captures what this looks and feels like, but without the animation it really just can&#8217;t be understood. I strongly recommend you take a look at the live demo at this point, if you haven&#8217;t already.</p>
<h3>Next Step</h3>
<p>The next few changes are going to be big ones. Rather than this just being a standalone bit of JS, it&#8217;s going to be attached to a server backend that will keep track of the genome. Everyone going to the site will be working on the same gene pool, so we end up acting as a collective fitness function.</p>
<p>In terms of the interface, it&#8217;s going to be considerably nicer. Rather than the big 4&#215;3 grid, you&#8217;ll be presented with two shaders at a time and asked to choose the one you prefer; think Hot or Not for shaders.</p>
<h3>To Be Continued</h3>
<p>Well, that&#8217;s about it for where I&#8217;m at now. Things are still just random, but I&#8217;m loving what I&#8217;m getting out of it now &#8212; I can only imagine the insane things I&#8217;m going to get once everyone is unleashed on it. I plan on putting out these mini-articles as I work on this, so whether it works or not, you&#8217;ll get to see what I do and hopefully learn something along the way.</p>
 <p><a href="http://www.displayhack.org/?flattrss_redirect&amp;id=1431&amp;md5=380aface09027dfd0f9a8c0d4390a7fe" title="Flattr" target="_blank"><img src="http://www.displayhack.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/displayhack/~4/qKJbVVMHu3k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.displayhack.org/2012/genshaders-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=displayhack&amp;popout=1&amp;url=http%3A%2F%2Fwww.displayhack.org%2F2012%2Fgenshaders-part-1%2F&amp;language=en_GB&amp;category=text&amp;title=GenShaders+%26%238211%3B+Part+1&amp;description=I+recently+embarked+on+a+new+experiment+which+I+believe+will+be+of+particular+interest+to+the+Displayhack+audience.+I+started+with+a+fairly+simple+question%3A+is+it+possible+to...&amp;tags=online%2Cprogramming%2Cseries%2Cwebgl%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.displayhack.org/2012/genshaders-part-1/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=genshaders-part-1</feedburner:origLink></item>
		<item>
		<title>Sculpting In ZBrush 101 – Part 2</title>
		<link>http://feedproxy.google.com/~r/displayhack/~3/-HRaS36J4Ss/</link>
		<comments>http://www.displayhack.org/2012/sculpting-in-zbrush-101-part-2/#comments</comments>
		<pubDate>Thu, 16 Feb 2012 10:10:15 +0000</pubDate>
		<dc:creator>Mathias Tangen Leganger</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Frontpage]]></category>
		<category><![CDATA[Series]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[modelling]]></category>
		<category><![CDATA[sculpting]]></category>
		<category><![CDATA[series]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[techniques]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[zbrush]]></category>

		<guid isPermaLink="false">http://www.displayhack.org/?p=1404</guid>
		<description><![CDATA[Welcome back! In this part we will start sculpting a humanoid character using ZSpheres. ZSpheres is a very useful (and powerful) tool in that it offers you a super-fast and highly flexible way of getting starting the sculpting process (often the hardest part). This means that you don&#8217;t have to create a base mesh in ]]></description>
				<content:encoded><![CDATA[<div class="alert white">Note: this is a series of articles on sculpting in ZBrush. You can <a href="http://www.displayhack.org/2011/sculpting-in-zbrush-101-part-1/‎">find part one here</a>.</div>
<p>Welcome back! In this part we will start sculpting a humanoid character using <a href="http://www.pixologic.com/docs/index.php/ZSpheres">ZSpheres</a>. ZSpheres is a very useful (and powerful) tool in that it offers you a super-fast and highly flexible way of getting starting the sculpting process (often the hardest part). This means that you don&#8217;t have to create a base mesh in a 3D-modeling package first, you can just hit the ground running. So, let&#8217;s get started!</p>
<h3>ZSpheres</h3>
<p>Open the ZBrush application and create a new document. Hit the <em>SimpleBrush</em> icon in the <em>Tool </em>menu, and then the <em>ZSphere</em> icon as shown in the picture below.</p>
<p style="text-align: center;"><a href="http://www.displayhack.org/wp-content/uploads/zsphere-01.jpg" rel="lightbox[1404]"><img class="aligncenter size-full wp-image-1405" src="http://www.displayhack.org/wp-content/uploads/zsphere-01.jpg" alt="" width="316" height="280" /></a></p>
<p>Click and drag with LMB to draw the ZSphere on the canvas. Your screen should look like the picture below. Hit T to enter edit mode. Forget hitting T now and you will draw a new sphere every time you click on the canvas. If your accidentally draw new spheres, hit CTRL+N to clear the canvas, LMB-click-and-drag a new sphere, hit T, and you are OK.</p>
<p style="text-align: center;"><a href="http://www.displayhack.org/wp-content/uploads/zsphere-02.png" rel="lightbox[1404]"><img class="aligncenter size-full wp-image-1406" src="http://www.displayhack.org/wp-content/uploads/zsphere-02.png" alt="" width="318" height="283" /></a></p>
<p>The red ball you have no drawn on the canvas is your root ZSphere, to which you now can add new ZSpheres (in a tree-like structure that branches out from the root). All you have to do is add new spheres, and adjust the position, scale, and rotation of each while looking at your shape from different angles. Your goal is to create a structure in this manner that resembles a basic foundation for the shape you have in mind, which you will use for starting the sculpting process.</p>
<p>Here are the actions you need to create a base mesh using ZSpheres:</p>
<ul>
<li><strong>Add new sphere:</strong> Hit Q to draw sphere. LMB-click-and-drag on a location on the sphere where you want to add a new one. Hold SHIFT if you want the new sphere to have the same size as its parent.</li>
<li><strong>Delete sphere: </strong>Hit ALT+LMB.</li>
<li><strong>Move sphere: </strong>Hit W to move sphere.</li>
<li><strong>Scale sphere:</strong> Hit E to resize.</li>
<li><strong>Rotate sphere:</strong> Hit R to rotate.</li>
<li><strong>Enable symmetry: </strong>Hit X.</li>
<li><strong>Preview: </strong>Hit A to preview the result.</li>
</ul>
<p>So, as I said the the beginning, we&#8217;re going to sculpt a humanoid character. The way to do that is to use ZSpheres to create a shape like the one on the left in the picture below, and then proceed to make ZBrush convert the ZSphere object into a polygon mesh for sculpting (shown to the right).</p>
<p style="text-align: center;">
<h3>The process</h3>
<p>To create a base mesh using ZSpheres, you can use the following steps and repeat until you are satisfied with how your preview looks:</p>
<ol>
<li>Add a new sphere on an existing one (or create a root sphere).</li>
<li>Move, scale, or rotate this new sphere while looking at your mesh from all views. (Enable symmetry if needed.)</li>
</ol>
<p>The picture below demonstrates the process used for creating a humanoid shape. (Remember to look at the object from all sides and not only the front view!)</p>
<p style="text-align: center;"><a href="http://www.displayhack.org/wp-content/uploads/zsphere-04-1024x405.png" rel="lightbox[1404]"><img class="aligncenter size-large wp-image-1412" src="http://www.displayhack.org/wp-content/uploads/zsphere-04-1024x405.png" alt="" width="614" height="243" /></a></p>
<p style="text-align: left;">OK, so you have followed the process through several iterations and are satisfied with the preview. Time to convert to polygons!<br />
Navigate to <em>Adaptive skin</em> in the <em>Tool</em> menu and hit <em>Make adaptive skin</em>. The polygon mesh will now be added to your tool menu, named <em>Skin_&#8230;</em> Select it and start sculpting! :)</p>
<p style="text-align: center;"><a href="ttp://www.displayhack.org/wp-content/uploads/zsphere-05.png" rel="lightbox[1404]"><img class="aligncenter size-full wp-image-1413" src="http://www.displayhack.org/wp-content/uploads/zsphere-05.png" alt="" width="422" height="367" /></a></p>
<p>That concludes this part. Feel free to add comments or pictures of your works in the <a href="http://www.displayhack.org/forums/topic/sculpting-in-zbrush/">forums</a>. Have fun sculpting! :)</p>
 <p><a href="http://www.displayhack.org/?flattrss_redirect&amp;id=1404&amp;md5=26984c55b06aadfeb7163405b9c4ea19" title="Flattr" target="_blank"><img src="http://www.displayhack.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/displayhack/~4/-HRaS36J4Ss" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.displayhack.org/2012/sculpting-in-zbrush-101-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=displayhack&amp;popout=1&amp;url=http%3A%2F%2Fwww.displayhack.org%2F2012%2Fsculpting-in-zbrush-101-part-2%2F&amp;language=en_GB&amp;category=text&amp;title=Sculpting+In+ZBrush+101+%26%238211%3B+Part+2&amp;description=Welcome+back%21+In+this+part+we+will+start+sculpting+a+humanoid+character+using+ZSpheres.+ZSpheres+is+a+very+useful+%28and+powerful%29+tool+in+that+it+offers+you+a+super-fast+and...&amp;tags=modelling%2Csculpting%2Cseries%2Cslider%2Ctechniques%2Ctutorial%2Czbrush%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.displayhack.org/2012/sculpting-in-zbrush-101-part-2/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=sculpting-in-zbrush-101-part-2</feedburner:origLink></item>
		<item>
		<title>Sculpting In ZBrush 101 – Part 1</title>
		<link>http://feedproxy.google.com/~r/displayhack/~3/7bF7jp1GC8g/</link>
		<comments>http://www.displayhack.org/2011/sculpting-in-zbrush-101-part-1/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 18:24:36 +0000</pubDate>
		<dc:creator>Mathias Tangen Leganger</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Frontpage]]></category>
		<category><![CDATA[Series]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[modelling]]></category>
		<category><![CDATA[sculpting]]></category>
		<category><![CDATA[series]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[techniques]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[zbrush]]></category>

		<guid isPermaLink="false">http://www.displayhack.org/?p=1260</guid>
		<description><![CDATA[Hi and welcome to this series on sculpting in Pixologic ZBrush. In this series, we will investigate some of the game-changing techniques that have made ZBrush so popular among digital artists. First, a quick primer on what ZBrush is. ZBrush is a digital sculpting and painting application (Autodesk Mudbox is another software package that offers ]]></description>
				<content:encoded><![CDATA[<p style="text-align: center"><img class="aligncenter size-large wp-image-1295" src="http://www.displayhack.org/wp-content/uploads/dh_zbrush101_p1_worksnap-1024x627.png" alt="" width="540" height="331" /></p>
<p>Hi and welcome to this series on sculpting in <a href="http://www.pixologic.com/zbrush/features/zbrush4/overview/">Pixologic ZBrush</a>. In this series, we will investigate some of the game-changing techniques that have made ZBrush so popular among digital artists.</p>
<p>First, a quick primer on what ZBrush is. ZBrush is a digital sculpting and painting application (<a href="http://usa.autodesk.com/adsk/servlet/pc/index?id=13565063&amp;siteID=123112">Autodesk Mudbox</a> is another software package that offers similar capabilities). 3D sculpting means that you work on &#8220;digital clay&#8221;. You start out with a clay-like basic shape, like a sphere, and then you use a set of brushes to &#8220;sculpt&#8221; that clay. What makes ZBrush so powerful is that you can work on millions of polygons. In short, 3D sculpting is a very efficient and fun way to create high-polygon 3D models and/or normal-maps.</p>
<p>OK, enough with the sales pitch: let&#8217;s get to it!</p>
<p>There are basically two ways to start sculpting in ZBrush. One: make a simple &#8220;base mesh&#8221; in an external 3D application (such as Maya). Two: start with a simple shape or ZSpheres. ZSpheres are very cool, and we will save them for a later tutorial. In this part of the series we will start by importing a base mesh from Maya. You can refer to this <a href="http://www.displayhack.org/2011/maya101-1/">tutorial</a> if you need a refresher on Maya.</p>
<h3>Creating a base mesh</h3>
<p>There are basically three criteria for the base mesh:</p>
<ol>
<li>Keep it simple</li>
<li>Shape it into a very abstract representation of your design</li>
<li>Make sure the mesh is clean and quads only</li>
</ol>
<p>So, you may either have some concept drawings or a mental image as reference for your design. Then, block out a simple mesh in Maya that resembles that design, using only a handful of polygons. Now, this is very important: keep it clean and all quads. You will face quirky problems in ZBrush if your mesh does not satisfy this condition. All quads means that each polygon should have four edges (this has to do with the subdivison algorithms in ZBrush). Also: the mesh should not contain any holes, gaps, overlapping vertices or polygons with flipped normals. A good reference might be the section on <a href="http://www.displayhack.org/2011/maya101-1/">cleaning up the mesh</a> in my Maya tutorial series.</p>
<p>In the image below, I have created a base mesh for &#8220;Headmistress Daggerhorn&#8221;, which is one of the key characters featured in the game <a href="http://www.eviljunior.com/" class="broken_link">Evil Junior</a> which I&#8217;m currently working on. It was created on top of great concept art from <a href="http://www.atleart.com/">Atle Mæland</a> as the reference.</p>
<p style="text-align: center"><img class="aligncenter size-full wp-image-1263" src="http://www.displayhack.org/wp-content/uploads/dh_zbrush101_p1_maya_01.png" alt="" width="211" height="270" /></p>
<p style="text-align: left">Create your own base mesh, and then export your base mesh as .OBJ in Maya. Brace for impact in ZBrush!</p>
<h3 style="text-align: left">Intro to ZBrush</h3>
<p>Time to open ZBrush. Hit &#8220;Import&#8221; in the tool menu and browse to your .OBJ base-mesh. &#8220;Draw&#8221; your base mesh onto the canvas by click-dragging in the viewport. Then hit &#8220;T&#8221; to edit the object.</p>
<p>Now, a brief heads-up on the ZBrush interface (see the picture below). To your right you will find the &#8220;Tool&#8221; and &#8220;Geometry&#8221; menu. Current brushes and materials are located to the left. Here is what you need to know:</p>
<ul>
<li><strong>Tool: </strong>Here you &#8220;Import&#8221; your base mesh. You save your work as ZTools by hitting &#8220;Save As&#8221;. Saved ZTools are loaded with &#8211; surprise! &#8211; &#8220;Load Tool&#8221;.</li>
<li><strong>SubTool: </strong>You can also import several sub tools and append them to your main tool, so that you can more easily hide and select individual objects on screen.</li>
<li><strong>Geometry: </strong>ZBrush &#8220;subdivides&#8221; your mesh when you hit &#8220;Divide&#8221;. Each division operation adds resolution to your mesh, measured as the number of &#8220;active points&#8221; in the HUD of the viewport. You can easily jump between subdivision levels by hitting &#8220;Lower Res&#8221; and &#8220;Higher Res&#8221;.</li>
<li><strong>Brush and material:</strong> Here you can edit your current settings for brushes and materials.</li>
</ul>
<p style="text-align: center"><img class="aligncenter" src="http://www.displayhack.org/wp-content/uploads/dh_zbrush101_p1_zbrush_01.png" alt="" width="406" height="381" /></p>
<p>ZBrush both looks and feels like something out of this world. (You will probably either love or hate the interface.) I would highly recommend you to use a pressure-sensitive pen and tablet for sculpting in ZBrush. Here is how to navigate:</p>
<ul>
<li><strong>Sculpt:</strong> LMB onto the mesh.</li>
<li><strong>Smooth:</strong> SHIFT+LMB onto the mesh.</li>
<li><strong>Quick-menu:</strong> RMB.</li>
<li><strong>Move: </strong>ALT+LMB in the background.</li>
<li><strong>Rotate:</strong> LMB in the background.</li>
<li><strong>Zoom:</strong> ALT+LMB in the background, then release ALT and hold LMB.</li>
<li><strong>Snap rotation into orthogonal view: </strong>Rotate and then hold SHIFT.</li>
</ul>
<p>Here are a few hints to kickstart the sculpting process:</p>
<ul>
<li><strong>Symmetry. </strong>Hit &#8220;X&#8221; to enable automatic mirroring.</li>
<li><strong>LazyMouse: </strong>Hit <em>Stroke -&gt; LazyMouse </em>to enable computer-aided stability to your strokes. Hands like a surgeon!</li>
<li><strong>Brushes: </strong>Some brushes you may find useful are the <em>Standard</em>, <em>Smooth</em>, <em>Move</em>, <em>mPolish</em>, and <em>Slash</em> brushes.</li>
<li><strong>Strokes and alphas: </strong>Try experimenting with these to customize your brushes. You can add high-res details by painting an alpha in Photoshop and then apply it to your mesh using the <em>Drag Rect</em> stroke.</li>
<li><strong>Material: </strong>Try using other materials other than the very &#8220;ZBrushish&#8221; <em>MatCap Red. </em>All the MatCap materials are good. Switch between them to apply different effects to your mesh. <em><br />
</em></li>
<li><strong>Iterate: </strong>This is perhaps the most important thing in ZBrush. Only subdivide your mesh when you have maxed-out the current level of resolution. Iterate and add more detail for each subdivision level.</li>
<li><strong>Reference: </strong>The use of reference (anatomy guides, bodybuilding magazines, images on the web) can make all the difference. Study the anatomy of bones and muscle if you find the time. Be aware of nudity though.</li>
<li><strong>Masking:</strong> Hit CTRL+LMB or ALT+LMB onto the mesh to paint masks. Very powerful for adding details. You have more options under the &#8220;Masking&#8221; menu.</li>
</ul>
<h3>Basic sculpting in ZBrush</h3>
<p>The sculpting process in ZBrush is actually very simple. It all boils down to iteration. In the beginning of the sculpting process, try using the <em>Move</em> brush to drag the mesh into the shape you want. You can also ALT+LMB with this brush to push or pull. When you are satisfied with the overall shape, use the <em>Standard </em>brush with LMB and ALT+LMB to paint detail at the surface. Use the <em>Smooth </em>brush in between to make the surface nice and clean. (You may want to dial down the brush modifier on the <em>Smooth </em>brush to make it less sensitive.) When you are happy with your sculpting at this level, subdivide and repeat the sculpting process. You can keep on subdividing like this till you drop &#8211; or more probably &#8211; you run out of RAM. Two million polygons should suffice &#8211; any more than that and your RAM will probably choke. As I gradually add more and more resolution for each iteration, I tend to use the brushes in the following manner:</p>
<ul>
<li><strong>Move</strong>: I use this mostly at low resolutions to pull and push the clay into shape.</li>
<li><strong>Standard</strong>: This brush I tend to use at all resolutions, gradually decreasing the brush size for each subdivision.</li>
<li><strong>Smooth</strong>: I use this ALL the time.</li>
<li><strong>mPolish</strong>: Great to use at higher resolutions to flatten out a surface. Especially if you aim for a cartoony look.</li>
<li><strong>Slash</strong>: At very high resolutions you can use this brush to add scars and such.</li>
<li><strong>Pinch</strong>: Very nice for pulling two edges towards each other, for example if you want to &#8220;tighten&#8221; a scar.</li>
</ul>
<p>In the picture below you can see how Daggerhorn takes shape from a simple base mesh to a high-ploygon bust of the Headmistress of Gloomcraft Academy.</p>
<p><span><a href="http://www.displayhack.org/2011/sculpting-in-zbrush-101-part-1/dh_zbrush101_p1_zbrush_process/" rel="attachment wp-att-1283"><img class="aligncenter size-medium wp-image-1283" src="http://www.displayhack.org/wp-content/uploads/dh_zbrush101_p1_zbrush_process-543x250.png" alt="" width="543" height="250" /></a></span></p>
<h3>That&#8217;s it</h3>
<p>Piece of cake. Now, post an image of your sculpt in the <a href="http://www.displayhack.org/forums/forum/gallery/">gallery</a> and stay tuned for the next installment! See you around :)</p>
<p>Oh, and one last thing: Here is an all-exclusive and yet unreleased work-in-progress of Headmistress Daggerhorn from <a href="http://www.eviljunior.com/" class="broken_link">Evil Junior</a>!</p>
<p style="text-align: center"><img class="aligncenter size-large wp-image-1288" src="http://www.displayhack.org/wp-content/uploads/dh_zbrush101_p1_zbrush_dhorn-1024x650.png" alt="" width="614" height="390" /></p>
 <p><a href="http://www.displayhack.org/?flattrss_redirect&amp;id=1260&amp;md5=f99c31ecfd9926c9573fecf0586547f0" title="Flattr" target="_blank"><img src="http://www.displayhack.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/displayhack/~4/7bF7jp1GC8g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.displayhack.org/2011/sculpting-in-zbrush-101-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=displayhack&amp;popout=1&amp;url=http%3A%2F%2Fwww.displayhack.org%2F2011%2Fsculpting-in-zbrush-101-part-1%2F&amp;language=en_GB&amp;category=text&amp;title=Sculpting+In+ZBrush+101+%26%238211%3B+Part+1&amp;description=Hi+and+welcome+to+this+series+on+sculpting+in+Pixologic+ZBrush.+In+this+series%2C+we+will+investigate+some+of+the+game-changing+techniques+that+have+made+ZBrush+so+popular+among+digital...&amp;tags=modelling%2Csculpting%2Cseries%2Cslider%2Ctechniques%2Ctutorial%2Czbrush%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.displayhack.org/2011/sculpting-in-zbrush-101-part-1/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=sculpting-in-zbrush-101-part-1</feedburner:origLink></item>
		<item>
		<title>Superpacking JS demos</title>
		<link>http://feedproxy.google.com/~r/displayhack/~3/sWFTWiY_k40/</link>
		<comments>http://www.displayhack.org/2011/superpacking-js-demos/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 07:55:55 +0000</pubDate>
		<dc:creator>Cody Brocious</dc:creator>
				<category><![CDATA[Frontpage]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[1k]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[techniques]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[webgl]]></category>

		<guid isPermaLink="false">http://www.displayhack.org/?p=1211</guid>
		<description><![CDATA[The techniques I&#8217;m going to be describing here were created and/or implemented to pack my entry to the Mozilla Demoparty: Magister. Huge thanks to my friend Nicolás Alvarez for helping squeeze every last byte out of this. Getting started So you have a demo in JS. It&#8217;s pretty. It&#8217;s perfect. It&#8217;s 3k in a 1k competition. Well, ]]></description>
				<content:encoded><![CDATA[<p>The techniques I&#8217;m going to be describing here were created and/or implemented to pack my entry to the <a href="https://demoparty.mozillalabs.com/">Mozilla Demoparty</a>: <a href="http://pouet.net/prod.php?which=57308">Magister</a>. Huge thanks to my friend Nicolás Alvarez for helping squeeze every last byte out of this.</p>
<h3>Getting started</h3>
<p>So you have a demo in JS. It&#8217;s pretty. It&#8217;s perfect. It&#8217;s 3k in a 1k competition. Well, damn.</p>
<p>You start with the obvious and run it through a minifier and you shorten all your variable names to a single character, you get it to 2500 bytes. Great, that&#8217;s progress, but you&#8217;ve still got 1476 bytes to go. You merge some functions together, fold a couple loops into each other, and soon you&#8217;re at 2200 bytes. Long way to go.</p>
<p>Rule #1 of shrinking demos: removing a byte becomes more difficult every time you remove a byte. It starts off trivial and runs very quickly into a brick wall.</p>
<h4>Quick wins</h4>
<p>These are a couple useful techniques to trim the fat at this point.</p>
<pre class="brush: jscript; title: ; notranslate">var a = g.getAttribLocation(x, 'pos');
g.uniform1f(g.getUniformLocation(x, 'time'), t);
g.vertexAttribPointer(a, 2, g.FLOAT, 0, 0, 0);
g.enableVertexAttribArray(a);</pre>
<p>What&#8217;s wrong with this picture? Well, if we ignore whitespace (minification takes care of that): we&#8217;re using <strong>var</strong> (pfft, correctness), we have a shader attribute with a 3-byte name and a uniform with a 4-byte name, we&#8217;re using g.FLOAT (more on this in a moment), and we&#8217;ve got a lot of zeros.</p>
<pre class="brush: jscript; title: ; notranslate">g.vertexAttribPointer(
    a = g.getAttribLocation(x, 'p'),
    2,
    5126,
    g.uniform1f(g.getUniformLocation(x, 't'), z),
    0,
    0
)</pre>
<p>Much better! We killed <strong>var</strong> removing 4 bytes, we removed 2 bytes by inlining the assignment to <strong>a</strong> in the first use and killing the semicolon, we eliminated a zero (the return of uniform1f is treated as a zero by the WebGL API in this case) and a semicolon for a savings of 2 bytes, we changed our shader attributes/uniforms to have 1-byte names (saving 5 bytes), and we inlined the FLOAT constant for a savings of 3 bytes. That&#8217;s 16 bytes removed from a block of 151 (after whitespace removal), or a reduction by 10.59%! Let&#8217;s do it again.</p>
<p>Before we move on, I just want to make a note that WebGL constants really are just that. You can inline them and trust them not to change.</p>
<h4>Abusing globals</h4>
<p>Look at the latest code above. Count the instances of &#8216;g.&#8217;. Four instances just in that tiny little snippet. If we could get rid of those in a small way, this could be a huge win, so let&#8217;s do it.</p>
<p>What is the global namespace in JS? Normally, it comes from the <strong>window</strong> object. So when you call <strong>foo()</strong>, it&#8217;s going to look in <strong>window</strong> if you haven&#8217;t declared it locally. So why don&#8217;t we shove our methods into the <strong>window</strong> object? Or even better, into <strong>top</strong> (in our case, they&#8217;re identical)?</p>
<p>Right now the declaration of <strong>g</strong> is as such:</p>
<pre class="brush: jscript; title: ; notranslate">g = z.getContext('experimental-webgl')</pre>
<p>But let&#8217;s change it to:</p>
<pre class="brush: jscript; title: ; notranslate">for(k in g = z.getContext('experimental-webgl'))
    top[k] = g[k].bind &amp;amp;&amp;amp; g[k].bind(g);</pre>
<p>So we walk over every key in the WebGL context and put it into <strong>top</strong>, but only if it has the bind method and we can bind it to the WebGL context. Without that, it tries to treat the window as a WebGL context. The window doesn&#8217;t like this.</p>
<p>At this point, we just cut all instances of &#8216;g.&#8217; out of the picture. This was a win of around 30 bytes (counting the cost of the globalization code) in my demo&#8217;s case, but we can go much, much further.</p>
<h3>What&#8217;s in a name?</h3>
<p>Let&#8217;s look at a list of all the WebGL methods I called in my demo:</p>
<div>
<div>
<pre>
attachShader
createProgram
linkProgram
createBuffer
bindBuffer
bufferData
viewport
createShader
shaderSource
compileShader
useProgram
getAttribLocation
getUniformLocation
uniform1f
uniform2f
vertexAttribPointer
enableVertexAttribArray
drawArrays
</pre>
</div>
</div>
<p>Holy moly, that&#8217;s a lot of bytes! But these are defined in WebGL, how can we change this?</p>
<p>Welllll&#8230; let&#8217;s look back at our globalization code. We get a name, <strong>k</strong>, and then bind <strong>g[k]</strong> into<strong>top[k]</strong>. But we control what <strong>k</strong> goes into <strong>top</strong>. Having a map of long name into short name would be expensive, but what about a regex? I&#8217;m going to spare you the gory details, but after a while of tinkering with it, I determined that the optimal code for this is:</p>
<div>
<div>
<pre>t[k.slice(1, -5).replace(/[ntalruicoh]/ig, '')] = t[k] = g[k].bind &#038;&#038; g[k].bind(g);
</pre>
</div>
</div>
<p>In this case, <strong>t</strong> is <strong>top</strong> (because hey, 4 bytes!). We still assign the original name into <strong>t</strong>, but we also put the sliced and diced name into it. Why? Because this mangles two names we need to disambiguate: <strong>uniform1f</strong> and <strong>uniform2f</strong>. But that&#8217;s fine.</p>
<p>So what do the names look like after this?</p>
<div>
<div>
<pre>S
eeP
kP
eeB
dB
ffe
e
eeS
deS
mpeS
seP
eb
efm
f
f
eexbP
beVeexb
w
</pre>
</div>
</div>
<p>Night and day difference, as you can see. You&#8217;ll obviously want to change the regex if you do this yourself, since your code will have different balances.</p>
<h4>Other random wins</h4>
<p>Arrays of digits tend to be pretty wasteful:</p>
<pre class="brush: jscript; title: ; notranslate">new Float32Array([0,0,2,0,0,2,2,0,2,2,0,2])</pre>
<p>What about this instead?</p>
<pre class="brush: jscript; title: ; notranslate">new Float32Array('002002202202'.split(''))</pre>
<p>The more digits you have, the bigger the win from this replacement is. Until we get to compression and everything changes.</p>
<h3>Compression</h3>
<p>Ok, we all know HTTP requests are trivially compressible, and this can improve load times and blah blah blah. Doesn&#8217;t matter when it comes to demos: if the size on the wire is 1k and the size on disk is 3k, your demo is 3k.</p>
<p>In the past, people have compressed their demos into images. This is an easy way to get a good size reduction &#8212; PNGs are just zlib&#8217;d data with a little header, basically. But these demos all had a PNG and an HTML+JS file that would load the PNG, draw it to a canvas, pull the pixels out of the canvas as a string, and eval that string. How can you make this into a single file demo?</p>
<h4>Introduction to PNGs</h4>
<p>The PNG file has an 8-byte signature followed by a series of simple chunks. The chunk format is as follows:</p>
<pre class="brush: plain; title: ; notranslate">4 byte length
4 byte chunk type
&amp;lt;length&amp;gt; byte chunk data
4 byte CRC</pre>
<p>Most of these are pretty clear, except chunk type. Chunk type is a FourCC, e.g. &#8216;IHDR&#8217;, which is mostly generic, with some exceptions which I&#8217;ll talk about shortly.</p>
<p>I&#8217;m not going to go into detail on the IHDR chunk (we can&#8217;t really mess with it, but I will say I use greyscale for simplicity purposes), but here&#8217;s what we start with.</p>
<pre class="brush: plain; title: ; notranslate">8 byte signature
13 byte IHDR with 12 byte chunk header
X byte IDAT (covered below) with a 12 byte chunk header</pre>
<p>The IDAT format is dead simple: 1 byte filtering method followed by your zlib deflated data.</p>
<h4>Abusing PNGs</h4>
<p>We start by defining our own chunk type (we&#8217;re allowed to do that!) before the IDAT chunk.</p>
<pre class="brush: plain; title: ; notranslate">4 byte length
4 byte &amp;quot;jawh&amp;quot; (Just Another WebGL Hacker (TM))
X byte bootstrap
4 byte CRC</pre>
<p>What is the bootstrap? Well, it&#8217;s what turns our PNG into code and runs it. Here&#8217;s the one I use:</p>
<pre class="brush: jscript; title: ; notranslate">&amp;lt;img onload=with(document.createElement('canvas'))p=width=4968,(c=getContext('2d')).drawImage(this,e='',0);
while(p)e+=String.fromCharCode(c.getImageData(0,0,p,1).data[p-=4]);
(t=top).eval(e) src=#&amp;gt;</pre>
<p>The 4968 here is really the size of the decompressed data in bytes times 4 &#8212; there are 4 components to each pixel (red, green, blue, alpha) but we&#8217;re only using grayscale, so we need to offset that. If you look carefully, you&#8217;ll also notice that it walks backwards across the data, which should create a string in reverse, but I compensate for that when I compress the data, and reverse it before doing so. This saves a couple bytes. The image source is also important: rather than hard-coding the image filename and wasting space, it uses <strong>#</strong>, enabling it to treat itself as a PNG.</p>
<p>So what do we have now? We have a PNG containing some HTML. The browser first opens it as HTML (file extension is important here), then sniffs the MIME type and figures out it&#8217;s a PNG when it gets loaded into the image tag. We have a self-extracting PNG. But we can do better.</p>
<h4>Why specs don&#8217;t matter</h4>
<p>We&#8217;re currently using a chunk type of &#8220;jawh&#8221;. Clever and a nice little insider reference, but that&#8217;s 4 wasted bytes! The chunk type comes right before the data, so why don&#8217;t we make the chunk type into <strong>&lt;img</strong> instead?</p>
<p>The spec says on the subject:</p>
<blockquote><p>Four bits of the type code, namely bit 5 (value 32) of each byte, are used<br />
to convey chunk properties. This choice means that a human can read off the<br />
assigned properties according to whether each letter of the type code is<br />
uppercase (bit 5 is 0) or lowercase (bit 5 is 1). However, decoders should<br />
test the properties of an unknown chunk by numerically testing the specified<br />
bits; testing whether a character is uppercase or lowercase is inefficient,<br />
and even incorrect if a locale-specific case definition is used.</p></blockquote>
<p>It then goes on to tell you that bit 5 of each of the bytes is:</p>
<blockquote><p>First byte: 0 = critical, 1 = ancillary<br />
Second byte: 0 = public, 1 = private<br />
Third byte: reserved<br />
Fourth byte: 0 = unsafe to copy, 1 = safe to copy</p></blockquote>
<p>Since we could call it <strong>&lt;iMg</strong> or <strong>&lt;imG</strong> or any other combination of uppercase and lowercase, clearly we only care about the impact of <strong>&lt;</strong> on the first byte. But if we look at bit 5 of <strong>&lt;</strong>, we see that it&#8217;s already set high, so it&#8217;s an ancillary chunk &#8212; we&#8217;re in the clear and just saved 4 bytes!</p>
<p>Wait, no, neither Chrome nor Firefox load the image anymore. What the hell? This is the point where you realize: the spec doesn&#8217;t matter. No browser out there follows the PNG spec, whatsoever. Perfectly to-the-spec images won&#8217;t work, and horribly broken images will work. So let&#8217;s horribly break it. Note: Both Chrome and Firefox use libpng for image parsing, so you could go through the code and look for ways in which it&#8217;s mishandling data and go down that path, but for my purposes I found that just experimentally changing things and seeing how they break was Good Enough (TM).</p>
<h4>Breaking PNG for fun and profit</h4>
<p>Messing with the chunk type is out due to browser incompatibility, so what other options do we have? Well, who cares about CRCs.</p>
<p>Set the CRC to <strong>c=#&gt;</strong>, save, refresh. Hey, it works in Chrome and Firefox! 4 bytes saved.</p>
<p>Well, we can&#8217;t push back towards the front due to the chunk type, and we can&#8217;t push forwards towards the IDAT chunk because of the size. But how do browsers handle chunk size mismatches?</p>
<p>If we set the size of the IDAT atom to <strong>c=#&gt;</strong>, that unpacks to a size of 1042496867, which is obviously more than the size of the IDAT chunk. We shift <strong>) sr</strong> into the CRC and set the IDAT size to <strong>c=#&gt;</strong>, save, refresh. All browsers will set <strong>size = min(reportedSize, endOfFile &#8211; startOfChunk)</strong>! That saves us another 4 bytes.</p>
<p>So sure, we couldn&#8217;t get rid of <strong>jawh</strong>, but who cares? We just saved 8 bytes!</p>
<h4>Compression caveats</h4>
<p>Now you know how to make the PNG container small, but this says nothing about actually making your demo small. A few of the tips above are actually <em>harmful</em> in the context of compression. Why? Because repetitive data compresses really, really well. For instance, the Float32Array trick is nice when you&#8217;re dealing with uncompressed data, but ends up eating a couple extra bytes after compression. Reusing function and variable names is also very, very important. The more repetition you can introduce, the better off you&#8217;ll generally be.</p>
<h3>Wrapping up</h3>
<p>All in all, these tips (and general insanity) will let you build really small demos. My demo, Magister, went from around 3k down to just over 900 bytes when all was said and done. I ended up adding a message in the demo (&#8220;1k should be enough for anybody.&#8221;) to get it up to exactly 1024 bytes, which was my goal. Feels good to have to work up rather than down.</p>
<p>I hope this helped shine some light on the subject.</p>
 <p><a href="http://www.displayhack.org/?flattrss_redirect&amp;id=1211&amp;md5=24e751aa127320d846640822694215da" title="Flattr" target="_blank"><img src="http://www.displayhack.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/displayhack/~4/sWFTWiY_k40" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.displayhack.org/2011/superpacking-js-demos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=displayhack&amp;popout=1&amp;url=http%3A%2F%2Fwww.displayhack.org%2F2011%2Fsuperpacking-js-demos%2F&amp;language=en_GB&amp;category=text&amp;title=Superpacking+JS+demos&amp;description=The+techniques+I%26%238217%3Bm+going+to+be+describing+here+were+created+and%2For+implemented+to+pack+my+entry+to+the%C2%A0Mozilla+Demoparty%3A%C2%A0Magister.+Huge+thanks+to+my+friend+Nicol%C3%A1s+Alvarez+for+helping+squeeze+every...&amp;tags=1k%2Chtml5%2Cjs%2Conline%2Cprogramming%2Ctechniques%2Ctutorial%2Cwebgl%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.displayhack.org/2011/superpacking-js-demos/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=superpacking-js-demos</feedburner:origLink></item>
		<item>
		<title>Web demo goodies – August 2011</title>
		<link>http://feedproxy.google.com/~r/displayhack/~3/klDcHnLMs48/</link>
		<comments>http://www.displayhack.org/2011/web-demo-goodies-august-2011/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 05:32:33 +0000</pubDate>
		<dc:creator>Bent Stamnes</dc:creator>
				<category><![CDATA[Collections]]></category>
		<category><![CDATA[Frontpage]]></category>
		<category><![CDATA[collection]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[webgl]]></category>

		<guid isPermaLink="false">http://www.displayhack.org/?p=986</guid>
		<description><![CDATA[For this month&#8217;s roundup of things moving and shaking on the web, we&#8217;ll dip into the pool as well as reunite with our good old friend; the Cornell Box. Above: Evan Wallace has once again created a much talked about tech-demo called, with great efficiency: WebGL Water. The tech demo features raytracing, soft shadows, caustics ]]></description>
				<content:encoded><![CDATA[<p>For this month&#8217;s roundup of things moving and shaking on the web, we&#8217;ll dip into the pool as well as reunite with our good old friend; the Cornell Box.</p>
<p style="text-align: center;"><img class="aligncenter size-large wp-image-1000" title="webgl_water" src="http://www.displayhack.org/wp-content/uploads/webgl_water-1024x641.jpg" alt="" width="614" height="385" /></p>
<p><strong>Above:</strong> <a href="http://madebyevan.com/">Evan Wallace</a> has once again created a much talked about tech-demo called, with great efficiency: <a title="WebGL Water by Evan Wallace" href="http://madebyevan.com/webgl-water/">WebGL Water</a>. The tech demo features raytracing, soft shadows, caustics and &#8220;analytic&#8221; (meaning &#8220;fake&#8221; :) ambient occlusion. It all comes together in an interactive WebGL app that looks good and has a very decent framerate, even on middle-of-the-road hardware. Well done!</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1004" title="webgl_path_tracer" src="http://www.displayhack.org/wp-content/uploads/webgl_path_tracer.jpg" alt="" width="575" height="362" /></p>
<p><strong>Above: </strong>Another piece from Evan Wallace, this time taking on <a title="WebGL Path Tracing by Evan Wallace " href="http://madebyevan.com/webgl-path-tracing/">path tracing</a> to create more realistic lighting and shadowing in a scene. The tech-demo allows you to change the material, move the lights and add/remove objects in the scene, as well as moving them around. Fun to play with, and again, surprisingly fast.</p>
<p style="text-align: center;"><img class="aligncenter size-large wp-image-1011" title="nautilus" src="http://www.displayhack.org/wp-content/uploads/nautilus-1024x498.jpg" alt="" width="614" height="299" /></p>
<p><strong>Above: </strong><a title="MKVDB.com" href="http://www.mkvdb.com">MKVDB</a> has made a <a title="See the WebGL port online" href="http://www.mkvdb.com/webgl/webgl5.htm">WebGL port</a> of his native <a title="Download the 1k EXE for Windows" href="http://www.mkvdb.com/nautilus.zip">Windows 1k executable</a> &#8220;Nautilus&#8221; intro. Goes fullscreen and is a little heavy for most mid-range computers, but if you have a fast one it looks really gorgeous.</p>
<p style="text-align: center;"><img class="aligncenter size-large wp-image-1022" title="cadillac" src="http://www.displayhack.org/wp-content/uploads/cadillac-1024x565.jpg" alt="" width="614" height="339" /></p>
<p><strong>Above:</strong> The famous <a title="Wikipedia: Cadillac Ranch" href="http://en.wikipedia.org/wiki/Cadillac_Ranch">Cadillac Ranch art installation in Texas</a> has found a home online in the <a title="Virtual Cadillac Ranch" href="http://www.spacegoo.com/cadillac/">virtual Cadillac Ranch</a>. You can move around (granted, the controls are not exactly top notch) and spray-paint the car-wrecks in the sand. Built on WebGL.</p>
<div class="alert white">Note: starting from the next part in this series, it&#8217;ll go from a monthly to a weekly post, to keep up with all the awesome that happens online these days.</div>
 <p><a href="http://www.displayhack.org/?flattrss_redirect&amp;id=986&amp;md5=a311fa75b1f87526b0a71351f34dc653" title="Flattr" target="_blank"><img src="http://www.displayhack.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/displayhack/~4/klDcHnLMs48" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.displayhack.org/2011/web-demo-goodies-august-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=displayhack&amp;popout=1&amp;url=http%3A%2F%2Fwww.displayhack.org%2F2011%2Fweb-demo-goodies-august-2011%2F&amp;language=en_GB&amp;category=text&amp;title=Web+demo+goodies+%E2%80%93+August+2011&amp;description=For+this+month%26%238217%3Bs+roundup+of+things+moving+and+shaking+on+the+web%2C+we%26%238217%3Bll+dip+into+the+pool+as+well+as+reunite+with+our+good+old+friend%3B+the+Cornell+Box.+Above%3A...&amp;tags=collection%2Chtml5%2Conline%2Cslider%2Cwebgl%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.displayhack.org/2011/web-demo-goodies-august-2011/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=web-demo-goodies-august-2011</feedburner:origLink></item>
		<item>
		<title>Modelling in Maya 101 – Part 2</title>
		<link>http://feedproxy.google.com/~r/displayhack/~3/PNpgJN7FAiQ/</link>
		<comments>http://www.displayhack.org/2011/maya101-2/#comments</comments>
		<pubDate>Sun, 28 Aug 2011 16:15:23 +0000</pubDate>
		<dc:creator>Mathias Tangen Leganger</dc:creator>
				<category><![CDATA[Frontpage]]></category>
		<category><![CDATA[Series]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[maya]]></category>
		<category><![CDATA[modelling]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[techniques]]></category>
		<category><![CDATA[texturing]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.displayhack.org/?p=751</guid>
		<description><![CDATA[Welcome back! We created a character in part 1, using various 3D-modelling techniques inside of Maya (or your preferred modelling package). We now have our 3D-mesh and UV-layout ready to go, though our character looks kind of dull just with that default-gray Lambert-material in Maya. Colors anyone? In order to unleash your creativity and bring your ]]></description>
				<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.displayhack.org/wp-content/uploads/maya101_p2_nigel01-423x250.png" rel="lightbox[751]"><img class="size-medium wp-image-752 aligncenter" src="http://www.displayhack.org/wp-content/uploads/maya101_p2_nigel01-423x250.png" alt="" width="423" height="250" /></a></p>
<p><span>Welcome back! We created a character in <a href="http://www.displayhack.org/2011/maya101-1/">part 1</a>, using various 3D-modelling techniques inside of Maya (or your preferred modelling package). </span>We now have our 3D-mesh and UV-layout ready to go, though our character looks kind of dull just with that default-gray Lambert-material in Maya.</p>
<p>Colors anyone?</p>
<p>In order to unleash your creativity and bring your character to life, you need one (or several) texture maps. We will start out with the diffuse map. In a nutshell, the diffuse map is a 2D picture that gets projected onto your 3D mesh, telling your application (or game) what color should be assigned to which polygon. Similarly, you have tons of other possible maps for things such as specularity, transparency, bumps and what not. The picture above depicts the notorious Sir Nigel Rochester (known from &#8220;<a href="http://www.eviljunior.com/" class="broken_link">Evil Junior</a>&#8221; of course) as a 3D mesh with a diffuse-map containing all of his color information.</p>
<p>Let&#8217;s see how you go about making one of those diffuse maps!</p>
<h3>Enter Photoshop</h3>
<p>Photoshop is perhaps <strong>the</strong> application for painting 2D texture-maps (but feel free to give me a shelling in the comments field if you disagree). You may absolutely use other packages (or even hand paint your textures and scan them) but in this tutorial series I&#8217;m going to stick to Photoshop. Many 3D packages also provide more or less useful texture-painting capabilities, most notably ZBrush and BodyPaint. I will actually showcase some techniques in BodyPaint later on, so stay tuned for that.</p>
<p>Back to the action &#8211; fire up Photoshop and create a new file. I recommend the following settings for your texture maps:</p>
<ul>
<li>Width x height: 2048 x 2048 pixels</li>
<li>Resolution: 300 pixels/inch</li>
<li>RGB Color with 8 bits</li>
</ul>
<p>This should result in a PSD file of ~12 MB. 2048 x 2048 pixels = &#8220;2K&#8221; in pixel-pusher lingo. 1024 = 1K. You get the idea. Now one piece of advice (which I learned for myself the hard way): don&#8217;t be cheap on your initial texture resolution &#8212; ever! By heeding this advice you will hopefully avoid the painful mistake of starting out with a texture resolution that is too low, only to find yourself starting from scratch because the texture you spent several hours working on looks blurry on your mesh. If your initial texture-file is 2K, you can always export your texture as 1K if need be. But a 1K master-file upscaled to a 2K texture map is surely an abomination.</p>
<p>Ok, so 2K should do for this project. Save the newly-created file as a PSD in the <em>sourceimages </em>directory of your Maya project. Name it something like: <em>yourcharacter_diffuse.PSD.</em></p>
<h3>Texturing preparations</h3>
<p>Now you should have a clean 2K-canvas facing you in Photoshop. Let&#8217;s go through a few hints before you continue on your texturing business.</p>
<p>First, make sure you have exported a &#8220;UV Snapshot&#8221; from the UV Texture Editor inside Maya, as depicted in the picture below. I will use this snapshot as reference in the painting process.</p>
<p style="text-align: center;"> <a href="http://www.displayhack.org/wp-content/uploads/maya101_p2_uvsnap.png" rel="lightbox[751]"><img class="size-medium wp-image-768 aligncenter" src="http://www.displayhack.org/wp-content/uploads/maya101_p2_uvsnap.png" alt="" width="524" height="539" /></a></p>
<p style="text-align: left;">Next, you can either save your texture map during the process as an image file and insert it into your map in Maya (as we discussed under <em>&#8220;Assigning Maps&#8221;</em> in <a href="http://www.displayhack.org/2011/maya101-1/">part 1</a>) &#8212; or &#8212; you could utilize this nifty trick: create a new material in your Hypershade Editor in Maya by selecting &#8220;PSD File&#8221;. Browse to your PSD file in &#8220;Image Name&#8221;. Select your mesh in Maya, then RIGHT-CLICK the &#8220;place2dTexture&#8221; node in Hypershade and click &#8220;Assign texture&#8217;s material to selection&#8221; (see image below).</p>
<p style="text-align: center;"><a href="http://www.displayhack.org/wp-content/uploads/maya101_p2_hshade-1024x615.png" rel="lightbox[751]"><img class="aligncenter size-large wp-image-771" src="http://www.displayhack.org/wp-content/uploads/maya101_p2_hshade-1024x615.png" alt="" width="516" height="311" /></a></p>
<p>You should be able to save some time by hitting &#8220;Save&#8221; in Photoshop and see the PSD material instantly update inside Maya. With that out of the way, let&#8217;s set up some layers inside of Photoshop.</p>
<p>Layers are among the texture artist&#8217;s best friends: they help creative (and often disorganized) people be effective (and in the process: more organized). They eat RAM, so don&#8217;t go crazy on your layers. But a few will help you experiment and save you a lot of time. Remember that you may also be part of a team and that other artists may need to work on your files. How to win friends in the art department: keep your files clean, properly named and organized.</p>
<p style="text-align: center;"><a href="http://www.displayhack.org/wp-content/uploads/maya101_p2_layers.png" rel="lightbox[751]"><img class="aligncenter size-full wp-image-775" src="http://www.displayhack.org/wp-content/uploads/maya101_p2_layers.png" alt="" width="462" height="339" /></a></p>
<p style="text-align: left;">The picture above shows my layers for Nigel&#8217;s PSD file.</p>
<ul>
<li>Put your UV snapshot at the top, with &#8220;normal&#8221; or &#8220;multiply&#8221; as the layer blending-mode.</li>
<li>Create a folder for ambient-occlusion effects. This is a very nice trick I will dive into next.</li>
<li>One folder for your &#8220;diffuse&#8221;, i.e. where you put all your paint layers.</li>
</ul>
<p>Alright, now let&#8217;s bake that ambient-occlusion map&#8230;</p>
<h3>Ambient occlusion</h3>
<p>This step is optional, but with the process being a snap and the results being good &#8212; why not give it a try?</p>
<p>Ambient occlusion (AO) is an effect in which you let the renderer determine shadows for you. A white material is applied to everything in the scene, and then the scene is lit. Lighting and shadow information is calculated and the renderer &#8220;bakes&#8221; an AO-map containing only shades of black and white. By doing this, you basically let the renderer figure out shadows on your mesh. It can really add that little extra and also save you a lot if time in the texturing process. Lazy artists are good artists. I will briefly walk you through the process of baking AO-maps in Maya right now..</p>
<p>Ok, so this is what we will do: open up your 3D mesh in Maya and apply the ambient-occlusion material in the Hypershade Editor:</p>
<ul>
<li>Create the surface shader: <em>Maya -&gt; Surface -&gt; Surface Shader.</em></li>
<li>Create the AO shader: <em>mental ray -&gt; Textures -&gt; mib_amb_occlusion.</em></li>
<li>Connect the AO to the surface shader in the Work Area by MMB-dragging AO output to surface input (see picture). Choose <em>default </em>(outValue -&gt; outColor).</li>
<li>Select the AO shader and open the Attribute Editor (CTRL+A).</li>
<li>Play with different settings under &#8220;Samples&#8221; (quality of output) and &#8220;Distance&#8221; (effect). Try setting &#8220;Samples&#8221; to 128 or 256.</li>
<li>Apply this material to your mesh.</li>
</ul>
<p style="text-align: center;"><a href="http://www.displayhack.org/wp-content/uploads/maya101_p2_ao11.png" rel="lightbox[751]"><img class="aligncenter size-full wp-image-1062" src="http://www.displayhack.org/wp-content/uploads/maya101_p2_ao11.png" alt="" width="545" height="382" /></a></p>
<p>Now we need to &#8220;bake&#8221; (or in other words: render) this texture:</p>
<ul>
<li>Select your perspective camera in the Outliner. In the Attribute Editor set <em>Environment -&gt; Background Color </em>to white.</li>
<li>Select <em>Rendering </em>in the menu selection.</li>
<li>Select <em>Render -&gt; Render using -&gt; mental ray </em>(you may need to enable mental ray in the plug-in manager) in the main menu.</li>
<li>Select your mesh.</li>
<li>Hit <em>Lighting/Shading -&gt; Batch Bake (mental ray) Settings. </em>Set the resolution to your texture map resolution, e.g. 2K.</li>
<li>Hit <em>Convert </em>when done.</li>
</ul>
<p>The resulting map will be baked to <em>renderData -&gt; mental ray -&gt; lightMap </em>in your project directory. The result should look something like this:</p>
<p style="text-align: center;"><a href="http://www.displayhack.org/wp-content/uploads/maya101_p2_ao2.png" rel="lightbox[751]"><img class="aligncenter size-full wp-image-1063" src="http://www.displayhack.org/wp-content/uploads/maya101_p2_ao2.png" alt="" width="429" height="334" /></a></p>
<p style="text-align: left;">Awesome. Now paste your freshly-baked AO-map onto its own layer in Photoshop, set the layer to &#8220;Multiply&#8221; and make sure it&#8217;s placed on top of any and all diffuse-layers you might already have. Adjust the blend-percentage to taste. Voilá!</p>
<h3>3D texture-painting in BodyPaint</h3>
<p style="text-align: left;">This step is optional but highly recommended if you have access to an application supporting 3D-painting. Painting a texture on a 2D canvas can be both limiting and frustrating because of distorted and slow feedback. 3D texture-painting enables a much more intuitive and responsive process because you paint directly onto the surface of the mesh. There are two methods for 3D-painting used by different solutions. ZBrush offers polygon-painting where you paint individual polygons directly. BodyPaint stores color information as an intermediary 2D-image. Maya also offers 3D-painting capabilities. I will use BodyPaint in this example. The principles are the same, regardless of application used. Here is what you need to do:</p>
<ul>
<li>Export the mesh you want to 3D-paint to an .OBJ file in Maya.</li>
<li>Open BodyPaint. Create a new project. Import your .OBJ file.</li>
<li>Select all mesh objects in the &#8220;Objects&#8221; tab.</li>
<li>Create a new material in the &#8220;Materials&#8221; tab. RIGHT-CLICK the new material and hit &#8220;Apply&#8221;.</li>
<li>Click on the material icon. In the &#8220;Attributes&#8221; tab click <em>Color -&gt; Texture -&gt; Create New Texture. </em>Alternatively, load your existing texture.</li>
<li>RIGHT-CLICK the material icon and hit &#8220;Enable 3D Paint&#8221;.</li>
<li>Create a new layer under the &#8220;Layers&#8221; tab.</li>
<li>Start painting!</li>
</ul>
<p>Now you can either make a texture from scratch or enhance your existing textures. 3D-painting is also great for painting in reference for 2D-painting. This is what I have done in the picture below. This way I can easily figure out where I want to paint Nigel&#8217;s shadows and skin in Photoshop.</p>
<p style="text-align: center;"><a href="http://www.displayhack.org/wp-content/uploads/maya101_p2_bodypaint1.png" rel="lightbox[751]"><img class="aligncenter size-full wp-image-1148" src="http://www.displayhack.org/wp-content/uploads/maya101_p2_bodypaint1.png" alt="" width="427" height="323" /></a></p>
<p>When you are finished simply RIGHT-CLICK the texture icon next to the material under the &#8220;Material&#8221; tab and press <em>Texture -&gt; Save Texture as. </em>Save as .PSD if you want to keep your layers.</p>
<h3>Painting in Photoshop</h3>
<p>Contrary to popular belief, you don&#8217;t need a PhD in Photoshop in order to paint awesome textures. All you really need is the paint brush. Here are a few additional tricks you may find useful:</p>
<p><strong>Layer masks: </strong>Click in the background (outside the grid markings) in your UV-snapshot layer with the Magic Wand Tool (W). Click CTRL+SHIFT+I to invert the selection. Create a new layer. Then hit &#8220;Add layer mask&#8221; in the layers panel. You can see the result in the picture below. Next to the mini-version of your paint layer, you have a black-and-white representation of your layer mask. 100% black in the mask = 100% invisible, 100% white = 100% visible. In other words, layer masks are an extremely flexible and powerful tool in the painting process because you can &#8220;paint&#8221; in or out what should be visible in this particular layer. This is very nice when you want to blend your layers manually.</p>
<p><a href="http://www.displayhack.org/wp-content/uploads/maya101_p2_layermasks.png" rel="lightbox[751]"><img class="aligncenter" src="http://www.displayhack.org/wp-content/uploads/maya101_p2_layermasks.png" alt="" width="172" height="272" /></a></p>
<p><strong>External textures: </strong>You can achieve insanely nice and lifelike effects by adding external textures and images onto a separate layer and experiment with the blending mode of the layer, e.g. &#8220;Multiply&#8221; or &#8220;Overlay&#8221;. Does your character wear armor? Try adding a metal texture with scratches and wear-and-tear.</p>
<p><strong>Warping and liquify: </strong>Sometimes you need to push things around, like if you import a 2D texture that needs to be warped according to the grid lines of your UV snapshot. You can use <em>Edit &#8211; &gt; Transform -&gt; Warp </em>or <em>Filter -&gt; Liquify.</em></p>
<p><strong>Pressure-sensitive tablet: </strong>This is a no-brainer. Texture-painting solely with a mouse is possible but extremely limiting. A pressure-sensitive tablet is a good investment (if you do not already have one) and will definitely make your day easier as an artist.</p>
<p><strong>Pressure-sensitive brushes:</strong>  If you have a tablet, try experimenting with the brush settings under &#8220;Brushes&#8221;. Especially &#8220;Shape dynamics&#8221; (size) and &#8220;Other dynamics&#8221; (opacity).</p>
<p><strong>Basic brushes: </strong>I tend to use a basic hard round brush, a soft one, and combinations of these with sensitivity for either size or opacity. Try making other brushes by painting a black-and-white pattern on a square canvas and hit <em>Edit -&gt; Define Brush Preset </em>(or simply download free brushes on the net).</p>
<p>With those few tricks freshly memorized, it&#8217;s time to paint!</p>
<ul>
<li>Start with a color filling the entire background (left image).</li>
<li>Import reference from 3D-painting if available.</li>
<li>Using your UV snapshot, and popping in and out of Maya to check the effects of your actions, start painting in the basic colors with a hard round brush for each mesh piece or body part (middle image). You can also use your AO layer for reference.</li>
<li>Once you have painted in all your desired colors, try enabling your AO layer to see how it looks (right image).</li>
<li>Want more detail? Experiment with more advanced brush settings or add external textures with blending.</li>
</ul>
<p><a href="http://www.displayhack.org/wp-content/uploads/maya101_p2_painting-1024x333.png" rel="lightbox[751]"><img class="aligncenter" src="http://www.displayhack.org/wp-content/uploads/maya101_p2_painting-1024x333.png" alt="" width="655" height="213" /></a></p>
<p>When satisfied, save out your work. I like saving as .PNG (which also stores transparency), though you may find a better choice depending on the requirements of your project (consult your art director or lead programmer if you have one). If you have an established pipeline, it will most likely do batch conversions of textures and assets at some point, so keep your original textures in high quality is always a good thing. Save the file in the same resolution as your PSD. Name it something like <em>yourcharacter_diffuse.</em></p>
<h3>Specularity and other maps</h3>
<p>If you want additional control over other properties than just color, you can create other maps as well. For example, you may want Sir Nigel&#8217;s top hat to be extra shiny. Shininess, or rather specularity, is determined by a specular map. Create a new layer in your Photoshop texture-file and paint with black-and-white, black representing matte, gray semi-glossy and white very glossy. Paint as in the picture below:</p>
<p style="text-align: center;"><a href="http://www.displayhack.org/wp-content/uploads/maya101_p2_spec.png" rel="lightbox[751]"><img class="aligncenter size-full wp-image-1158" src="http://www.displayhack.org/wp-content/uploads/maya101_p2_spec.png" alt="" width="177" height="177" /></a></p>
<p style="text-align: left;">You can use the same technique for controlling other surface-properties such as bumps (e.g. for hairs and fur) and transparency (the glass of Nigel&#8217;s monocle). A much-used map in video games is the normal map. Normal maps are color images providing rendering information for how light should be reflected on the surface of the mesh. They are often used for giving the illusion of indentations and protrusions on flat surfaces, such as muscles, bones and wrinkled clothing and so on. Normal maps can be created from high-polygon versions of your mesh.</p>
<h3>Wrapping it up</h3>
<p>OK, let&#8217;s conclude this part of the tutorial by adding our diffuse and specular maps in Maya:</p>
<ul>
<li>Create a Blinn material and assign it to your mesh.</li>
<li>Open the Attribute Editor (CTRL+A) to edit the material properties.</li>
<li>Enter your diffuse map in <em>Common Material Properties -&gt; Color.</em></li>
<li>Enter your specular map in <em>Specular Shading -&gt; Specular Color.</em></li>
</ul>
<p>If you want to render an image of the result, do the following:</p>
<ul>
<li>Add a primitive plane to your scene. Stretch it out so that it acts as the ground. Select two sides of the plane (the ones visible in your perspective camera), extrude those edges and &#8220;lift&#8221; them to create walls. When done, hit &#8220;2&#8243; on your keyboard to smooth it. Apply a white Lambert-material to it.</li>
<li>Then add an ambient light to your scene and position it.</li>
<li>Set your renderer to mental ray.</li>
<li>Position your perspective camera, open the IPR renderer and select a small portion of the scene for live preview-rendering.</li>
<li>Now, play with the settings of your mesh&#8217;s material and the lights/background until you are satisfied with the result in the IPR renderer. Also try experimenting with the render settings such as quality.</li>
<li>When happy, render the current frame with mental ray.</li>
</ul>
<p style="text-align: center;"><span><a href="http://www.displayhack.org/wp-content/uploads/maya101_p2_render3-e1314523439585.png" rel="lightbox[751]"><img class="aligncenter size-full wp-image-1166" src="http://www.displayhack.org/wp-content/uploads/maya101_p2_render3-e1314523439585.png" alt="" width="310" height="307" /></a></span></p>
<p style="text-align: left;"><span>That concludes this tutorial part. We now have a 3D mesh with maps for diffuse and specularity. I hope you have enjoyed this tutorial, and <a href="http://www.displayhack.org/forums/topic/modelling-in-maya-101-part-2/">please feel free to ask questions or add your own work in the forum!</a></span></p>
 <p><a href="http://www.displayhack.org/?flattrss_redirect&amp;id=751&amp;md5=353bc03e3557548f7dc2f89fe3f2d71d" title="Flattr" target="_blank"><img src="http://www.displayhack.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/displayhack/~4/PNpgJN7FAiQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.displayhack.org/2011/maya101-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=displayhack&amp;popout=1&amp;url=http%3A%2F%2Fwww.displayhack.org%2F2011%2Fmaya101-2%2F&amp;language=en_GB&amp;category=text&amp;title=Modelling+in+Maya+101+%E2%80%93+Part+2&amp;description=Welcome+back%21+We+created+a+character+in+part+1%2C+using+various+3D-modelling+techniques+inside+of+Maya+%28or+your+preferred+modelling+package%29.%C2%A0We+now+have+our+3D-mesh+and+UV-layout+ready+to+go%2C...&amp;tags=animation%2Cmaya%2Cmodelling%2Cphotoshop%2Cslider%2Ctechniques%2Ctexturing%2Ctutorial%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.displayhack.org/2011/maya101-2/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=maya101-2</feedburner:origLink></item>
		<item>
		<title>Making-of: “The Lacquerer”</title>
		<link>http://feedproxy.google.com/~r/displayhack/~3/KUeXDpULQhU/</link>
		<comments>http://www.displayhack.org/2011/the-lacquerer/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 08:47:40 +0000</pubDate>
		<dc:creator>Ollie "Cosmic" Borgardts</dc:creator>
				<category><![CDATA[Frontpage]]></category>
		<category><![CDATA[Making-of]]></category>
		<category><![CDATA[after effects]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[behind the scenes]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[maya]]></category>
		<category><![CDATA[messiah]]></category>
		<category><![CDATA[modelling]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[techniques]]></category>
		<category><![CDATA[zbrush]]></category>

		<guid isPermaLink="false">http://www.displayhack.org/?p=892</guid>
		<description><![CDATA[Hi, I&#8217;m Ollie &#8220;cosmic&#8221; Borgardts, and I am the creator of the animated short &#8220;The Lacquerer&#8221;. I&#8217;m going to do my best to make this an interesting and entertaining read, but I should probably say up front that I will go into detail on how the movie was made. I&#8217;ll also touch upon the creative ]]></description>
				<content:encoded><![CDATA[<p><iframe src="http://player.vimeo.com/video/28078893?title=0&amp;byline=0&amp;portrait=0&amp;color=f20505" width="621" height="349" frameborder="0"></iframe></p>
<p>Hi, I&#8217;m Ollie &#8220;cosmic&#8221; Borgardts, and I am the creator of the animated short <strong>&#8220;The Lacquerer&#8221;</strong>. I&#8217;m going to do my best to make this an interesting and entertaining read, but I should probably say up front that I <strong>will</strong> go into detail on how the movie was made. I&#8217;ll also touch upon the creative process and my personal experiences from making this production. At the bottom of this post I have attached a 30-minute walkthrough video in which I explain some of the techniques I used.</p>
<h3>Behind &#8220;The Lacquerer&#8221;</h3>
<p>The whole production took about 2 months (full time) to complete, and with such a long production time I feel I have plenty of tips about the production process and the ideas and techniques that went into the piece. The short was released at the <a href="http://revision-party.net/">Revision Demoscene Party 2011</a> where it won the Animation Competition.</p>
<p>The whole project started two months before the competition was to be held, when a good friend of mine, Pro from the demo group Nuance, told me about a promotional campaign for a 3D package named <a href="http://www.projectmessiah.com/x6/index.html">Messiah Studio</a> at a very good price. I have been a faithful Maya-user for many years, but when I checked out the package, some of the features it offered were very interesting. Even though I had never used it before, I promptly ordered a license in the belief that I could learn what I needed to know in good time before the competition deadline got too close.</p>
<blockquote><p>One trick I learned was to watch tutorials at double or triple speed to save some time</p></blockquote>
<p>I really wanted to finish a cool production for Revision, so with hindsight being 20-20, I probably picked a bad time to start learning a new 3D package. I proceeded to spend quite some time just watching various tutorials online, to get to know the application and the differences from Maya. One trick I learned was to watch tutorials at double or triple speed to save some time (no joke, it&#8217;s what I did and it was very effective).</p>
<p>Just to touch on the fact that I decided to switch 3D packages. I do simply love Maya. I use an older version (6) which I bought several years ago and I&#8217;ve been using it so long that I know the program in and out and can therefore work quite efficiently in it. However, I do have some issues with it.</p>
<p><img class="size-medium wp-image-910 alignleft" src="http://www.displayhack.org/wp-content/uploads/Camera-422x250.jpg" alt="" width="405" height="240" /></p>
<p>When creating digital characters I would begin in ZBrush and then bring it into Maya for rigging. To bind the bones to the geometry Maya requires you to go through a process called &#8220;weight painting&#8221;. This tells the skeleton how much influence each single bone has on the bound geometry. There are a few scripts that help you automate then I need to bind the bones to the geometry and do a process called weight painting. This tells the inserted digital skeleton how much influence every single bone has upon the bound geometry. There are scripts to partly automate the process, but to be honest: most of them suck, and doing it manually sucks even more.</p>
<p>There are most likely newer versions of Maya that has new features or techniques for rigging and skinning, but for me, taking the step over to Messiah really helped me out. One example: in Maya, if I want to change something after the bone structure has been set up and bound to the mesh, I would have to unbind all of it and repeat the process on the new or changed mesh.</p>
<p>For an artist, this workflow is killing productivity. I want to be free from the very beginnng, the planning stage, the modeling, texturing, animation and right up to the final export or the encoding process. I want to be able to make changes at any point in that toolchain. Period.</p>
<p>Another example: changing the character from a humanoid biped to, say, a 3-legged beast with 10 arms, I&#8217;d have to repeat the whole process. Again, this doesn&#8217;t work for me. This is one of the areas where Messiah shines. It has a very clever way of separating the binding/rigging-stage from the animation. If I wanted to add more bones, I&#8217;m able to do so, and the animation and other parts remain untouched. Awesome.</p>
<h3>Thoughts on creativity (and art in general)</h3>
<p>I was now in a place where I knew how to use Messiah &#8212; which is exactly the time that the creativity black hole hit me. I&#8217;d like to share some thoughts about creativity in general and about the approach I use when realizing my ideas.</p>
<p>My tools of choice are Maya (or now: Messiah), After Effects, Photoshop and ZBrush. Not necessarily in that order.</p>
<p>I believe that there are really no &#8220;new things&#8221;. Pretty much everything has been done before in some way. Even so I look at other artists and what they doing and I&#8217;m definitely learning something new every single day, and that&#8217;s a good thing. However, if it&#8217;s one thing I know it&#8217;s that creativity can&#8217;t be forced when you are on a deadline.</p>
<p>I want to surprise the people at the event with my production, but how could I surprise them if I can&#8217;t even surprise myself? For each project I start, my personal goal is always to surprise myself in some way &#8212; to create something I&#8217;d never thought of before it&#8217;s actually finished.</p>
<p>So how can this be achieved? Well, I know what I&#8217;m able to. I know what I&#8217;m too unskilled or too lazy for. I know my tools. I know my skills and my preference when it comes to art. I know these things inside and out, so how do I &#8220;trick&#8221; myself? Well, one approach is to combine existing things. Take, for example, three existing things and combine them in some random fashion. It doesn&#8217;t matter which way you do it. The point is to not be logical and simply negate the facts.</p>
<p>Just to give you a little example of the process that works well for me:</p>
<p>Look out your window at the scenery outside. Then go: &#8220;Why do trees have their roots planted in the groud? What if it was upside down?&#8221; <em>Argument one: defined.</em></p>
<p>Continue with the simple assertion: &#8220;What would happen if the tree was planted upside down?&#8221; Well, for one, it wouldn&#8217;t be able to access any water. So the consequence of this could be that the roots would need to stretch to the clouds to access water. <em>Argument two: defined.</em></p>
<p>But what with the birds that usually sit on the soft branches? They don&#8217;t want to sit on the ugly, muddy roots. No, they want to sit on the branches and leaves as before. Therefore the result could be that they hang themselves upside down instead, reaching for the branches. <em>Argument three: defined.</em></p>
<p>..and boom &#8212; there&#8217;s your scene. The rest is just a matter of a technical completion, however you choose to proceed.</p>
<p><img class="size-medium wp-image-826 alignright" src="http://www.displayhack.org/wp-content/uploads/ThoughtsBoutArt1-333x250.jpg" alt="" width="433" height="325" /></p>
<p>The image to the right isn&#8217;t exceptional, but I hope you get the idea how everything in an artistic world could be created in this way. Just let the things happen. You don&#8217;t want to control everything or be too logical here. That simply doesn&#8217;t work &#8212; or, to be more precise &#8212; it simply doesn&#8217;t work <em>for me</em>. I know a thing or two about the technical stuff, but in the creation process of something artistic, taking a logical approach is just disturbing the art.</p>
<p>However, when the creative process is completed, you can come back and go on working on it in a professional, logical and disciplined way.</p>
<h3>When perfectionism and ego gets in the way</h3>
<p>At an early stage of making &#8220;The Lacquerer&#8221; I just wanted to use ZBrush, model something and then animate it. I asked a friend of mine, Marc Ewald (a musician from the Netherlands), if he&#8217;d like to do a soundscape for it (just like he did for &#8220;<a title="" href="http://capped.tv/playeralt.php?vid=nuance-julie">Julie</a>&#8221; my last short movie experiment for Breakpoint 2009). I believe he&#8217;s a genius in what he&#8217;s doing and so the brief I gave him went something like this:</p>
<p><em>Please think of a concept for a short film (but don&#8217;t tell me what it is) and then create a soundscape for it. No identifiable sounds like bird chirps, car horns and such. Just make something abstract that will fit with loosely defined terms of contrast, such as &#8220;fast&#8221;, &#8220;slow&#8221;, &#8220;large&#8221;, &#8220;small&#8221;, &#8220;oppresive&#8221;, &#8220;liberating&#8221;. Again: don&#8217;t tell me the meaning of it. I plan to let the story unfold itself while I&#8217;m making it.</em></p>
<p>The reason for this was of course to have no preference or preconceived notions when starting up. I could listen to the sounds as a small child would and just let the imagination kick in. What would I think of those sounds &#8212; what would they look like? Then I could concentrate on creating something visual around the sound completely disconnected from the visuals.</p>
<p>What I got from Marc was very good. Bombastic, epic, almost score-like in nature. I could picture it in a game such as &#8220;Metal Gear Solid&#8221;. It was absolutely fantastic and I was speechless. My problems started when I was trying to visualize them. Suddenly my creativity was .. gone.</p>
<p>I had vivid pictures in my mind, such as huge boss-fights in epic PlayStation 3-games. The sound was great, but I kept thinking: &#8220;How on earth am I going to be able to match this, visually? How can I live up to the expectations the sound is setting the scene for?&#8221;</p>
<p>I thought about all those things for a couple of days, and then, as it does, a happy accident occurred.</p>
<p>I stumbled upon some audio samples I had laying around on my harddrive. They sounded interesting so I chopped them up randomly to a 3 minutes collage. I also, for some reason, started modelling an old guy in ZBrush.</p>
<p>At this point I was slightly tired of the whole thing, but stuck to it anyway. Working on something was better than thinking about it. I believed that a solution would present itself, as it usually does.</p>
<p>I threw some bones onto the pretty sloppily created mesh and started animating it in a random way. No plot &#8212; just trying to forget how I would go about handling the miserable situation I was in. I had no idea on what to create, and I felt really bad for Marc who had created a great piece that simply wasn&#8217;t what I needed at the moment. I really wanted to use it, but it was dawning on me that it wasn&#8217;t what I was looking for this time.</p>
<p>I rendered out some seconds of crap and brought it into After Effects where I started playing with color correction and other generic things. I just wanted to keep working, waiting for <strong>the</strong> solution &#8212; <strong>the</strong> idea &#8212; <strong>the</strong> special technique.</p>
<p>This is when I more or less randomly started playing with a feature in After Effects called..</p>
<h3>Time Remapping</h3>
<p>Time Remapping squeezes and stretches your video footage by changing the timing and playback rate. You can slow down things or speed them up, and it does the same with the sound &#8212; just like a record on a turntable. It&#8217;s a very basic feature, and pretty much the first thing you learn when you start using it. However, I had I never thought about using this in a creative way. It was too simple, far away from the &#8220;epic effect&#8221; that you see in the movies. It&#8217;s totally overused, boring and just too simple.</p>
<p>In fact it&#8217;s so simple that I thought everyone using After Effects is using it. This is where ego kicked in.. &#8220;I wouldn&#8217;t use that &#8212; not me &#8212; the best digital artist in the universe &#8212; the one that only uses super-complex techniques &#8212; not even people at ILM do what I do..&#8221;</p>
<p><strong>What utter bullshit!</strong> Ego struck again! The little bastard in my head took over and was controlling me in a very destructive way that lead to total stagnation &#8212; and I didn&#8217;t even realize it at the time. Instead of having fun with the new software, the digital tools and playing around with them to create something cool in a fun way, my ego &#8212; the perfectionism and logical approach &#8212; ruined everything.</p>
<p>This cheap and simple trick which I just played with by accident ended up as the concept for the shole short. All the content I was to create in the coming four weeks would be held together by this very basic tool. I decided to write it down so as not to loose it: <em>&#8220;Create a very detailed creature, animate it in some way, sync it all with Time Remapping afterwards!&#8221;</em></p>
<p>This cheap, simple trick, found &#8220;by accident&#8221; was the concept for the whole movie. This would hold everything together. So I wrote it down that this won&#8217;t be lost again: &#8220;<em>I&#8217;m going to create a creature with the best skills I have at this time &#8211; I&#8217;m going to bring it into messiah and animate it in some way, but in perfect sync to the audio to &#8220;destroy&#8221; it afterwards with simple time remapping</em>&#8220;.</p>
<p>Then another problem presented itself: I still wanted Marc to do the soundscape. He has studied composition after all, and he&#8217;s by far my musician of choice to work with. But he needed some clips of the concept to create the audio, and that was a problem because none really existed at this point. My solution ended up being that I would animate the short with the glitchy audio I had already created, and he would create a new, better sound for it. Remixing it, in a way, but keeping the same major sync points.</p>
<p>Unfortunately, that never happened.</p>
<p>I was working non-stop with animating right up until the last day before Revision was about to begin, and therefore I couldn&#8217;t expect Marc to be able to create everything needed in only 12 hours. I&#8217;m quite sad about that, but I didn&#8217;t want to put him in the same position as I was in earlier &#8212; what if he wasn&#8217;t inspired with what I had created? Lesson learned: the next time I&#8217;m going to involve him at an earlier stage, promise.</p>
<h3>Giving life to the creature (blendshape creation with 3D layers)</h3>
<p>I spent some time modelling the figure, texturing it and creating the blendshapes for it. All of this was done inside of ZBrush. I love ZBrush, it has never let me down. In other applications you can very easily end up stuck in a one-way street somewhere down the pipeline or the production process, but with ZBrush I have never had this happen. At any point there is a way to backtrack and get back to what you need to change.</p>
<p style="text-align: left;"><img class="size-medium wp-image-863 aligncenter" src="http://www.displayhack.org/wp-content/uploads/Layers-451x250.jpg" alt="" width="496" height="275" /></p>
<p>So what are blendshapes? You can think of them as layers in Photoshop, except in 3D space. You create different &#8220;versions&#8221; of your model on layers and with a slider you can switch between these and create stuff like facial expressions this way.</p>
<p>These are then exported with the original mesh and connected inside of the 3D application. Every major-vendor 3D package has those &#8211; Blender, mMx, Maya etc, but their lingo might differ (like &#8220;morph targets&#8221;). These imported blendshapes are then invisibly connected to your original model and can seamlessly be blended into each other. This again can then be keyframed and animated.</p>
<h3>Principles of complex effects (or: &#8220;Hollywood has time and money&#8221;)</h3>
<p>One look I wanted to create for the project the figure was one of having the character look like he was coated with something like clay or mud. If you&#8217;ve seen any of the X-men movies then you probably know the character &#8220;Mystique&#8221; (if not: <a href="http://www.youtube.com/watch?v=upL3Y2V_5gY">this is what that looks like</a>). Her skin morphs in a pretty crazy way. It&#8217;s not just blended though, it looks like there&#8217;s more going on under the surface, like tiny, greebly, flaky stuff. It looks really hard, but actually it is &#8212; once again &#8212; very simple.</p>
<p>I couldn&#8217;t find the technique described in any tutorial, book or in the 3D forums online, so I couldn&#8217;t get it exactly right. My effect isn&#8217;t as elaborate or worked-through like the one I mentioned, but I think it worked out well and I&#8217;m going to show you the basic principles behind it.</p>
<p>The basic idea is to create two morph targets &#8212; one untouched (a clean slate, if you will) and one for the tranformed shape (a mask or one with scales or whatever you like). Step one is taking these two models and blend them using influence modifier objects like a sphere or a cube or any shape you can think of. That gets you started, and you have great control over the look of the animation, but the desired &#8220;greeble-look&#8221; isn&#8217;t there yet. So step two is to add complexity where the blending areas of the structure are switching from one shape to another. For this I created a third map that distorts the model in a very overdone way. Very random and crazy.</p>
<p>At that blending point this third map is basically used to &#8220;destroy&#8221; the geometry in a small rim. This gave me that &#8220;wrapping around&#8221; effect you see when the figure is coated. I could have used an animated map as well to enhance this effect even more (and I think this is how they create the skin effect on &#8220;Mystique&#8221; as mentioned above), but I was satisifed with the way it looked.</p>
<p>Another, simpler, technique would have been to render out two versions of the animation and then simply blend them in post-production. However, this won&#8217;t give you correct shadows and the compositing job would have been at least triple the work in the end. Real geometry is nearly always best, if you can get it right.</p>
<h3>The devil is in the Multi Displacement Map layering (aka &#8220;details&#8221;)</h3>
<p>As you might know, the models you can get from ZBrush can have a very high poly-count. With an average computer with 4 GB of RAM you can easily make models containing up to 100 million polygons or more.</p>
<p style="text-align: center;"><img class="size-medium wp-image-872 aligncenter" src="http://www.displayhack.org/wp-content/uploads/Displacement-333x250.jpg" alt="" width="433" height="325" /></p>
<p>ZBrush can handle this because internally it&#8217;s not using polygons, but something they call <em>pixols</em> &#8212; more commonly known as voxels. These are pixels with depth information. It&#8217;s a clever fake so that you can work comfortably inside of ZBrush without lag, but once you actually export the model, it is converted into real polygons. The most common approach to maintain a high detail level is to create a displacement map or normal map and place this onto a lower poly-count version of the model.</p>
<p>Displacement maps are nothing more than grayscale images (colored ones for normal maps) that create the illusion of having the same high detailed level. A little clarification: with normal maps this is the truth, but with displacement maps the high poly count is acually created during the rendering process.</p>
<p>I took these mapps and added them to the blending process in Messiah with the same influence blend modifieres to bring in details in the model and color-space as well. However, a single displacement map didn&#8217;t yield the result I was looking for so I had to research the technique of using so-called &#8220;Multi displacement maps&#8221;.</p>
<p>Imagine a base model, like a sphere with 100 polygons. You can create a displacement map that deforms this sphere in a good shape, like the basic shape of a human head. With only one displacement map you can just pull &#8220;outwards and inwards&#8221; to create indentations. The side planes of each newly created &#8220;extraction&#8221; can then not be affected anymore by the same displacement map and this is a shame.</p>
<p>If you extract a normal with a displacement map that results in some sort of &#8220;cubic&#8221; form. Then you have no information left in the map to extract the faces again in direct way, because the &#8220;detailing side parts&#8221; are simply just being created during the rendering process. With this in mind, a single displacement map wasn&#8217;t really that useful. You need another map that provides that information, and the good thing is that you can stack tons of maps onto each other and get really deep details out of it. At the time I started this project I didn&#8217;t know how to do this, but as it turns out, it was surprisingly simple (as in: just the click of a button). You can watch the process in the making-of video at the bottom of this post.</p>
<h3>Compositing is everything (or: &#8220;How to make crap look good&#8221;)</h3>
<p>With the model, morph targets and textures done, it was time to getting it to look good. While I&#8217;m proficient in creating 3D models, it&#8217;d be a lie to say that this is my favourite thing in the process. I see it more as a necessary evil, because creating things in virtual 3D space eventually brings you to the point where it starts to suck. Or to put it differently: you can never expect to finish your projects in your 3D programme. You need post-processing. Even if your lighting setup is perfect, you animation looks good and the models are perfect &#8212; the true power comes when you step out of 3D space and enter post-processing land.</p>
<p>When I started toying with 3D modelling and animation almost 15 years ago I thought that the way the professionals worked was to set up a scene, model, animate it, set up the lights and click the render-button. In reality, no movie is made in this way, because it&#8217;s simply neither practical nor yield good enough results. Think about it like layers: what if the base rendering takes 15 hours to finish? What are you going to do if the shadows are too dark or the colors are slighty off? You can&#8217;t just render it again &#8212; a very bad workflow.</p>
<p>The correct (and only) way to do it is to composit different layers on top of another, with the base rendering being the lowest lever in your chain. Everything is done in layers, and when combining them (following some simple principles and a few standard rules) is what nails the look and feel of a movie. Once you know these rules you are also capable of breaking them, which is what I usually do. In all my pieces they were at some point at a stage that I just played around in Photoshop to try the find a look or a feel, but the basic workflow and the principles remained the same.</p>
<p>Warning &#8212; soapbox moment! It&#8217;s really about the basics. Turning on a plugin isn&#8217;t just lame, it&#8217;s counter-productive, because it means you&#8217;ll never know what&#8217;s truly going on under the hood, and therefore unable to control it well. Some plugins can make your life easier when you are in a hurry, but is no substitute for having a really good set of basic skills. Do your homework. Buy books on anatomy and lighting. Knowing these basic principles will make your work better.</p>
<p>Oh, and a top-tip: always render to still image sequences. If you suffer a crash or a powerloss during rendering to a movie-file, all is lost, while if you worked on a still image sequence, you can just set your renderer to continue where it left off.</p>
<h3>Shading the character</h3>
<p>The best looking renders, in my opinion, are the ones I get directly out of ZBrush. ZBrush is fast and uses lighting baked into so-called MatCap Materials. The only problem with ZBrush is that it has no real 3D space. Again, these are only pixels with depth information and so you can&#8217;t &#8220;go around them&#8221; (or I should rather say &#8220;walk inside of a model&#8221;), because you can&#8217;t rotate 2D. In ZBrush it&#8217;s actually 2.5D information you&#8217;re dealing with</p>
<p>To make skin look real you need a feature called subsurface scattering. Think of it as holding your hand in front of a strong light-source at night, where you can see the light through our fingers. This is due to the scattering of light inside of your skin. I really wanted this look in the movie, so to enhance it I set up a simple shading network inside of Messiah to get a rim shader.</p>
<p>For stills I get everything out of the programme: depth Pass, diffuse pass, SSS, specularity and so on. The trick lies in using these elements to make it look real in the compositing stage in Photoshop (if you&#8217;re working on a still image) or After effects (for movies).</p>
<p>The key things are: color, perspective, depth and hue.</p>
<p><img class="size-large wp-image-886 alignright" src="http://www.displayhack.org/wp-content/uploads/Compositing-1024x597.jpg" alt="" width="430" height="251" /></p>
<p>I&#8217;m going to show you a simple way of getting a simple, really ugly and random scene to look realistic in some way by just following a few simple steps. Mind you, this technique is for still images only. You can see the end result in this image to the right, and for the how-to, watch the making-of video at the bottom of this post where I go through each step of the creation of this image.</p>
<h3>Getting the look down to a sensible render time</h3>
<p>I wanted to use the so-called MatCap Materials for the shading of the skin. Matcaps handle the way of shading in a very clever and fast way, and they look really cool, so I wanted to use these inside of Messiah. In Maya or Blender the setup for such a shading network is pretty easy, but not in version 6 of Maya. In messiah I had no clue on how do it, but luckily there is a nice and friendly Messiah-community from which I got help an tips on this. One of them even set up a full shading network for me, but sadly had no time to implement it due to the looming deadline. In my next production I&#8217;m going to use these techniques.</p>
<p>However, I still want to show you how the MatCaps can be used inside of Blender. The workflow can be most likely be applied to every other major 3D package.</p>
<p>In ZBrush, just render out a sphere with the desired material applied to it. Make sure the document width and height are at the same settings and that the sphere is perfectly placed in the center. Oh, and turn of perspective in ZBrush &#8212; using the orthogonal view will give you the same result. Export that texture and map it using to the color channel using the normals. Make sure that your shader is turned to shadeless because the light is already baked into the the texture, and the painted color information from the actual model is simply added on top of that. This way, you&#8217;ll get the exact same look as if you were still in ZBrush. That&#8217;s it.</p>
<p><img class="size-medium wp-image-897 alignleft" src="http://www.displayhack.org/wp-content/uploads/Shading-336x250.jpg" alt="" width="363" height="270" /></p>
<p>With everything rendered out, it was time to have fun! I used Time Remapping here and there in After Effects and was fascinated by the sense of randomness and oppressive mood that it caused. The character was absolutely animated to the sound, but with the added effect of having the sound also stretched and squeezed where I used Time Remapping. I really liked how everything was coming together at this point.</p>
<p>One thing I haven&#8217;t touched upon is the glass panel in the movie. It was entirely done in post. Just a simple 2D tracking of the hands touching the glass and then a few dirt textures on a null object.</p>
<p>In terms of the story, my first idea was to the character break the glass when he hits it, but I found it more creepy and scary if he was still stuck behind the wall of glass.</p>
<h3>&#8220;Making-of&#8221; and explore the scene files</h3>
<p>If you&#8217;re interested in the scene files for this movie you can download them (<a href="http://www.higher-lyrics.de/project.7z" class="broken_link">project files</a> &amp; <a href="http://www.higher-lyrics.de/head.7z" class="broken_link">head</a>), play with them and explore how they were done. I have also created a 30-minutes &#8220;Making-of&#8221; video which touches on many of the techniques described above.</p>
<p>I want to say thank you for your time and your interest in how all this was done. Of course not every single aspect and every problem that occurred during the creation process could be described here. Even if I&#8217;d tried to cover them here to warn you before embarking on your own projects, other problems will still occur. The devil is in the details.</p>
<p>It was really, really hard work to create this movie. Pain and fun and I earned a lot by going through the process. If they happen to read this, I would like to offer an apology to my friends and family who were really forgiving during my mood-swings. :) Also, thanks to the people sharing their comments and critique about the movie so far &#8212; I hope you will take time to watch it and comment below as well.</p>
<p>So, stay tuned, keep creating you own productions, don&#8217;t let discipline and perfectionism ruin your creativity &#8212; just don&#8217;t take life too serious and have fun (yes, I know &#8212; this applies to me as well :)</p>
<p><iframe src="http://player.vimeo.com/video/28123820?title=0&amp;byline=0&amp;portrait=0&amp;color=f20505" width="621" height="349" frameborder="0"></iframe></p>
 <p><a href="http://www.displayhack.org/?flattrss_redirect&amp;id=892&amp;md5=cde45ad54e0bba3c60e386b9f29a2c66" title="Flattr" target="_blank"><img src="http://www.displayhack.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/displayhack/~4/KUeXDpULQhU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.displayhack.org/2011/the-lacquerer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=displayhack&amp;popout=1&amp;url=http%3A%2F%2Fwww.displayhack.org%2F2011%2Fthe-lacquerer%2F&amp;language=en_GB&amp;category=text&amp;title=Making-of%3A+%26%238220%3BThe+Lacquerer%26%238221%3B&amp;description=Hi%2C+I%26%238217%3Bm+Ollie+%26%238220%3Bcosmic%26%238221%3B+Borgardts%2C+and+I+am+the+creator+of+the+animated+short+%26%238220%3BThe+Lacquerer%26%238221%3B.+I%26%238217%3Bm+going+to+do+my+best+to+make+this+an+interesting+and+entertaining+read%2C...&amp;tags=after+effects%2Canimation%2Cbehind+the+scenes%2Cblender%2Cmaya%2Cmessiah%2Cmodelling%2Cslider%2Ctechniques%2Czbrush%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.displayhack.org/2011/the-lacquerer/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=the-lacquerer</feedburner:origLink></item>
	</channel>
</rss>
