<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Real-Time Rendering &#187; javascript</title>
	<atom:link href="http://www.realtimerendering.com/blog/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.realtimerendering.com/blog</link>
	<description>Tracking the latest developments in interactive rendering techniques</description>
	<lastBuildDate>Sun, 12 May 2013 00:21:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>Books: The Good, The Bad, and Some Third Category</title>
		<link>http://www.realtimerendering.com/blog/books-the-good-the-bad-and-some-third-category/</link>
		<comments>http://www.realtimerendering.com/blog/books-the-good-the-bad-and-some-third-category/#comments</comments>
		<pubDate>Thu, 11 Oct 2012 17:45:05 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[VDM Publishing]]></category>
		<category><![CDATA[WebGL]]></category>

		<guid isPermaLink="false">http://www.realtimerendering.com/blog/?p=3231</guid>
		<description><![CDATA[Due to a long plane flight, this week I started reading up on WebGL in earnest, going beyond the various tutorials on the web. The two books recommended to me that I&#8217;ve started on (and skimmed through in their entirety &#8211; I need to sit down with each in front of a computer): WebGL: Up [...]]]></description>
			<content:encoded><![CDATA[<p>Due to a long plane flight, this week I started reading up on WebGL in earnest, going beyond <a href="http://www.realtimerendering.com/blog/webgl-resources/">the various tutorials on the web</a>. The two books recommended to me that I&#8217;ve started on (and skimmed through in their entirety &#8211; I need to sit down with each in front of a computer):</p>
<p><a href="http://www.amazon.com/WebGL-Up-Running-Tony-Parisi/dp/144932357X?tag=realtimerenderin"><em><img class="alignleft" title="WebGL: Up and Running" src="https://images-na.ssl-images-amazon.com/images/I/51OQ8Vx8nXL._SL110_.jpg" alt="" width="84" height="110" />WebGL: Up and Running</em></a>, by Tony Parisi, O&#8217;Reilly Press, August 2012. More info about the book <a href="http://shop.oreilly.com/product/0636920024729.do">here</a>, including a sample. I recall Tony from way back in the days of VRML, he had one of the first viewers for that file format, so he&#8217;s been working in this area of 3D graphics for the web for a long time. This looks to be a good book if your goal is indeed to get something on the screen fast. It&#8217;s readable, and I appreciate his use of URLs to WebGL demos and resources and (properly credited) Wikimedia images. The code samples for the book are <a href="https://github.com/tparisi/WebGLBook">here on github</a>.</p>
<p>It uses the popular <a href="https://github.com/mrdoob/three.js">three.js</a> library to insulate you from the OpenGL ES roots of WebGL and hide its raw API nature. The author of three.js, <a href="https://github.com/mrdoob">Mr.doob</a> (I don&#8217;t make these names up), notes that his work is &#8220;a lightweight 3D library with a very low level of complexity — in other words, for dummies&#8221;. Which is a fine thing, and I think I&#8217;ll be using it myself to teach introductory computer graphics. However, if you want to gaze at the occult pulsing mutation spawned of JavaScript + OpenGL ES + DOM + JSON + HTML 5, I mean, unleash the full power of WebGL itself, you&#8217;ll want to read the next book instead.</p>
<p><em><a href="http://www.amazon.com/WebGL-Beginners-Guide-Diego-Cantor/dp/184969172X?tag=realtimerenderin"><img class="alignleft" title="WebGL Beginner's Guide" src="https://images-na.ssl-images-amazon.com/images/I/41mwCNvB4nL._SL110_.jpg" alt="" width="89" height="110" /></a><a href="http://www.amazon.com/WebGL-Beginners-Guide-Diego-Cantor/dp/184969172X?tag=realtimerenderin">WebGL Beginner&#8217;s Guide</a></em>, by Diego Cantor and Brandon Jones, Packt Publishing, June 2012 (<a href="https://bitbucket.org/dcantor/webgl-beginners-guide-code/overview">code here</a>). This is a pretty impressive book overall. The authors deal with WebGL directly, adding only the <a href="https://github.com/toji/gl-matrix">glMatrix library on github</a> to make matrix manipulation easier (this is about as minimal as you can get). This book walks through much of what WebGL does (essentially, the same as OpenGL, of course), giving lots of code examples and worthwhile illustrations. Some example programs are quite nice, with useful user interfaces allowing you to twiddle values and see the effect. The book deals with more advanced topics towards the end, such as how to render offscreen and sample the results (their example is for performing picking). There are a few minor problems with layout on my iPad (a few illustrations don&#8217;t fit and there&#8217;s an awkward scrolling interface that doesn&#8217;t quite work), and some occasional lapses in grammar, but overall the book is fine. Occasionally the authors will get distracted by side topics, like a full derivation of why you use the inverse transpose of the matrix for transforming normals, or explaining a shader that does simple ray tracing. In general, however, the book works through the key areas of the WebGL API and warns you of potential problems along the way. WebGL itself exposes you directly to vertex and fragment shaders, so if you are planning to do some serious work in this area, this book is perhaps a better choice that Parisi&#8217;s (that said, three.js itself gives you easy access to shaders).</p>
<p>Personally, these two WebGL books were cheap enough on Kindle that I bought them both. The<em> Beginner&#8217;s Guide</em> in particular is a much better deal on Kindle &#8211; a third the physical book&#8217;s price. They&#8217;re actually better on Kindle, in that they&#8217;re in color; the physical books are printed with grayscale images. There are <a href="http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&amp;field-keywords=webgl">other books on WebGL</a>, but these were the two recommended to me and they are both reasonable choices, depending on your goals. I would not recommend either if your primary goal is learning the fundamentals of computer graphics (though there&#8217;s a bit of that type of material in each). For learning WebGL itself and the basics of what it offers, both books are fine, with the &#8220;WebGL Beginner&#8217;s Guide&#8221; being aimed at the more &#8220;to the metal&#8221; programmer.</p>
<p><em><a href="http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742?tag=realtimerenderin"><img class="alignleft" title="JavaScript: The Good Parts" src="https://images-na.ssl-images-amazon.com/images/I/51gdVAEfPUL._SL110_.jpg" alt="" width="84" height="110" /></a><a href="http://www.amazon.com/JavaScript-The-Good-Parts-ebook/dp/B0026OR2ZY?tag=realtimerenderin">JavaScript: The Good Parts</a></em>, by Douglas Crockford, O&#8217;Reilly Press, May 2008. If you use WebGL, you&#8217;ll have to know at least a bit about JavaScript. <a href="http://www.realtimerendering.com/blog/webgl-resources/">Patrick Cozzi mentioned this</a> as a reasonable guide, along with <a href="http://javascript.crockford.com/">other writings by the author</a>. I&#8217;ve only started it, but it&#8217;s pretty amusing. The book&#8217;s approach is to indeed teach only the good parts about the language and not let you know how to use the bad parts. The author recommends only one of the dozens of books on JavaScript, <em><a href="http://www.amazon.com/exec/obidos/ASIN/0596101996?tag=realtimerenderin">JavaScript: The Definitive Guide</a></em>. He feels the rest are, to quote, &#8220;<a href="http://javascript.crockford.com/javascript.html">quite awful</a>.&#8221;</p>
<p><em>Update:</em> I finished this book and thought it got better as it went along. It starts out a bit language-wonkish, too much about grammar. Skip that chapter. The most useful parts were the appendices, where he explains the various parts of JavaScript clearly and succinctly, calls out the dangerous and evil parts of the language, and explains how to steer clear of them. The author came up with <a href="http://www.jslint.com/">JSLint</a>, which checks your code for badness, but to be honest it&#8217;s way too a strict schoolmarm for me, hitting me on the knuckles whenever I put a left brace &#8220;{&#8221; on the wrong line. I recommend <a href="http://www.jshint.com/">JSHint</a> instead.</p>
<p>Enough on WebGL and JavaScript, my current interests. I&#8217;ll mention just two more books that I&#8217;ve only just glanced at and so can jump to conclusions.</p>
<p><a href="http://www.amazon.com/Real-Time-Graphics-Rendering-Advanced-Technology/dp/3642183417?tag=realtimerenderin"><img class="alignleft" title="Real-Time Graphics Rendering Engine (Advanced Topics in Science and Technology in China)" src="https://images-na.ssl-images-amazon.com/images/I/51%2BuVLFgGJL._SL110_.jpg" alt="" width="73" height="110" /></a><a href="http://www.amazon.com/Real-Time-Graphics-Rendering-Advanced-Technology/dp/3642183417?tag=realtimerenderin"><em>Real-Time Graphics Rendering Engine</em></a> (Advanced Topics in Science and Technology in China), by Hujun Bao and Wei Hua, Springer Publishing. Shame on you, Springer, for shame. A 300 page book for $169 is bad enough, but this one has a slap-dash translation that could probably have been done better by <a href="http://translate.google.com/">Google Translate</a>. I&#8217;m judging only from the &#8220;Look Inside&#8221; text I can access on <a href="http://www.amazon.com/Real-Time-Graphics-Rendering-Advanced-Technology/dp/3642183417?tag=realtimerenderin">the Amazon listing</a>, but I see things like a section labelled &#8220;Rending Modle&#8221; on page 5. This might be a fine book in its native Chinese, the bits of material I tried to read seemed sound enough, but the translation is, well, judge for yourself. Here&#8217;s the end of chapter summary, a section I picked at random:</p>
<p style="padding-left: 30px;">&#8220;Real-time rendering is always formed as a pipeline composed of consequential data processing and graphics calculations to generate final rasterized images. In order to achieve amazing rendering effects as well as real-time performance, GPU techniques, especially shader techniques, are introduced to utilize programmable pipelines and the parallel computing structure. Virtual geometric 3D models are transformed to be located in a virtual scene by geometrical transformation matrices. Material and/or other visual properties are then attached to those geometrical models to compute visually pleasant rendering results. As the performance of real-time rendering applications is highly emphasized, tailored shading techniques and BRDF models are employed to achieve real-time rendering results with balanced visual effects.&#8221;</p>
<p>I feel terrible for these authors whose work has been so shabbily thrown between two covers.</p>
<p>However, there is certainly a worse book out there, and I have to give the full-sized cover from its Amazon listing, since I expect it to disappear any day now and I want to keep it as a memento.</p>
<p><a href="http://www.amazon.com/dp/6200468621?tag=realtimerenderin"><img class="alignleft" title="Eric Haines, the book" src="https://images-na.ssl-images-amazon.com/images/I/41k6fyKythL._SL600_.jpg" alt="" width="333" height="500" /></a><br />
Suck it, bizzatches, I got me <a href="http://www.amazon.com/dp/6200468621?tag=realtimerenderin">my own book on Amazon</a>. Yes, the title is my name, it&#8217;s ostensibly a biography; I&#8217;m not the author. I ran across it yesterday morning, and it almost made me laugh. Almost, because I hate these &#8220;books&#8221;. It&#8217;s clearly by the same people who came up with all those other automated offerings, <a href="http://en.wikipedia.org/wiki/VDM_Publishing">VDM Publishing</a>.</p>
<p>I&#8217;ve posted about this so-called publisher before, <a href="http://www.realtimerendering.com/blog/best-book-title-ever-period/">here</a> and <a href="http://www.realtimerendering.com/blog/another-introduction-to-ray-tracing/">here</a>. VDM now has a new imprint, &#8220;Cel Publishing&#8221; (one of <a href="http://en.wikipedia.org/wiki/VDM_Publishing#Multiplication_of_imprint_names">seventy-nine</a>!), I expect because the Alphascript and Betascript Publisher books are fast disappearing from Amazon&#8217;s catalog as the complaints and returns roll in. The short version is that this firm has a program that grabs <a href="http://en.wikipedia.org/wiki/Eric_Haines">a random Wikipedia page</a> and follow links from it. Once there&#8217;s enough material for a book-sized book, it spits out the contents. Some human &#8211; in this case allegedly one &#8220;Iustinus Tim Avery&#8221; (<a href="http://www.wordsmith.org/anagram/anagram.cgi?anagram=Iustinus+Tim+Avery&amp;t=1000&amp;a=n">anagram server&#8217;s first hit</a> is &#8220;Autism University&#8221;) &#8211; slaps a cover on it and it&#8217;s put in the catalog, to be published on demand.</p>
<p>The most creative part of the process used to be the cover choice. In the past they were sometimes pretty amusing, but it looks like Cel Publishing has removed that fun part of the job for the &#8220;editor&#8221; and instead just uses random abstract patterns. I personally think of myself as more of a splash of chartreuse paint, but so be it. Also, the book is clearly underpriced at $38 for 60 pages. What did make me laugh is that there&#8217;s now <a href="http://www.amazon.com/Eric-Haines-Iustinus-Tim-Avery/dp/6200468621?tag=realtimerenderin">a review</a> of the book (thanks, Matt!).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.realtimerendering.com/blog/books-the-good-the-bad-and-some-third-category/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebGL Browser Editors</title>
		<link>http://www.realtimerendering.com/blog/webgl-browser-editors/</link>
		<comments>http://www.realtimerendering.com/blog/webgl-browser-editors/#comments</comments>
		<pubDate>Wed, 15 Aug 2012 14:53:20 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[editors]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[WebGL]]></category>

		<guid isPermaLink="false">http://www.realtimerendering.com/blog/?p=3223</guid>
		<description><![CDATA[I asked Patrick Cozzi if he knew of any WebGL editors working in the browser. There turn out to be quite a few, each with their own focus: http://webglplayground.net/ &#8211; on the left is the code, on the right is the result. See the gallery for more examples, which tend towards 2D and artistic examples. http://glsl.heroku.com/ [...]]]></description>
			<content:encoded><![CDATA[<p>I asked Patrick Cozzi if he knew of any WebGL editors working in the browser. There turn out to be quite a few, each with their own focus:</p>
<ul>
<li dir="ltr"><a href="http://webglplayground.net/">http://webglplayground.net/</a> &#8211; on the left is the code, on the right is the result. See <a href="http://webglplayground.net/gallery">the gallery</a> for more examples, which tend towards 2D and artistic examples.</li>
<li dir="ltr"><a href="http://glsl.heroku.com/">http://glsl.heroku.com/</a> &#8211; code actually overlays the display itself. <a href="http://glsl.heroku.com/e#3910.1">Here is a more 3D example</a>.</li>
<li dir="ltr"><a href="http://spidergl.org/meshade/index.html">http://spidergl.org/meshade/index.html</a> &#8211; more elaborate, shows separate shaders, model loading, and JSON and HTML generated. To run, click “Load” to load the given model, which you can interact with.</li>
<li dir="ltr"><a href="http://www.iquilezles.org/apps/shadertoy/">http://www.iquilezles.org/apps/shadertoy/</a> &#8211; allows playing with the pixel shader, essentially. Mostly about image deformations, often encountered in old Demo Scene programs.</li>
<li dir="ltr"><a href="http://www.kickjs.org/example/shader_editor/shader_editor.html">http://www.kickjs.org/example/shader_editor/shader_editor.html</a> – for playing with a 3D object and trying out experiments with the vertex and pixel shaders in the GPU.</li>
<li dir="ltr"><a href="http://cesium.agi.com/Cesium/Apps/Sandcastle/index.html">http://cesium.agi.com/Cesium/Apps/Sandcastle/index.html</a> &#8211; give it time to load (hey, it&#8217;s loading the whole world). It shows a quite elaborate development environment. They are using <a href="http://codemirror.net/">CodeMirror</a> to do the in-browser editor. See their other demos <a href="http://cesium.agi.com/demos.html">here</a>.</li>
<li dir="ltr"><a href="http://jsfiddle.net/">http://jsfiddle.net/</a> &#8211; a more general tool for trying out JavaScript programs, not WebGL per se.</li>
</ul>
<p>Enjoy! And let us know of any others you find.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.realtimerendering.com/blog/webgl-browser-editors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seven Things for June 7th</title>
		<link>http://www.realtimerendering.com/blog/seven-things-for-june-7th/</link>
		<comments>http://www.realtimerendering.com/blog/seven-things-for-june-7th/#comments</comments>
		<pubDate>Fri, 08 Jun 2012 12:08:46 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[cone tracing]]></category>
		<category><![CDATA[global illumination]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Unreal]]></category>
		<category><![CDATA[videogames]]></category>
		<category><![CDATA[WebGL]]></category>
		<category><![CDATA[woodcuts]]></category>

		<guid isPermaLink="false">http://www.realtimerendering.com/blog/?p=3099</guid>
		<description><![CDATA[I&#8217;ll be gone this weekend, so my dream of catching up on resources by posting every day is slowed a bit. Here&#8217;s today&#8217;s seven: The free Process Explorer has a lot more functionality than its name implies. One very cool feature is that it actually shows GPU usage. Run it, right-click a process that&#8217;s running and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll be gone this weekend, so my dream of catching up on resources by posting every day is slowed a bit. Here&#8217;s today&#8217;s seven:</p>
<ul>
<li>The free <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653">Process Explorer</a> has a lot more functionality than its name implies. One very cool feature is that it actually shows GPU usage. Run it, right-click a process that&#8217;s running and select Properties, then go to the GPU Graph tab to watch memory use and GPU load.</li>
<li>If you are seriously involved in implementing bump maps, parallax occlusion maps, etc., <a href="http://mmikkelsen3d.blogspot.com/">Morten Mikkelsen&#8217;s blog</a> has a lot of chewy information, along with demos and source. He&#8217;s doing a lot of interesting work on autogenerating and blending mappings.</li>
<li>The game itself is no great shakes, but <a href="http://www.playmapscube.com/">Google&#8217;s Cube</a> has some lovely 3D rendering going on via javascript.</li>
<li>Another &#8220;3D in the browser&#8221; experiment (with WebGL) is <a href="http://www.sketchpatch.net/labs/livecodelabIntro.html">sketchPatch</a>. It&#8217;s not as simple as advertised, but I like the idea of an interpreted language you just type and see in the same window.</li>
<li>There are lots of reasons Unreal Engine 3 is the most popular commercial 3D engine for games. Here&#8217;s <a href="http://udn.epicgames.com/Three/ImageBasedReflections.html">some nice eye candy</a> from their tutorial on image reflection, which is also just plain educational.</li>
<li>Some cool results <a href="http://www.youtube.com/watch?v=fAsg_xNzhcQ">here</a> using cone tracing for global illumination effects. Seeing these effects for dynamic objects at interactive rates is great stuff, especially since they&#8217;re having to update octrees on the fly.</li>
<li>I love the <a href="http://jedhenry.tumblr.com/">colored Japanese woodcuts of classic videogames</a> that Jed Henry has been making:</li>
</ul>
<p><img class="alignnone" title="Link" src="http://25.media.tumblr.com/tumblr_m45l6jyzEa1rtd4n3o1_r1_500.jpg" alt="" width="500" height="666" /> <img class="alignnone" title="Mario Kart" src="http://25.media.tumblr.com/tumblr_m4h8k1u95P1rtd4n3o1_500.jpg" alt="" width="500" height="666" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.realtimerendering.com/blog/seven-things-for-june-7th/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>