<?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"
	>

<channel>
	<title>UncleZeiv's Corner</title>
	<atom:link href="http://unclezeiv.kerid.org/feed" rel="self" type="application/rss+xml" />
	<link>http://unclezeiv.kerid.org</link>
	<description>frequently lost in thought</description>
	<pubDate>Sun, 17 Aug 2008 10:28:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>More indirect lighting stuff</title>
		<link>http://unclezeiv.kerid.org/2008/08/more-indirect-lighting-stuff</link>
		<comments>http://unclezeiv.kerid.org/2008/08/more-indirect-lighting-stuff#comments</comments>
		<pubDate>Sun, 17 Aug 2008 10:28:11 +0000</pubDate>
		<dc:creator>UncleZeiv</dc:creator>
		
		<category><![CDATA[Blender]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[GSoC 2008]]></category>

		<category><![CDATA[Graphics]]></category>

		<category><![CDATA[indirect lighting]]></category>

		<guid isPermaLink="false">http://unclezeiv.kerid.org/?p=54</guid>
		<description><![CDATA[This week I have been busy completing the indirect lighting part of my project, but this turned out to be harder than expected. The problem was not particularly the algorithm itself, as I&#8217;m currently implementing a naive variant. As a reader pointed out, the state of the art in instant radiosity is currently Metropolis Instant [...]]]></description>
			<content:encoded><![CDATA[<p>This week I have been busy completing the indirect lighting part of my project, but this turned out to be harder than expected. The problem was not particularly the algorithm itself, as I&#8217;m currently implementing a naive variant. As a reader pointed out, the state of the art in instant radiosity is currently <a href="http://www710.univ-lyon1.fr/~bsegovia/papers/mir.html" target="_blank">Metropolis Instant Radiosity</a> by Benjamin Segovia, but implementing that is not trivial and is left as future work.</p>
<p>I actually had a hard time figuring out <strong>how to read surface colors</strong>, which is something I need to color indirect lights and obtain color bleeding in the end. In the end I came up with some <em>very</em> <strong>hackish code</strong> that for sure wouldn&#8217;t be accepted in trunk. On the other hand I can&#8217;t see a cleaner way to do that without some changes in the existing Blender codebase. I have to talk to some other developer and see what&#8217;s the best thing to do.</p>
<p>Anyway, right now I have the ability to generate 1st and 2nd bounce indirect lighting from area lights, taking colours into account. I was able to obtain a rendering like this one:</p>
<div id="attachment_53" class="wp-caption aligncenter" style="width: 410px"><a href="http://unclezeiv.kerid.org/download/2008/08/unfinished_match_indir.png"><img class="size-medium wp-image-53" title="&quot;Unfinished Match&quot; with indirect lighting" src="http://unclezeiv.kerid.org/download/2008/08/unfinished_match_indir-400x250.png" alt="&quot;Unfinished Match&quot; with indirect lighting" width="400" height="250" /></a><p class="wp-caption-text">&quot;Unfinished Match&quot; with indirect lighting - Tree creation time: 00:04.64 - Lights: 19968 (0l + 0s + 19968o) (10000d + 9968i) - Error rate: 0.020 Max cut: 1000 - Average cut size: 362.88 - Shadow rays: 345.63 (1.73%) </p></div>
<p>The interesting thing is that this model was previously lit by a very complex lighting setup in order to fake indirect lighting. This rendering was obtained by placing <strong>a single area light</strong> behind the window.</p>
<p>Here are some more tests:</p>
<div id="attachment_56" class="wp-caption aligncenter" style="width: 187px"><a href="http://unclezeiv.kerid.org/download/2008/08/test1.png"><img class="size-medium wp-image-56" title="Color bleeding test" src="http://unclezeiv.kerid.org/download/2008/08/test1-177x400.png" alt="Color bleeding test" width="177" height="400" /></a><p class="wp-caption-text">Here there&#39;s an area light near the wall, turned upwards at 45°.</p></div>
<div id="attachment_55" class="wp-caption aligncenter" style="width: 276px"><a href="http://unclezeiv.kerid.org/download/2008/08/h2.png"><img class="size-medium wp-image-55" title="Hangar test" src="http://unclezeiv.kerid.org/download/2008/08/h2-266x400.png" alt="Hangar test" width="266" height="400" /></a><p class="wp-caption-text">Hangar test - Here I exaggerated indirect lighting through post-process.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://unclezeiv.kerid.org/2008/08/more-indirect-lighting-stuff/feed</wfw:commentRss>
		</item>
		<item>
		<title>Indirect lighting teaser</title>
		<link>http://unclezeiv.kerid.org/2008/08/indirect-lighting-teaser</link>
		<comments>http://unclezeiv.kerid.org/2008/08/indirect-lighting-teaser#comments</comments>
		<pubDate>Sun, 10 Aug 2008 11:57:44 +0000</pubDate>
		<dc:creator>UncleZeiv</dc:creator>
		
		<category><![CDATA[Blender]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[GSoC 2008]]></category>

		<category><![CDATA[Graphics]]></category>

		<guid isPermaLink="false">http://unclezeiv.kerid.org/?p=45</guid>
		<description><![CDATA[This week I&#8217;ve been busy with something rather unexciting: speeding up the light tree creation time. You might remember that, initially, I just implemented a O(n²) method in order to have a working prototype quickly; now I lowered that to O(nlogn) following advice from Miroslav Mikšík.
It is now possible to have several tens of thousands [...]]]></description>
			<content:encoded><![CDATA[<p>This week I&#8217;ve been busy with something rather unexciting: <strong>speeding up the light tree creation time</strong>. You <a href="http://unclezeiv.kerid.org/2008/05/a-sprouting-tree" target="_blank">might remember</a> that, initially, I just implemented a O(n²) method in order to have a working prototype quickly; now I lowered that to O(n<em>log</em>n) following <a href="http://www.cescg.org/CESCG-2007/papers/Prague-Miksik-Miroslav/Lightcuts_MiksikMiroslav.pdf" target="_blank">advice</a> from Miroslav Mikšík.</p>
<p>It is now possible to have <strong>several tens of thousands</strong> point lights without incurring in terrible tree creation times. This is particularly important when <em>indirect lighting</em> is added to the mix.</p>
<p>A simple way to add indirect illumination to renderers is to place several small lights on surfaces hit by direct lighting. This principle is used by a family of algorithms called <strong>instant radiosity</strong>, originally developed by <a href="http://graphics.uni-ulm.de/" target="_blank">Alexander Keller</a>. A lot of research has gone into reducing the number of resulting lights, in optimizing their placement in the scene (so that, for instance, lights not influencing the final rendering get trimmed), and in overcoming some of the shortcomings of the algorithm, since it tends to suffer in some corner cases.</p>
<p>The final part of my Summer of Code project is indeed about creating a toy implementation of instant radiosity, in order to show a potential &#8220;killer application&#8221; for Lightcuts in Blender. I think it&#8217;s also important to have it in order to have a clearer idea on how to integrate Lightcuts from a UI point of view.</p>
<p>Ideally it would be nice to have just a button to press, without having to rework all the lighting differently, but I&#8217;m afraid that <strong>the user must have some awareness</strong> of the strengths and weaknesses of the algorithm in order to take full advantage of it. More on this in a later post.</p>
<p>Here are some <em>very</em> preliminary results from my initial experiments with virtual point light placement.</p>
<div id="attachment_48" class="wp-caption aligncenter" style="width: 410px"><a href="http://unclezeiv.kerid.org/download/2008/08/areatex_indir.png"><img class="size-medium wp-image-48" title="Textured area light with indirect lighting" src="http://unclezeiv.kerid.org/download/2008/08/areatex_indir-400x300.png" alt="Textured area light with indirect lighting" width="400" height="300" /></a><p class="wp-caption-text">Textured area light with indirect lighting - Tree creation time: 00:00.54 - Number of (point) lights: 5966 (0l + 0s + 5966o) - Average cut size: 155.22 - Shadow rays: 153.77 (2.58%)</p></div>
<div id="attachment_47" class="wp-caption aligncenter" style="width: 410px"><a href="http://unclezeiv.kerid.org/download/2008/08/areatex_dir.png"><img class="size-medium wp-image-47" title="Textured area light with direct lighting alone" src="http://unclezeiv.kerid.org/download/2008/08/areatex_dir-400x300.png" alt="Textured area light with direct lighting alone" width="400" height="300" /></a><p class="wp-caption-text">Textured area light with direct lighting alone (despite the stamp) - Tree creation time: 00:00.26 - Number of (point) lights: 3102 (0l + 0s + 3102o) - Average cut size: 134.83 - Shadow rays: 132.35 (4.27%)</p></div>
<div id="attachment_49" class="wp-caption aligncenter" style="width: 410px"><a href="http://unclezeiv.kerid.org/download/2008/08/indirect_orig_indir_lc.png"><img class="size-medium wp-image-49" title="Test scene - with indirect lighting" src="http://unclezeiv.kerid.org/download/2008/08/indirect_orig_indir_lc-400x300.png" alt="Test scene - with indirect lighting" width="400" height="300" /></a><p class="wp-caption-text">Test scene - with indirect lighting - Tree creation time: 00:02.00 - Number of (point) lights: 18091 (0l + 0s + 18091o) (4900d + 13191i) - Requested error rate: 0.018 - Average cut size: 587.30 - Shadow rays: 582.20 (3.22%)</p></div>
<div id="attachment_50" class="wp-caption aligncenter" style="width: 410px"><a href="http://unclezeiv.kerid.org/download/2008/08/indirect_orig_lc.png"><img class="size-medium wp-image-50" title="Test scene - direct only" src="http://unclezeiv.kerid.org/download/2008/08/indirect_orig_lc-400x300.png" alt="Test scene - direct only" width="400" height="300" /></a><p class="wp-caption-text">Test scene - direct only - Tree creation time: 00:00.43 - Number of (point) lights: 4900 (0l + 0s + 4900o) - Requested error rate: 0.020 - Average cut size: 567.16 - Shadow rays: 562.23 (11.47%)</p></div>
<p>(Yes, I am aware of the banding problems; it&#8217;s one of the issues I have to address next week before the Gsoc is over.)</p>
]]></content:encoded>
			<wfw:commentRss>http://unclezeiv.kerid.org/2008/08/indirect-lighting-teaser/feed</wfw:commentRss>
		</item>
		<item>
		<title>Lightcuts: week 9</title>
		<link>http://unclezeiv.kerid.org/2008/07/lightcuts-week-9</link>
		<comments>http://unclezeiv.kerid.org/2008/07/lightcuts-week-9#comments</comments>
		<pubDate>Sun, 27 Jul 2008 14:07:24 +0000</pubDate>
		<dc:creator>UncleZeiv</dc:creator>
		
		<category><![CDATA[Blender]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[GSoC 2008]]></category>

		<category><![CDATA[Graphics]]></category>

		<guid isPermaLink="false">http://unclezeiv.kerid.org/?p=34</guid>
		<description><![CDATA[Textured area lights turned out hugely popular, so now it&#8217;s hard to live up to expectations I guess!
This week&#8217;s work was indeed far less exciting: I worked on supporting more material features, as so far only lambertian diffuse and phong specular where supported. Now, all diffuse shaders are supported.
Every single shader must be specifically supported [...]]]></description>
			<content:encoded><![CDATA[<p>Textured area lights turned out hugely popular, so now it&#8217;s hard to live up to expectations I guess!</p>
<p>This week&#8217;s work was indeed far less exciting: I worked on supporting more material features, as so far only lambertian diffuse and phong specular where supported. Now, <strong>all diffuse shaders are supported</strong>.</p>
<p>Every single shader must be specifically supported as we need to be able to answer this question: what&#8217;s the maximum value that a specific pixel, shaded this way, may assume over a bounding box of point lights? You don&#8217;t really need the exact maximum value, so a ridiculously large number would always be a &#8220;viable&#8221; answer. On the other hand, <strong>you want the bounding value to be as tight as possible</strong>, because if the error turns out to be very low, you may decide to skip all the lights further down in the light tree, thus saving rendering time.</p>
<p>I also added <strong>support for all falloff types</strong> (except custom curve falloffs). The default falloff type for Blender lamps is &#8220;inverse linear&#8221;, while only &#8220;inverse square&#8221; was supported so far: this could lead to very incorrect renderings, especially when testing existing scenes.</p>
<p>Now, for instance, this hangar scene (featuring a lot of dupliverted &#8220;inverse linear&#8221; point lights plus a couple of additional area lights) looks a bit better:</p>
<div id="attachment_38" class="wp-caption aligncenter" style="width: 410px"><a href="http://unclezeiv.kerid.org/download/2008/07/hangar2_lc.png"><img class="size-medium wp-image-38" title="Hangar" src="http://unclezeiv.kerid.org/download/2008/07/hangar2_lc-400x250.png" alt="Tree creation time:     00:02.27 Number of (point) lights: 3841 (1476l + 0s + 2365o) Requested error rate: 0.020 Average cut size: 239.44 Shadow rays: 233.08 (6.07%)" width="400" height="250" /></a><p class="wp-caption-text">Tree creation time:     00:02.27 Number of (point) lights: 3841 (1476l + 0s + 2365o) Requested error rate: 0.020 Average cut size: 239.44 Shadow rays: 233.08 (6.07%)</p></div>
<div id="attachment_39" class="wp-caption aligncenter" style="width: 410px"><a href="http://unclezeiv.kerid.org/download/2008/07/hangar2_lc_fc.png"><img class="size-medium wp-image-39" title="Hangar (False colour)" src="http://unclezeiv.kerid.org/download/2008/07/hangar2_lc_fc-400x250.png" alt="Hangar (False colour)" width="400" height="250" /></a><p class="wp-caption-text">Hangar (False colour)</p></div>
<p>(Thanks Gillan for pointing me to this model).</p>
<p style="text-align: center;">◊ ◊ ◊</p>
<p>On the textured area light side, Italian Blenderhead <strong>Lusque</strong> has performed an interesting experiment. If you bake direct lighting coming from a light source (e.g. an area light) onto the walls of a <a href="http://www.graphics.cornell.edu/online/box/" target="_blank">Cornell-like box</a>, and then you use the baked textures as textured area lights, you basically have a <strong>simple indirect lighting pass</strong>.</p>
<p>Here you can see a test, where the indirect lighting has been exaggerated on purpose:</p>
<p style="text-align: center;"><a href="http://img440.imageshack.us/my.php?image=cornellbbbokug0.png" target="_blank"><img class="aligncenter" src="http://img440.imageshack.us/img440/7889/cornellbbbokug0.th.png" border="0" alt="" /></a></p>
<p>I&#8217;ll post Lusque&#8217;s blend file here as soon as we sort the remaining issues out.</p>
<p>(Please note that this is just an experiment and that it has nothing to do with the &#8220;Instant Radiosity&#8221; scheme I would like to implement; I am also perfectly aware that it has limited applicability, but it&#8217;s still very clever in my opinion).</p>
]]></content:encoded>
			<wfw:commentRss>http://unclezeiv.kerid.org/2008/07/lightcuts-week-9/feed</wfw:commentRss>
		</item>
		<item>
		<title>Textured area lights in Blender</title>
		<link>http://unclezeiv.kerid.org/2008/07/textured-area-lights-in-blender</link>
		<comments>http://unclezeiv.kerid.org/2008/07/textured-area-lights-in-blender#comments</comments>
		<pubDate>Sun, 13 Jul 2008 14:03:30 +0000</pubDate>
		<dc:creator>UncleZeiv</dc:creator>
		
		<category><![CDATA[Blender]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[GSoC 2008]]></category>

		<category><![CDATA[Graphics]]></category>

		<guid isPermaLink="false">http://unclezeiv.kerid.org/?p=29</guid>
		<description><![CDATA[One of my favourite pictures from the original Lightcuts paper is an office scene lit exclusively by a tv screen. You can do that with textured area lights.
In Blender you can already link a texture to a light, but the outcome is a sort of texture projection, which is useful if you want to fake [...]]]></description>
			<content:encoded><![CDATA[<p>One of my favourite pictures from the original Lightcuts paper is an office scene lit exclusively by a tv screen. You can do that with <strong>textured area lights</strong>.</p>
<p>In Blender you can already link a texture to a light, but the outcome is a sort of texture projection, which is useful if you want to fake effects like light passing through a tree without actually computing the visibility: that comes of course very handy for cutting rendering time, to have artistic control on shadowing, etc.</p>
<p>What I mean here with textured area lights, on the other hand, is actually <strong>modulating the color and intensity of the light throughout its area</strong>. This way you can obtain the effect of lighting coming from tv screens, large windows with varying lighting conditions, and even area lights with custom shapes. Here are some examples.</p>
<p style="text-align: center;"><a href="http://unclezeiv.kerid.org/download/2008/07/color2_lc.png"><img class="alignnone size-medium wp-image-31 aligncenter" title="Textured area light" src="http://unclezeiv.kerid.org/download/2008/07/color2_lc-400x300.png" alt="Textured area light" width="400" height="300" /></a></p>
<p style="text-align: center;"><a href="http://unclezeiv.kerid.org/download/2008/07/circle2_lc.png"><img class="alignnone size-medium wp-image-30 aligncenter" title="Area light with custom shape" src="http://unclezeiv.kerid.org/download/2008/07/circle2_lc-400x300.png" alt="Area light with custom shape" width="400" height="300" /></a></p>
<p style="text-align: center;"><a href="http://unclezeiv.kerid.org/download/2008/07/area_tex2_lc.png"><img class="alignnone size-medium wp-image-33" title="Tv screen" src="http://unclezeiv.kerid.org/download/2008/07/area_tex2_lc-400x300.png" alt="Tv screen" width="400" height="300" /></a></p>
<p>In the lightcuts paper you had also the added contribution of indirect light. In this case I added some additional lighting using a faint environment map. The interesting point to note is that <strong>putting additional lighting has a negligible impact on rendering time</strong>, if not a beneficial effect! This is because completely occluded areas evaluate far more lights than bright areas, as a consequence of using a proportional error metric; thus, having those parts brighter allows for less evaluations.</p>
<p>Here&#8217;s a false colour rendering where the green areas show where the environment lighting is more influential and the bluish areas show where the area light is more influential. The red channel counts the number of lights used with respect to the maximum, so the image is white where it&#8217;s most occluded, as expected.</p>
<p style="text-align: center;"><a href="http://unclezeiv.kerid.org/download/2008/07/color2_lc_fc.png"><img class="alignnone size-medium wp-image-32 aligncenter" title="Textured area light (false colour)" src="http://unclezeiv.kerid.org/download/2008/07/color2_lc_fc-400x300.png" alt="Textured area light (false colour)" width="400" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://unclezeiv.kerid.org/2008/07/textured-area-lights-in-blender/feed</wfw:commentRss>
		</item>
		<item>
		<title>GSoC: midterm evaluation</title>
		<link>http://unclezeiv.kerid.org/2008/07/gsoc-midterm-evaluation</link>
		<comments>http://unclezeiv.kerid.org/2008/07/gsoc-midterm-evaluation#comments</comments>
		<pubDate>Thu, 10 Jul 2008 16:38:59 +0000</pubDate>
		<dc:creator>UncleZeiv</dc:creator>
		
		<category><![CDATA[Blender]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[GSoC 2008]]></category>

		<category><![CDATA[Graphics]]></category>

		<guid isPermaLink="false">http://unclezeiv.kerid.org/?p=28</guid>
		<description><![CDATA[Apologies for not having updated my blog recently. There&#8217;s quite a lot of stuff I have yet to blog about and I&#8217;ll surely do that in the near future. This week is halfway through the Summer of Code and it&#8217;s midterm evaluation time. Having been scolded for the lack of coolness of my rendering tests [...]]]></description>
			<content:encoded><![CDATA[<p>Apologies for not having updated my blog recently. There&#8217;s quite a lot of stuff I have yet to blog about and I&#8217;ll surely do that in the near future. This week is halfway through the Summer of Code and it&#8217;s midterm evaluation time. Having been scolded for the lack of coolness of my rendering tests during the last developer meeting, I took the time to grab some better looking model and arrange more interesting tests. You can find my midterm report, together with said renderings, on <a href="http://wiki.blender.org/index.php/User:UncleZeiv/SummerOfCode2008/Midterm" target="_blank">Blender&#8217;s wiki</a>. A warm thank you to the <a href="http://www.kino3d.com" target="_blank">Kino3D</a> guys who helped a lot in the process.</p>
<p>By the way, as a SoCer I got to visit Google&#8217;s London office today. I was glad to have my Blender t-shirt handy for the circumstance. During the tour I&#8217;m pretty sure I saw a couple of guys editing a video using Blender on an enormous screen. Overall the visit was very inspiring and, you know, a free lunch is always welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://unclezeiv.kerid.org/2008/07/gsoc-midterm-evaluation/feed</wfw:commentRss>
		</item>
		<item>
		<title>Lightcuts: oriented lights</title>
		<link>http://unclezeiv.kerid.org/2008/06/lightcuts-oriented-lights</link>
		<comments>http://unclezeiv.kerid.org/2008/06/lightcuts-oriented-lights#comments</comments>
		<pubDate>Wed, 25 Jun 2008 01:31:46 +0000</pubDate>
		<dc:creator>UncleZeiv</dc:creator>
		
		<category><![CDATA[Blender]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[GSoC 2008]]></category>

		<category><![CDATA[Graphics]]></category>

		<guid isPermaLink="false">http://unclezeiv.kerid.org/?p=25</guid>
		<description><![CDATA[These days I&#8217;ve been working on adding support for oriented lights. It&#8217;s mostly there, even though there are a couple of missing details and the current code is obviously slower than it could be.
Still, like in my previous post, I can&#8217;t resist posting another revisited preliminary test, now rendered with actual lightcuts code.

And the corresponding [...]]]></description>
			<content:encoded><![CDATA[<p>These days I&#8217;ve been working on adding support for <strong>oriented lights</strong>. It&#8217;s mostly there, even though there are a couple of missing details and the current code is obviously slower than it could be.</p>
<p>Still, like in my <a href="http://unclezeiv.kerid.org/2008/06/lightcuts-directional-lights" target="_blank">previous post</a>, I can&#8217;t resist posting another revisited <a href="http://unclezeiv.kerid.org/2008/04/lightcuts-in-blender-preliminary-tests" target="_blank">preliminary test</a>, now rendered with actual lightcuts code.</p>
<p style="text-align: center;"><a href="http://unclezeiv.kerid.org/download/2008/06/indirect2_full_lc.png"><img class="alignnone size-medium wp-image-26 aligncenter" title="Indirect lighting" src="http://unclezeiv.kerid.org/download/2008/06/indirect2_full_lc-400x300.png" alt="Indirect lighting" width="400" height="300" /></a></p>
<p>And the corresponding false colour image:</p>
<p style="text-align: center;"><a href="http://unclezeiv.kerid.org/download/2008/06/indirect2_full_lc_fc.png"><img class="alignnone size-medium wp-image-27 aligncenter" title="Indirect lighting scene (false colour)" src="http://unclezeiv.kerid.org/download/2008/06/indirect2_full_lc_fc-400x300.png" alt="Indirect lighting scene (false colour)" width="400" height="300" /></a></p>
<p>The original test took <strong>almost an hour</strong> to render, at 400&#215;300 OSA5. This one took <strong>ten minutes</strong> at 800&#215;600. True, the images don&#8217;t look exactly the same, but that&#8217;s because I changed the falloff type of the virtual point lights to a more realistic inverse squared. Still, the speed improvement looks pretty good already!</p>
<p>Yes, I am perfectly aware that the shadow from the sun suffers from aliasing problems. This issue will be addressed somehow, so don&#8217;t worry about that.</p>
<p>Please note that the virtual point lights have been placed by a custom (and pretty hackish) Python script; generating them automatically is something that <strong>I definitely want to do</strong> in the future, but is not strictly speaking part of the current GSoC.</p>
<p>My plan in the near future is to complete the basic feature set in time for midterm evaluation &#8212; that is, adding support for specularity and for the other diffuse shaders available in Blender. This is holding back some other things I would like to do as soon as possible, such as <strong>releasing a couple of Blender scripts</strong> to render from environment maps and to do basic indirect lighting, and <strong>squashing the bug</strong> that is causing <a href="http://www.vimeo.com/1209937" target="_blank">this video</a> to flicker like crazy.</p>
]]></content:encoded>
			<wfw:commentRss>http://unclezeiv.kerid.org/2008/06/lightcuts-oriented-lights/feed</wfw:commentRss>
		</item>
		<item>
		<title>Lightcuts: directional lights</title>
		<link>http://unclezeiv.kerid.org/2008/06/lightcuts-directional-lights</link>
		<comments>http://unclezeiv.kerid.org/2008/06/lightcuts-directional-lights#comments</comments>
		<pubDate>Fri, 20 Jun 2008 01:04:00 +0000</pubDate>
		<dc:creator>UncleZeiv</dc:creator>
		
		<category><![CDATA[Blender]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[GSoC 2008]]></category>

		<category><![CDATA[Graphics]]></category>

		<guid isPermaLink="false">http://unclezeiv.kerid.org/?p=22</guid>
		<description><![CDATA[I have just added support for directional lights on my branch. Using more than one &#8220;sun&#8221; light may sound weird, but that&#8217;s actually how you transform environment maps in a collection of point lights, as each pixel ideally represents an infinitely distant illumination source.
So I couldn&#8217;t resist going back to my preliminary tests, but this [...]]]></description>
			<content:encoded><![CDATA[<p>I have just added support for <strong>directional lights</strong> on my branch. Using more than one &#8220;sun&#8221; light may sound weird, but that&#8217;s actually how you transform environment maps in a collection of point lights, as each pixel ideally represents an infinitely distant illumination source.</p>
<p>So I couldn&#8217;t resist going back to my <a href="http://unclezeiv.kerid.org/2008/04/lightcuts-in-blender-preliminary-tests" target="_blank">preliminary tests</a>, but this time running them with the actual code! Here&#8217;s Suzanne again under the <a href="http://www.debevec.org/Probes/" target="_blank">Eucalyptus Grove</a> light probe:</p>
<p style="text-align: center;"><a href="http://unclezeiv.kerid.org/download/2008/06/envmap_test1.png"><img class="alignnone size-medium wp-image-23 aligncenter" title="Eucalyptus Grove test" src="http://unclezeiv.kerid.org/download/2008/06/envmap_test1-177x400.png" alt="Eucalyptus Grove test" width="177" height="400" /></a></p>
<p>Please note that the AO image is there just to give <strong>a very rough feeling</strong> of how the two could compare &#8212; of course energy should be matched more carefully and parameters could be tuned better. Comparison with approximate AO would be useful as well.</p>
<p>Here&#8217;s another test using a hand-painted environment map:</p>
<p style="text-align: center;"><a href="http://unclezeiv.kerid.org/download/2008/06/envmap_test2.png"><img class="alignnone size-medium wp-image-24 aligncenter" title="Handpainted environment map test" src="http://unclezeiv.kerid.org/download/2008/06/envmap_test2-266x400.png" alt="Handpainted environment map test" width="266" height="400" /></a></p>
<p>In both tests the average cut size (the number of lights actually evaluated per pixel) is pretty low &#8212; see how dark the false color images appear. On the other hand the shadowing <strong>doesn&#8217;t look entirely convincing</strong>; still, it looks like a good starting point to me!</p>
<p>All images were rendered at OSA 5.</p>
]]></content:encoded>
			<wfw:commentRss>http://unclezeiv.kerid.org/2008/06/lightcuts-directional-lights/feed</wfw:commentRss>
		</item>
		<item>
		<title>Lightcuts: week 2</title>
		<link>http://unclezeiv.kerid.org/2008/06/lightcuts-week-2</link>
		<comments>http://unclezeiv.kerid.org/2008/06/lightcuts-week-2#comments</comments>
		<pubDate>Sun, 15 Jun 2008 08:43:48 +0000</pubDate>
		<dc:creator>UncleZeiv</dc:creator>
		
		<category><![CDATA[Blender]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[GSoC 2008]]></category>

		<category><![CDATA[Graphics]]></category>

		<category><![CDATA[lightcuts]]></category>

		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://unclezeiv.kerid.org/?p=19</guid>
		<description><![CDATA[A quick update from last week that I couldn&#8217;t find the time to finalize. I post it now as it discusses a couple of interesting issues. Btw, week numbering refers to the official GSoC timeframe. &#8212; UncleZeiv
The scene shown below &#8212; an ordinary Suzanne lit by 15000 colored lights &#8212; was sent by an early [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><em>A quick update from last week that I couldn&#8217;t find the time to finalize. I post it now as it discusses a couple of interesting issues. Btw, week numbering refers to the official GSoC timeframe.</em> &#8212; UncleZeiv</p>
<p>The scene shown below &#8212; an ordinary Suzanne lit by 15000 colored lights &#8212; was sent by an early tester (thanks bullx) who found some noticeable artifacts when comparing the Lightcuts rendering to the plain one, despite following the instructions given in my <a href="http://unclezeiv.kerid.org/2008/05/playing-with-a-working-prototype" target="_blank">previous post</a>. It was indeed a bug that <a href="http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;root=bf-blender&amp;revision=15107" target="_blank">I finally found</a> after a longish hunt. This is to say that <strong>early testing is indeed doable and welcome</strong>!</p>
<p>On the other hand, the reference 800&#215;600 rendering using the traditional pipeline, according to the tester, took nothing less than 4 hours (it&#8217;s not displayed here). I have to admit, though, that <strong>this is not a fair comparison</strong>, since you can&#8217;t select &#8220;pure&#8221; single sampled shadows from the UI for the traditional pipeline &#8212; you are always forced to use the better quality, but slower, QMC code. [<em><strong>Note</strong>: I restored the possibility to select singled sampled lights from the UI in revision <a href="http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;root=bf-blender&amp;revision=15183" target="_blank">15183</a>.</em>]</p>
<p>I don&#8217;t use that because in this context you don&#8217;t care if a single light is actually low quality or produces ugly hard shadows: on average the contribution from a single light will be fairly small and will be <strong>softened and corrected by the contribution from the other lights</strong>. Alas, this may not be the case if a small number of lights is significantly more intense than the average; that situation may require a special treatment.</p>
<p style="text-align: center;"><a href="http://unclezeiv.kerid.org/download/2008/06/comparison.png"><img class="alignnone size-medium wp-image-18 aligncenter" title="Error comparison" src="http://unclezeiv.kerid.org/download/2008/06/comparison-400x400.png" alt="Error comparison" width="400" height="400" /></a></p>
<p>Finally, I wanted to show an example of false color renderings, which are an invaluable tool to see at a glance <strong>how the algorithm is performing behind the scenes</strong>. Each color channel bears a different meaning &#8212; which is, by the way, liable to change frequently during development (it already has a couple of times).</p>
<p>Right now, the red channel is the most important and is proportional to <strong>the ratio between the number of evaluated lights and the maximum number allowed</strong>, that is, the maximum cut size. (If this figure is higher than the current number of lights, the latter is used).</p>
<p>As you can see from the picture, <strong>more lights get evaluated in darker regions</strong>: this may sound counterintuitive but is the direct result of using <strong>a relative error metric</strong>. The darker the region, the lower the absolute error allowed. This is particularly apparent in the second rendering, where a higher error threshold was selected.</p>
<p>The second picture gives also an idea of how image quality degrades by raising the allowed error.</p>
]]></content:encoded>
			<wfw:commentRss>http://unclezeiv.kerid.org/2008/06/lightcuts-week-2/feed</wfw:commentRss>
		</item>
		<item>
		<title>Playing with a &#8220;working&#8221; prototype</title>
		<link>http://unclezeiv.kerid.org/2008/05/playing-with-a-working-prototype</link>
		<comments>http://unclezeiv.kerid.org/2008/05/playing-with-a-working-prototype#comments</comments>
		<pubDate>Thu, 29 May 2008 02:04:23 +0000</pubDate>
		<dc:creator>UncleZeiv</dc:creator>
		
		<category><![CDATA[Blender]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[GSoC 2008]]></category>

		<category><![CDATA[Graphics]]></category>

		<guid isPermaLink="false">http://unclezeiv.kerid.org/?p=17</guid>
		<description><![CDATA[The Google Summer Of Code has officially started on Monday. I&#8217;ve been doing a fair amount of coding  since my last post and it is now possible to see something almost meaningful on my branch.
I finally managed to have all pieces of the puzzle in place. My initial attempt to hook the lightcuts algorithm to [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://code.google.com/soc/2008/" target="_blank">Google Summer Of Code</a> has officially started on Monday. I&#8217;ve been doing a <a href="http://cia.vc/stats/author/unclezeiv" target="_blank">fair amount</a> of coding  since my last post and it is now possible to see something almost meaningful on my branch.</p>
<p>I finally managed to have all pieces of the puzzle in place. My initial attempt to hook the lightcuts algorithm to the renderer through a &#8220;<strong>lights iterator</strong>&#8221; interface turned out to be ill conceived: what I really needed was <strong>a callback mechanism</strong> to let Blender Internal evaluate the contribution of a single light. In the end this will require more changes to the render engine, but overall this technique remains pretty non-intrusive.</p>
<p>Right now the technique supports omnidirectional lights (&#8221;Lamps&#8221; in Blender parlance), Lambert shading, only diffuse. Through the UI it&#8217;s possible to change the maximum allowed error and the cut size &#8212; that is, the maximum number of lights taken into account per sample.</p>
<p>Early tests show that the lightcuts version consistently outperforms the traditional rendering pipeline, even for fairly small amounts of lights. Results are not always correct though, especially when complex occlusions are present.</p>
<p>Let me clarify that although I am already receiving useful feedback from testers, there is <strong>a long list of limitations</strong> you have to be aware of before playing with my <a href="http://unclezeiv.kerid.org/download/temp/" target="_blank">test builds</a>. Here is a minimal and possibly incomplete checklist:</p>
<ul>
<li><strong>raytracing and shadowing must be enabled</strong>! This is not a current limitation: Lightcuts doesn&#8217;t make sense otherwise</li>
<li>all materials should be <strong>only diffuse</strong>, employing the <strong>Lambertian</strong> model (current limitation): disable specularity and/or set it to black</li>
<li>any other feature is not supported yet; in particular, ensure that the <strong>Bias</strong> toggle is turned off, or results could differ significantly</li>
<li>all lamps should be <strong>omnidirectional</strong> (&#8221;Lamp&#8221;), with <strong>Inverse Square</strong> falloff, and <strong>ray shadowing</strong> active</li>
<li>please <strong>ignore QMC</strong> settings: I am really using the old &#8220;single sample&#8221; lamps, not accessible from the UI anymore; fiddling with the settings could lead to inconsisten settings and eventually to crashes</li>
<li>it goes without saying: disable AO, SSS, whatever feature doesn&#8217;t look like a &#8220;plain&#8221; feature</li>
</ul>
<p>I&#8217;ve also added a new render layer called &#8220;<strong>False Color</strong>&#8220;. It&#8217;s a visual debugging tool that shows per-pixel color-coded information. Right now, the red channel shows the ratio between used lights and maximum cut size: when it&#8217;s dark, it means that the algorithm took advantage of its metrics to aggressively save calculations; somewhat unintuitively, the most expensive parts to compute are the dark areas (in the actual picture, not in the false color one): having a relative error criterion means requiring a very accurate calculation precisely where the signal is weak, and that&#8217;s when the &#8220;max cut&#8221; limit is hit.</p>
]]></content:encoded>
			<wfw:commentRss>http://unclezeiv.kerid.org/2008/05/playing-with-a-working-prototype/feed</wfw:commentRss>
		</item>
		<item>
		<title>A sprouting tree</title>
		<link>http://unclezeiv.kerid.org/2008/05/a-sprouting-tree</link>
		<comments>http://unclezeiv.kerid.org/2008/05/a-sprouting-tree#comments</comments>
		<pubDate>Tue, 20 May 2008 01:25:33 +0000</pubDate>
		<dc:creator>UncleZeiv</dc:creator>
		
		<category><![CDATA[Blender]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[GSoC 2008]]></category>

		<category><![CDATA[Graphics]]></category>

		<guid isPermaLink="false">http://unclezeiv.kerid.org/?p=16</guid>
		<description><![CDATA[Focus on lowering algorithmic complexity and don&#8217;t perform other optimizations until their usefulness is demonstrated by thorough profiling: since I completely agree with this maxim, I feel obliged to explain why my latest lightcuts update seems to contradict it.
First of all, let&#8217;s recap: in order to select an optimal subset of the available lights per [...]]]></description>
			<content:encoded><![CDATA[<p><em>Focus on lowering algorithmic complexity and don&#8217;t perform other optimizations until their usefulness is demonstrated by thorough profiling</em>: since I completely agree with this maxim, I feel obliged to explain why my <a href="http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;root=bf-blender&amp;revision=14900" target="_blank">latest lightcuts update</a> seems to contradict it.</p>
<p>First of all, let&#8217;s recap: in order to select an optimal subset of the available lights per sample, a lightcuts implementation needs to maintain them <strong>organized into a binary tree</strong>. The leaves of this tree are the actual lights, while intermediate nodes represent <em>clusters</em> of lights. A cluster of lights is a sort of <em>imaginary</em> light whose position, intensity and orientation is somehow representative of all its children.</p>
<p>The <a href="http://www.cs.cornell.edu/~kb/projects/lightcuts/" target="_blank">original paper</a> spends only a paragraph on tree building and related issues. The point is that building the light tree is trivial, but building it efficiently is far less trivial. Miroslav Mikšík, in <a href="http://www.cescg.org/CESCG-2007/papers/Prague-Miksik-Miroslav/Lightcuts_MiksikMiroslav.pdf" target="_blank">his paper</a> dealing with implementation issues regarding lightcuts, notes that a naive algorithm may have a O(n³) <a href="http://en.wikipedia.org/wiki/Big_O_notation" target="_blank">complexity</a>; he devised a technique to reduce such complexity to O(n<em>log</em>n).</p>
<p>Keep in mind that a robust implementation should be able to deal at least with several thousands of lights, and should allow <strong>venturing into the millions</strong>! This is one of those cases where complexity <em>does</em> matter.</p>
<p>Right now, though, I&#8217;ve implemented a simple O(n²) scheme, taking advantage of the nice heap  mini-library available in Blender. I&#8217;ve spent some time, on the other hand, ensuring that a <strong>single memory allocation</strong> is required for the entire tree, instead of one for each node. This is possible because the number of nodes in the tree is predictable in advance. This reduces fragmentation, is cache friendly and, since it&#8217;s possible to use offsets instead of pointers, its memory footprint is the same on 64 bits machines instead of increasing because of the doubled pointer size.</p>
<p>Next, I want to move on to the other parts of the algorithm, in order to have <strong>a working prototype fairly soon</strong>. It probably won&#8217;t support a large number of lights, nor oriented lights (spot) which are probably going to be added later on, as they require special treatment. But at least it will be possible to validate the overall architecture of the project, and people will be able to start playing with it.</p>
<p>For this purpose, the current algorithm has both acceptable performance (I&#8217;m not going to debug with large number of lights at the beginning, anyway) and is easier to debug.</p>
]]></content:encoded>
			<wfw:commentRss>http://unclezeiv.kerid.org/2008/05/a-sprouting-tree/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
