<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2771136320792770049</id><updated>2011-04-21T17:40:58.761-07:00</updated><title type='text'>A Journal of Parallax</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ajournalofparallax.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2771136320792770049/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ajournalofparallax.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ben</name><uri>http://www.blogger.com/profile/08423297571444513453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2771136320792770049.post-4575627163706324213</id><published>2008-04-28T11:41:00.000-07:00</published><updated>2008-04-28T12:10:36.710-07:00</updated><title type='text'>Of prisms and imprisonment</title><content type='html'>My esteemed Cordelia,&lt;br /&gt;&lt;br /&gt;A thousand apologies for my extended &lt;span style="font-style: italic;"&gt;incommunicado&lt;span style="font-style: italic;"&gt; &lt;/span&gt;&lt;/span&gt;period. I was suddenly kidnapped and held as a hostage by bank robbers in Bahrain. There, through the grace of Providence, I was able to befriend a llama and ultimately effect my escape. Luckily this eventuality had been anticipated in my Gantt chart, so I am yet on track. Onward!&lt;br /&gt;&lt;br /&gt;You will recall in my last Missive a description of a box with shaders applied to the sides and top. In three dimensions, the natural extension is a triangular prism: One triangular top face, and three rectangular sides. In this formulation, a mesh would be built up from intersecting triangular prisms, the top face of each corresponding to a triangle in the polygonal surface. The intersection of the prisms, however, is suboptimal, inasmuch as it can lead to overdraw and complicates the mesh structure.&lt;br /&gt;&lt;br /&gt;Luckily, no intersection is necessary, because the "boxes" need not be prisms! Instead, they form arbitrary nonpyramidal triangular frusta, or trapezoids in the two-dimensional case. Each one has its top face as a face in the polygonal surface, as before, and the bottom face is a constant distance away, but the other three rectangular faces need not be orthogonal to the top face. Instead, these faces are simply chosen to avoid intersection with neighboring polygons, most easily by placing each one in the equiangular plane between the two faces which it connects. The result is a set of nonintersecting (but fully incident) frusta, each one defined by a top face, a depth, and three planes. A ray which is incident on a frustum, then, will find an intersection with the virtual surface no further than the point at which the ray exits the frustum by the top face or one of the three side faces. This point along the ray is easily determined with standard ray-plane intersection formulæ&lt;code&gt;&lt;/code&gt; (provided, of course, that no ray is truncated by intersection from outside the frustum, as would be the case if the ray entered through the side of the frustum).&lt;br /&gt;&lt;br /&gt;Implementation of the algorithm proceeds tolerably well. Switching from NVidia's FX Composer to a more low-level XNA housing has manifestly improved the ease with which I can test and debug problems which occur. A fascinating byproduct of the representation of frusta is that the same shader works equally well for sides as well as the top. All that is necessary is to define three-dimensional texture coordinates, such that the precondition that all points incident on the frustum have w=0 is relaxed.&lt;br /&gt;&lt;br /&gt;With warm regards from Eswar the llama,&lt;br /&gt;&lt;br /&gt;Ben&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2771136320792770049-4575627163706324213?l=ajournalofparallax.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ajournalofparallax.blogspot.com/feeds/4575627163706324213/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2771136320792770049&amp;postID=4575627163706324213' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2771136320792770049/posts/default/4575627163706324213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2771136320792770049/posts/default/4575627163706324213'/><link rel='alternate' type='text/html' href='http://ajournalofparallax.blogspot.com/2008/04/of-prisms-and-imprisonment.html' title='Of prisms and imprisonment'/><author><name>Ben</name><uri>http://www.blogger.com/profile/08423297571444513453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2771136320792770049.post-6495752528506983908</id><published>2008-03-27T06:24:00.000-07:00</published><updated>2008-03-28T10:43:23.475-07:00</updated><title type='text'>The Solution</title><content type='html'>My esteemed Cordelia,&lt;br /&gt;&lt;br /&gt;I must apologise. When I came to the close of my last Missive, I must have left you in a frightful state. To appeal to your fancy with stories of the wonders of parallax mapping, only to cruelly cut down the technique with diagrams of despair...! it strains morality. But fear not, Cordelia: I have a solution to the problems of parallax mapping. I will first solve a problem that you may not yet have thought of (although it is intimately related to the problem already discussed): That of a ray entering below the polygonal surface.&lt;br /&gt;&lt;br /&gt;Let us return to the issue of the polygonal versus the virtual surface. Until now, I have treated them as two separate entities, linked by large-scale shape but unconnected otherwise. But this is not so! Pray examine, Cordelia, the other feature present in the first picture of that last posting: to wit, the brown line. If the polygonal surface places a maximum on the height of the virtual surface (normal to that polygon), then the brown line may be thought of as a minimum. These are two of the extents of the area in which the entire virtual surface must fall. In the two-dimensional case here, we need define two more: the left and right. Behold:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_x6lYqIlQdP0/R-0DhyZ1MFI/AAAAAAAAAAk/36ZkiyLyXd8/s1600-h/sides.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_x6lYqIlQdP0/R-0DhyZ1MFI/AAAAAAAAAAk/36ZkiyLyXd8/s400/sides.png" alt="" id="BLOGGER_PHOTO_ID_5182802625173991506" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;What, you may ask, does this gain us? Well, in this ideal case, nothing. But now consider this less auspicious viewing ray.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_x6lYqIlQdP0/R-0EFiZ1MGI/AAAAAAAAAAs/opoN15znWhw/s1600-h/sides2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_x6lYqIlQdP0/R-0EFiZ1MGI/AAAAAAAAAAs/opoN15znWhw/s400/sides2.png" alt="" id="BLOGGER_PHOTO_ID_5182803239354314850" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;In this case, the viewing ray has no intersection whatsoever with the polygonal surface. How, then, is it to be rendered? The fragment program is never invoked!&lt;br /&gt;&lt;br /&gt;And indeed, with classical parallax mapping it would not be. But in this picture I have also given the answer: The &lt;span style="font-style: italic;"&gt;side itself&lt;/span&gt; is rasterized, and invokes the fragment program. Not the same fragment program as for the top face, for you may be certain, Cordelia, that it would be quite confused by its unexpected orientation and produce all manner of outlandish results. But some small modifications can easily correct this problem and lead to the correct generation of texture indices, ray marching, &amp;amp;c.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Nota bene&lt;/span&gt;: the sides, like the top, will benefit from backface culling. After all, a ray entering the box I have defined here will only produce a first intersection with the inside of one of the sides if it originates inside the box itself (a situation I do not here address) or through the bottom. But if the parent object is polyhedral and closed, no such ray can arise save one which originates in the cavity of the parent object, which is again a situation I do not here address. In the common case, therefore, the only possible explanation for a backface collision with either the top or the sides is that polygons have been rendered in a suboptimal manner, and that a later polygon will overdraw this one. Better, then, not to render this first erroneous polygon at all.&lt;br /&gt;&lt;br /&gt;With condolences on the mishap that recently befell your livery,&lt;br /&gt;&lt;br /&gt;Ben&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2771136320792770049-6495752528506983908?l=ajournalofparallax.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ajournalofparallax.blogspot.com/feeds/6495752528506983908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2771136320792770049&amp;postID=6495752528506983908' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2771136320792770049/posts/default/6495752528506983908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2771136320792770049/posts/default/6495752528506983908'/><link rel='alternate' type='text/html' href='http://ajournalofparallax.blogspot.com/2008/03/solution.html' title='The Solution'/><author><name>Ben</name><uri>http://www.blogger.com/profile/08423297571444513453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_x6lYqIlQdP0/R-0DhyZ1MFI/AAAAAAAAAAk/36ZkiyLyXd8/s72-c/sides.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2771136320792770049.post-1404075046327384108</id><published>2008-03-25T07:45:00.000-07:00</published><updated>2008-03-25T08:20:48.253-07:00</updated><title type='text'>Some specifics</title><content type='html'>My esteemed Cordelia,&lt;br /&gt;&lt;br /&gt;Parallax mapping, in its essentials, may be quite simply described. One considers two surfaces: the polygonal surface described by the actual triangles sent to the renderer, and a virtual surface at some depth below the polygonal surface. This virtual surface may be of much higher resolution, as it is described by a texture rather than by geometry and thus fine details are a matter of texture memory rather than vertex transformation and triangle rasterization. It is this surface which is portrayed in the rendering.&lt;br /&gt;&lt;br /&gt;But how, you may ask? How is this gallant Feat accomplished?&lt;br /&gt;&lt;br /&gt;Why, by means of ray-tracing, Cordelia! When it comes time to render a Fragment of a triangle thus blessed with an underlying virtual surface, a complicated set of steps begins. The details of these machinations are the subject for another letter, but the geometrickal meaning is clear. Pray examine, Cordelia, the  drawing below.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_x6lYqIlQdP0/R-kTVSZ1MCI/AAAAAAAAAAM/eVZp_64VlDY/s1600-h/raytrace.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_x6lYqIlQdP0/R-kTVSZ1MCI/AAAAAAAAAAM/eVZp_64VlDY/s400/raytrace.png" alt="" id="BLOGGER_PHOTO_ID_5181694102704828450" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In this drawing, the green line represents the polygonal surface, and the black line the virtual surface. (Note that the green line is utterly flat-- this is the first murmur of the weakness of this Technique!) The yellow line represents a view ray which, under normal circumstances, would intersect the surface at the blue point and produce the image of a flat plane. Instead, the fragment program searches forwards in the bump map, in order to find not an intersection with the polygon surface, but one with the virtual surface. In this case, this is found at the red point. The program then renders the fragment as though it &lt;span style="font-style: italic;"&gt;were&lt;/span&gt; at the red point, giving the illusion of depth where none exists.&lt;br /&gt;&lt;br /&gt;I say "illusion", Cordelia, for such it is! In the published descriptions of Parallax mapping (see N. Tatarchuk's "Practical Dynamic Parallax Occlusion Mapping",  &amp;amp;c.) a dreadful deception has been perpetrated upon the good people of Graphics! Virtually all examples in such publications show the technique applied only to large, flat planes, and then only to bump maps which tile seamlessly. Why? Because this technique fails in precisely the point where the surface bends. Witness the revised example below:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_x6lYqIlQdP0/R-kWtiZ1MDI/AAAAAAAAAAU/HgxxPIRlKHY/s1600-h/raytrace_bend.png"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_x6lYqIlQdP0/R-kWtiZ1MDI/AAAAAAAAAAU/HgxxPIRlKHY/s400/raytrace_bend.png" alt="" id="BLOGGER_PHOTO_ID_5181697817851539506" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;Here, the surface bends, avoiding any intersection with the viewing ray whatsoever. One would imagine the ray, therefore, to extend into blessed Oblivion, and produce no color or depth. Not so! Because the lookup is performed in texture space, rather than object space, the test proceeds as follows:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_x6lYqIlQdP0/R-kXjiZ1MEI/AAAAAAAAAAc/FkOq-tKqEFI/s1600-h/raytrace_bend2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_x6lYqIlQdP0/R-kXjiZ1MEI/AAAAAAAAAAc/FkOq-tKqEFI/s400/raytrace_bend2.png" alt="" id="BLOGGER_PHOTO_ID_5181698745564475458" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;You see? It is as though a bend never occurred. The fragment shader has no way of discarding a fragment due to lack of intersection, because in the simplified geometry of parallax mapping, there will always be an intersection. Hence the only silhouette of a parallax mapped object is that of its accursed polygonal surface. This, then, is the weakness of the otherwise miraculous Parallax Mapping.&lt;br /&gt;&lt;br /&gt;With hopes of a happy Feast of St. Agnes,&lt;br /&gt;&lt;br /&gt;Ben&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2771136320792770049-1404075046327384108?l=ajournalofparallax.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ajournalofparallax.blogspot.com/feeds/1404075046327384108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2771136320792770049&amp;postID=1404075046327384108' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2771136320792770049/posts/default/1404075046327384108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2771136320792770049/posts/default/1404075046327384108'/><link rel='alternate' type='text/html' href='http://ajournalofparallax.blogspot.com/2008/03/some-specifics.html' title='Some specifics'/><author><name>Ben</name><uri>http://www.blogger.com/profile/08423297571444513453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_x6lYqIlQdP0/R-kTVSZ1MCI/AAAAAAAAAAM/eVZp_64VlDY/s72-c/raytrace.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2771136320792770049.post-5534852052414179236</id><published>2008-03-25T07:14:00.000-07:00</published><updated>2008-03-25T08:21:04.126-07:00</updated><title type='text'>Introduction</title><content type='html'>My esteemed Cordelia,&lt;br /&gt;&lt;br /&gt;Wondrous news! I have undertaken the design and construction of a new Technique for improved "parallax mapping" on the "graphical processing unit"! This Technique, if I may be so bold, promises to increase the realism with which parallax mapping displays curved objects obliquely, and at a relatively low cost in calculation. By making clever use of fins which point into the object, rather than out, it will be possible to clearly display the silhouettes of objects with the complexity their bump maps promise, rather than as mundane polylines. I need only finalise the details of the mathematics, and then implement the Technique. More to follow!&lt;br /&gt;&lt;br /&gt;Hoping the dropsy does not take poor Thaddeus,&lt;br /&gt;&lt;br /&gt;Ben&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2771136320792770049-5534852052414179236?l=ajournalofparallax.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ajournalofparallax.blogspot.com/feeds/5534852052414179236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2771136320792770049&amp;postID=5534852052414179236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2771136320792770049/posts/default/5534852052414179236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2771136320792770049/posts/default/5534852052414179236'/><link rel='alternate' type='text/html' href='http://ajournalofparallax.blogspot.com/2008/03/my-esteemed-cordelia-wondrous-news-i.html' title='Introduction'/><author><name>Ben</name><uri>http://www.blogger.com/profile/08423297571444513453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
