<?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>V // Pixelnerve</title>
	<atom:link href="http://www.pixelnerve.com/v/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pixelnerve.com/v</link>
	<description></description>
	<lastBuildDate>Thu, 29 Jul 2010 13:47:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>MSAOpenCL for Java and Processing</title>
		<link>http://www.pixelnerve.com/v/2010/07/29/msaopencl-for-java-and-processing/</link>
		<comments>http://www.pixelnerve.com/v/2010/07/29/msaopencl-for-java-and-processing/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 01:57:33 +0000</pubDate>
		<dc:creator>victormartins</dc:creator>
				<category><![CDATA[GPU]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[JavaCL]]></category>
		<category><![CDATA[msaopencl]]></category>
		<category><![CDATA[OpenCL]]></category>

		<guid isPermaLink="false">http://www.pixelnerve.com/v/?p=1248</guid>
		<description><![CDATA[Recently I have been doing some work with OpenCL and i found myself messing up with old code and re-writing most of it .  At first it was interesting and quite funny but no more, so,  I thought it was time to make things easier for myself and just make things reusable by creating a [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Recently I have been doing some work with <a title="OpenCL" href="http://www.nvidia.com/object/cuda_opencl_new.html" target="_blank">OpenCL</a> and i found myself messing up with old code and re-writing most of it .  At first it was interesting and quite funny but no more, so,  I thought it was time to make things easier for myself and just make things reusable by creating a wrapper which would wrap most of the boring and time-consuming parts. This would be a wrapper on OpenCL for Java and/or Processing. Well, a well known guy named <a title="Memo" href="http://www.memo.tv" target="_blank">Mehmet &#8220;Memo&#8221; Akten</a> has done such a wrapper in C++ for the <a title="OF" href="http://www.openframeworks.cc" target="_blank">OpenFrameworks</a> and <a title="Cinder" href="http://www.libcinder.org" target="_blank">Cinder</a> libraries. I have ported it  to Java.</p>
<p style="text-align: justify;">There are some problems with reading/writing from/to GL textures. For some reason it crashes on me. I have been working with <a title="JavaCL" href="http://code.google.com/p/javacl/" target="_blank">JavaCL</a>&#8216;s author, so hopefully it will be working soon.</p>
<p style="text-align: justify;">
<p style="text-align: justify;">:: <a title="MSAOpenCL for Java/Processing" href="http://code.google.com/p/victamin/downloads/detail?name=msaopencl.zip" target="_blank">Download</a></p>
<p style="text-align: justify;">Download it, install it and try it.<br />
If you find any problems or if you have suggestions, let me know.</p>
<p style="text-align: justify;">Have fun.</p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.11';
var flattr_uid = 'pixelnerve';
var flattr_url = 'http://www.pixelnerve.com/v';
var flattr_lng = 'en_GB';
var flattr_cat = 'video';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'V // Pixelnerve';
var flattr_dsc = '';
</script>
<script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script>]]></content:encoded>
			<wfw:commentRss>http://www.pixelnerve.com/v/2010/07/29/msaopencl-for-java-and-processing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ping-pong technique on GPU</title>
		<link>http://www.pixelnerve.com/v/2010/07/20/pingpong-technique/</link>
		<comments>http://www.pixelnerve.com/v/2010/07/20/pingpong-technique/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 06:06:26 +0000</pubDate>
		<dc:creator>victormartins</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[Graphics programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[gpu]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[ping pong]]></category>
		<category><![CDATA[shader]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.pixelnerve.com/v/?p=1205</guid>
		<description><![CDATA[Hello there. Here is a new tutorial, this time about ping-pong on the gpu. I&#8217;ve been wanting to write about it for sometime, finally it&#8217;s off my todo list. Let&#8217;s get down to business. Ping-pong technique is normally used with a shader that needs it&#8217;s result as a source parameter for it&#8217;s next iteration. This [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Hello there. Here is a new tutorial, this time about ping-pong on the gpu. I&#8217;ve been wanting to write about it for sometime, finally it&#8217;s off my todo list. Let&#8217;s get down to business. Ping-pong technique is normally used with a shader that needs it&#8217;s result as a source parameter for it&#8217;s next iteration. This is usually used in the gpu as for now it is not possible to write a program&#8217;s result to itself, so, we&#8217;ll need another equal buffer to save the current result for how next step/iteration. That was too hard?</p>
<p style="text-align: justify;">So imagine we have 2 image buffers Image1, Image2. Usually to change data from Image1, you would simply access it and write directly back to the same positioion. Now, when we&#8217;re talking about a shader fragment program we can&#8217;t simply do that.  You may ask now, what&#8217;s the solution? Ping-pong it!</p>
<p style="text-align: justify;">Here is what i&#8217;m talking about:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// Initialization</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #000066; font-weight: bold;">int</span> W <span style="color: #339933;">=</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> H <span style="color: #339933;">=</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span>
ImageArray <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>W<span style="color: #339933;">*</span>H<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> CurrActiveBuffer <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Current active buffer index</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// Mainloop</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> j<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> j<span style="color: #339933;">&lt;</span>H<span style="color: #339933;">;</span> j<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>W<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// ERROR! Write to same buffer. Not possible in gpu shader</span>
		<span style="color: #666666; font-style: italic;">//Image1[i+j*W] = Image1[i+j*W] * 2;  // Mul by 2</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Ping-pong version</span>
		<span style="color: #000066; font-weight: bold;">int</span> src <span style="color: #339933;">=</span> CurrActiveBuffer<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Current active buffer (Input)</span>
		<span style="color: #000066; font-weight: bold;">int</span> dest <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">-</span>CurrActiveBuffer<span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// Back buffer (Output)</span>
		Image1<span style="color: #009900;">&#91;</span>dest<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>i<span style="color: #339933;">+</span>j<span style="color: #339933;">*</span>W<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> Image1<span style="color: #009900;">&#91;</span>src<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>i<span style="color: #339933;">+</span>j<span style="color: #339933;">*</span>W<span style="color: #009900;">&#93;</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// Mul by 2</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Swap back and front buffers (read becomes write and vice-versa)</span>
CurrActiveBuffer <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">-</span>CurrActiveBuffer<span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">// CurrActiveBuffer ? 0 : 1;</span></pre></div></div>

<p style="text-align: justify;">As you can see we start with buffer 0. That&#8217;s where we get out data from (read) and write it to Buffer 1. Once the operation is done, we swap buffers and so on. This way we&#8217;ll be able to use last iteration&#8217;s data as input for the next iteration.</p>
<p style="text-align: justify;">Now let&#8217;s put this in OpenGL way. I will be using a FrameBufferObject (FBO) and 2 textures here. The framebuffer will be holding to both textures as 2 Color Attachments. So let&#8217;s get coding:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// Initialization</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #000066; font-weight: bold;">int</span> W <span style="color: #339933;">=</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> H <span style="color: #339933;">=</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> FboID<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> TexID<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> CurrActiveBuffer <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// Current active buffer index</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Create the frambuffer</span>
glGenFramebuffersEXT<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">1</span>, <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>FboID <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
glBindFramebufferEXT<span style="color: #009900;">&#40;</span> GL_FRAMEBUFFER_EXT, FboID <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Create 2 textures for input/output.</span>
glGenTextures<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">2</span>, TexID <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	glBindTexture<span style="color: #009900;">&#40;</span> GL_TEXTURE_2D, TexID<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	glTexParameteri<span style="color: #009900;">&#40;</span> GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	glTexParameteri<span style="color: #009900;">&#40;</span> GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	glTexParameteri<span style="color: #009900;">&#40;</span> GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	glTexParameteri<span style="color: #009900;">&#40;</span> GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	glTexImage2D<span style="color: #009900;">&#40;</span> GL_TEXTURE_2D, <span style="color: #cc66cc;">0</span>, GL_RGBA, W, H, <span style="color: #cc66cc;">0</span>, GL_RGBA, GL_FLOAT, <span style="color: #000066; font-weight: bold;">NULL</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> _hasMipmapping <span style="color: #009900;">&#41;</span>  glGenerateMipmapEXT<span style="color: #009900;">&#40;</span> GL_TEXTURE_2D <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Now attach textures to FBO</span>
<span style="color: #000066; font-weight: bold;">int</span> src <span style="color: #339933;">=</span> CurrActiveBuffer<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> dest <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">-</span>CurrActiveBuffer<span style="color: #339933;">;</span>
glFramebufferTexture2DEXT<span style="color: #009900;">&#40;</span> GL_FRAMEBUFFER_EXT, 
                           GL_COLOR_ATTACHMENT0_EXT, 
                           GL_TEXTURE_2D, TexID<span style="color: #009900;">&#91;</span>src<span style="color: #009900;">&#93;</span>, <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
glFramebufferTexture2DEXT<span style="color: #009900;">&#40;</span> GL_FRAMEBUFFER_EXT, 
                           GL_COLOR_ATTACHMENT1_EXT, 
                           GL_TEXTURE_2D, TexID<span style="color: #009900;">&#91;</span>dest<span style="color: #009900;">&#93;</span>, <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// Mainloop</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #000066; font-weight: bold;">int</span> src <span style="color: #339933;">=</span> CurrActiveBuffer<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> dest <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">-</span>CurrActiveBuffer<span style="color: #339933;">;</span>
&nbsp;
FBO.<span style="color: #006633;">Bind</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
glDrawBuffer<span style="color: #009900;">&#40;</span> dest <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
glBindTexture<span style="color: #009900;">&#40;</span> GL_TEXTURE_2D, TexID<span style="color: #009900;">&#91;</span>src<span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
ShaderProgram.<span style="color: #006633;">SetTextureUniform</span><span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
RenderScene<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
FBO.<span style="color: #006633;">Unbind</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">// Swap back and front buffers (read becomes write and vice-versa)</span>
CurrActiveBuffer <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">-</span>CurrActiveBuffer<span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">// CurrActiveBuffer ? 0 : 1;</span></pre></div></div>

<p style="text-align: justify;">Why would you want to ping-pong? Well for instance imagine you are doing a water effect in the gpu? You need to access data from your previous buffer right? In the CPU that would be trivial as you know but if you want to push it&#8217;s limits by using GPU this is the next step for you. </p>
<p>Have fun.</p>
<p><a href="http://flattr.com/thing/40440/Ping-pong-technique-explained" target="_blank"><br />
<img src="http://api.flattr.com/button/button-compact-static-100x17.png" alt="Flattr this" title="Flattr this" border="0" /></a></p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.11';
var flattr_uid = 'pixelnerve';
var flattr_url = 'http://www.pixelnerve.com/v';
var flattr_lng = 'en_GB';
var flattr_cat = 'video';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'V // Pixelnerve';
var flattr_dsc = '';
</script>
<script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script>]]></content:encoded>
			<wfw:commentRss>http://www.pixelnerve.com/v/2010/07/20/pingpong-technique/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bottom Bar</title>
		<link>http://www.pixelnerve.com/v/2010/07/19/bottom-bar/</link>
		<comments>http://www.pixelnerve.com/v/2010/07/19/bottom-bar/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 23:39:59 +0000</pubDate>
		<dc:creator>victormartins</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.pixelnerve.com/v/?p=1175</guid>
		<description><![CDATA[Hello, is anyone out there?&#8230; I haven’t posted anything for quite sometime now. Hopefully all that will change as i get more free time to organize and work on my projects. Meanwhile, i would like you to know about something else.. Look down, you should be looking at a bar, a dark bar with a [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>Hello, is anyone out there?&#8230; I haven’t posted  anything for quite sometime now. Hopefully all that will change as i get  more free time to organize and work on my projects. Meanwhile, i would like you to know about something else..</p>
<p>Look down, you should be looking at a bar, a dark bar with a few buttons on the right side.  I&#8217;ve been thinking about this for sometime but as my webdev skills/will are at the same level (low) i was looking to some ready-to-use code. I did. You can find it here and at my <a href="../../portfolio">portfolio</a>, my two windows to the world. Thanks to <a title="thecreatorsproject.com" href="http://digitalflesh.thecreatorsproject.com" target="_blank">this guys here</a> (for the ugly code rip) and <a title="ps" href="http://www.tpolm.org/~ps/" target="_blank">Filipe &#8216;ps&#8217; Cruz</a> for help with css.</p>
</div>
<script type="text/javascript">
var flattr_wp_ver = '0.9.11';
var flattr_uid = 'pixelnerve';
var flattr_url = 'http://www.pixelnerve.com/v';
var flattr_lng = 'en_GB';
var flattr_cat = 'video';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'V // Pixelnerve';
var flattr_dsc = '';
</script>
<script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script>]]></content:encoded>
			<wfw:commentRss>http://www.pixelnerve.com/v/2010/07/19/bottom-bar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flattr</title>
		<link>http://www.pixelnerve.com/v/2010/06/12/flattr/</link>
		<comments>http://www.pixelnerve.com/v/2010/06/12/flattr/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 03:56:27 +0000</pubDate>
		<dc:creator>victormartins</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[flattr]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[share]]></category>

		<guid isPermaLink="false">http://www.pixelnerve.com/v/?p=1151</guid>
		<description><![CDATA[I have joined Flattr community recently and just submitted a few projects of mine to the list. Check it out and send me some loooove. Do you want to know more ?]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I have joined <a title="Pixelnerve @ Flattr" href="https://flattr.com/profile/pixelnerve" target="_blank">Flattr</a> community recently and just submitted a few projects of mine to the list. Check it out and send me some <strong>loooove</strong>.<a href="https://flattr.com/profile/pixelnerve" target="_blank"></a></p>
<p>Do you want to know more ?</p>
<p style="text-align: justify;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/9zrMlEEWBgY&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="640" height="385" src="http://www.youtube.com/v/9zrMlEEWBgY&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.11';
var flattr_uid = 'pixelnerve';
var flattr_url = 'http://www.pixelnerve.com/v';
var flattr_lng = 'en_GB';
var flattr_cat = 'video';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'V // Pixelnerve';
var flattr_dsc = '';
</script>
<script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script>]]></content:encoded>
			<wfw:commentRss>http://www.pixelnerve.com/v/2010/06/12/flattr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Evaluate a Cubic Bézier on GPU</title>
		<link>http://www.pixelnerve.com/v/2010/05/11/evaluate-a-cubic-bezier-on-gpu/</link>
		<comments>http://www.pixelnerve.com/v/2010/05/11/evaluate-a-cubic-bezier-on-gpu/#comments</comments>
		<pubDate>Tue, 11 May 2010 02:48:41 +0000</pubDate>
		<dc:creator>victormartins</dc:creator>
				<category><![CDATA[Graphics programming]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[bezier]]></category>
		<category><![CDATA[geometry shader]]></category>
		<category><![CDATA[gpu]]></category>
		<category><![CDATA[shader]]></category>
		<category><![CDATA[tesselation]]></category>

		<guid isPermaLink="false">http://www.pixelnerve.com/v/?p=1108</guid>
		<description><![CDATA[I&#8217;ve made an application as an example for this thread on how to compute/evaluate a Cubic Bézier Curve using a Geometry Shader. The formula is pretty straightforward as described by this wikipedia article (look for Cubic Bézier Curve). I will not go over the bézier math or theory. I assume you have some knowledge in [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I&#8217;ve made an application as an example for this <a href="http://processing.org/discourse/yabb2/YaBB.pl?num=1273399193/5#5" target="_blank">thread</a> on how to compute/evaluate a Cubic Bézier Curve using a Geometry Shader. The formula is pretty straightforward as described by this <a href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve" target="_blank">wikipedia article</a> (look for Cubic Bézier Curve). I will not go over the bézier math or theory. I assume you have some knowledge in shader programming (GLSL is the case) and some math background would help, while not really a need. All that said, let&#8217;s get to work.</p>
<p style="text-align: justify;">On this case we will need 4 points: 2 anchor points (the line end points) and 2 control points. The control points won&#8217;t really touch the curve, they work more as directional information on the curve itself.</p>
<p style="text-align: justify;">As we need to send this data to the shader i have decided to use  LINES as input primitive, 2 points define a line so it&#8217;s perfect, we&#8217;ll use that for the 2 anchor points. As for the control points 2 different texture units (glMultiTexCoord3f) attached to the line&#8217;s vertex data will do. Using geometry shaders besides setting the input primitive type we also need to set the output type. LINE_STRIP is fine, as it works perfectly for what we&#8217;re doing. That&#8217;s all on the application side.</p>
<p style="text-align: justify;">On the vertex shader side it&#8217;s pretty simple:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #009900;">&#91;</span>VERTEX SHADER<span style="color: #009900;">&#93;</span>
<span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">void</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    gl_FrontColor <span style="color: #339933;">=</span> gl_Color<span style="color: #339933;">;</span>
    ControlPoint1 <span style="color: #339933;">=</span> gl_MultiTexCoord0.<span style="color: #006633;">xyz</span><span style="color: #339933;">;</span>
    ControlPoint2 <span style="color: #339933;">=</span> gl_MultiTexCoord1.<span style="color: #006633;">xyz</span><span style="color: #339933;">;</span>
&nbsp;
    gl_Position <span style="color: #339933;">=</span> gl_Vertex<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p style="text-align: justify;">What the code is doing is sending the data further down the pipeline to the geometry shader, where all the magic happens. At this stage, having both Anchor and Control points we can now define the curve by a given detail. Think of detail as a number of step-points along the curve which makes it look smoother or flatten (tesselation, subdivision, smoothing, etc).</p>
<p style="text-align: justify;">Both control points are sent by the application for the geometry shader, still, as in the the vertex shader comes before the geometry shader, we will need to send them down on the vertex-shader, otherwise the GS won&#8217;t be able to &#8220;see&#8221; them (i know, hurray for Cg). We&#8217;re now almost done. By using the function from the above link(s) and as shown below we compute the curve with a given detail on the geometry shader, by generating new vertices along the curve purely on the gpu side. I think it to be pretty straightforward and the code should be self-explanatory.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #009900;">&#91;</span>GEOMETRY SHADER<span style="color: #009900;">&#93;</span>
uniform <span style="color: #000066; font-weight: bold;">int</span> g_Detail<span style="color: #339933;">;</span>
varying in vec3 ControlPoint1<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
varying in vec3 ControlPoint2<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Found in nvidia sdk</span>
vec3 evaluateBezierPosition<span style="color: #009900;">&#40;</span> vec3 v<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span>, <span style="color: #000066; font-weight: bold;">float</span> t <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    vec3 p<span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">float</span> OneMinusT <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1.0</span> <span style="color: #339933;">-</span> t<span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">float</span> b0 <span style="color: #339933;">=</span> OneMinusT<span style="color: #339933;">*</span>OneMinusT<span style="color: #339933;">*</span>OneMinusT<span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">float</span> b1 <span style="color: #339933;">=</span> <span style="color: #cc66cc;">3.0</span><span style="color: #339933;">*</span>t<span style="color: #339933;">*</span>OneMinusT<span style="color: #339933;">*</span>OneMinusT<span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">float</span> b2 <span style="color: #339933;">=</span> <span style="color: #cc66cc;">3.0</span><span style="color: #339933;">*</span>t<span style="color: #339933;">*</span>t<span style="color: #339933;">*</span>OneMinusT<span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">float</span> b3 <span style="color: #339933;">=</span> t<span style="color: #339933;">*</span>t<span style="color: #339933;">*</span>t<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">return</span> b0<span style="color: #339933;">*</span>v<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> b1<span style="color: #339933;">*</span>v<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> b2<span style="color: #339933;">*</span>v<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> b3<span style="color: #339933;">*</span>v<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    vec3 pos<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    pos<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> gl_PositionIn<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #006633;">xyz</span><span style="color: #339933;">;</span>
    pos<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> ControlPoint1<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    pos<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> ControlPoint2<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    pos<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> gl_PositionIn<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #006633;">xyz</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">float</span> OneOverDetail <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1.0</span> <span style="color: #339933;">/</span> <span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#40;</span>g_Detail<span style="color: #339933;">-</span><span style="color: #cc66cc;">1.0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>g_Detail<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">float</span> t <span style="color: #339933;">=</span> i <span style="color: #339933;">*</span> OneOverDetail<span style="color: #339933;">;</span>
        vec3 p <span style="color: #339933;">=</span> evaluateBezierPosition<span style="color: #009900;">&#40;</span> pos, t <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        gl_FrontColor <span style="color: #339933;">=</span> gl_FrontColorIn<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> 
        gl_Position <span style="color: #339933;">=</span> gl_ModelViewProjectionMatrix <span style="color: #339933;">*</span> vec4<span style="color: #009900;">&#40;</span> p.<span style="color: #006633;">xyz</span>, <span style="color: #cc66cc;">1.0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        EmitVertex<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    EndPrimitive<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p style="text-align: justify;">What&#8217;s next? That is up to you. You&#8217;re not going to leave me with all the work, are you ?</p>
<p style="text-align: justify;">Download the <a title="GPUBézier" href="http://victamin.googlecode.com/files/GPUBezier.zip" target="_blank">example + source</a>.<br />
You will also need to install <a title="Vitamin" href="http://victamin.googlecode.com/files/vitamin_0_5_6.zip" target="_blank">Vitamin 0.5.6</a> as the project is built with it.</p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.11';
var flattr_uid = 'pixelnerve';
var flattr_url = 'http://www.pixelnerve.com/v';
var flattr_lng = 'en_GB';
var flattr_cat = 'video';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'V // Pixelnerve';
var flattr_dsc = '';
</script>
<script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script>]]></content:encoded>
			<wfw:commentRss>http://www.pixelnerve.com/v/2010/05/11/evaluate-a-cubic-bezier-on-gpu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Float</title>
		<link>http://www.pixelnerve.com/v/2010/05/06/float/</link>
		<comments>http://www.pixelnerve.com/v/2010/05/06/float/#comments</comments>
		<pubDate>Thu, 06 May 2010 17:30:31 +0000</pubDate>
		<dc:creator>victormartins</dc:creator>
				<category><![CDATA[Demos]]></category>
		<category><![CDATA[Generative]]></category>
		<category><![CDATA[Graphics programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Works]]></category>
		<category><![CDATA[cgfx]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[demoscene]]></category>
		<category><![CDATA[shader]]></category>
		<category><![CDATA[vitamin]]></category>

		<guid isPermaLink="false">http://www.pixelnerve.com/v/?p=1100</guid>
		<description><![CDATA[I have recently released at inércia Demoparty, a gift i made for Sue. It started as a christmas gift that would express myself and ofcourse keep me from following everybody else to the local shop and spend my money on something  made by others. There is no executable this time, as i don&#8217;t know if [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I have recently released at inércia Demoparty, a gift i made for <a title="S*" href="http://www.pixelnerve.com/s" target="_blank">Sue</a>. It started as a christmas gift that would express myself and ofcourse keep me from following everybody else to the local shop and spend my money on something  made by others.</p>
<p style="text-align: justify;">There is no executable this time, as i don&#8217;t know if i can spread the music, still, nobody can stop me  (for the moment) from giving you a video. So here it is, <a title="Float" href="http://vimeo.com/11463562" target="_blank">Float</a>.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="360" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=11463562&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="640" height="360" src="http://vimeo.com/moogaloop.swf?clip_id=11463562&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.11';
var flattr_uid = 'pixelnerve';
var flattr_url = 'http://www.pixelnerve.com/v';
var flattr_lng = 'en_GB';
var flattr_cat = 'video';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'V // Pixelnerve';
var flattr_dsc = '';
</script>
<script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script>]]></content:encoded>
			<wfw:commentRss>http://www.pixelnerve.com/v/2010/05/06/float/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Grazing Jellies</title>
		<link>http://www.pixelnerve.com/v/2010/04/21/grazing-jellies/</link>
		<comments>http://www.pixelnerve.com/v/2010/04/21/grazing-jellies/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 19:36:41 +0000</pubDate>
		<dc:creator>victormartins</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[Graphics programming]]></category>
		<category><![CDATA[Interactive]]></category>
		<category><![CDATA[Works]]></category>
		<category><![CDATA[augmented reality]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[jelly]]></category>
		<category><![CDATA[openframeworks]]></category>
		<category><![CDATA[realtime]]></category>

		<guid isPermaLink="false">http://www.pixelnerve.com/v/?p=1064</guid>
		<description><![CDATA[Grazing Jellies is an augmented reality project i had the pleasure to work in. I made team with Neil Mendonza and Hudson-Powell, commissioned by the Abandon Normal Devices festival. Grazing Jellies takes place in a forest, a realtime portal into a colorful dream-like world of jelly creatures. The creatures were created to react to movement [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Grazing Jellies is an augmented reality project i had the pleasure to work in. I made team with <a href="http://16b.it/portfolio" target="_blank">Neil Mendonza</a> and <a href="http://www.hudson-powell.com/" target="_blank">Hudson-Powell</a>, commissioned by the <a href="http://www.andfestival.org.uk/">Abandon  Normal Devices</a> festival. Grazing Jellies takes place in a forest, a realtime portal into a colorful dream-like world of jelly creatures. The creatures were created to react to movement of the ambient/people and can also be called by making noise, When nothing is going on they wander around the world and hunt for food. My work on this project was mostly about the jellies generation/animation/rendering.</p>
<p style="text-align: justify;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="360" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=11117516&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="640" height="360" src="http://vimeo.com/moogaloop.swf?clip_id=11117516&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p style="text-align: justify;">At  first, there was the idea to use metaballs for the creatures, we wanted  to give this jelly  surfaces some wobbling/round forms. After some  testing we decided not to, as i did not see any advantage specially in  performace,  so we went with a more &#8220;traditional&#8221; method.  The   creatures were generated from 2 steps. The body and the head.</p>
<p style="text-align: justify;"><a href="../wp-content/uploads/2010/04/2.jpg" rel="shadowbox[post-1064];player=img;"></a><a href="http://www.pixelnerve.com/v/wp-content/uploads/2010/04/2.jpg" rel="shadowbox[post-1064];player=img;"><img class="alignnone size-medium wp-image-1066" title="2" src="http://www.pixelnerve.com/v/wp-content/uploads/2010/04/2-638x359.jpg" alt="" width="638" height="359" /></a></p>
<p style="text-align: justify;"><em>The body</em>: Create a skeleton line and  generate a deforming cylindrical body from the line. After some time and tweaking  the body right. After just had to start playing with values to get the animation going. Some trig + using creature&#8217;s motion parameters worked just fine, we got it right, but, there was still a problem, the creature&#8217;s heads.  <em>The head</em>: Well i tried different methods, interpolating the body&#8217;s end with some spherical shape wish ease on, but it did not work out. The  head textures just didn&#8217;t look good, &#8220;pinched&#8221; as Jody said several  times.  We ended up creating the head as a second step, building an  hemisphere and then &#8220;attaching&#8221;  it to the body&#8217;s end. Good news is later on, it came handy,  as it made things alot easier to map the head&#8217;s texture. Some things just come  handy sometimes. I had to tweak a bit to get the head and body animation get along,  but in the end it turned out to look pretty good.</p>
<p style="text-align: justify;">As for the lighting side, a kind of &#8220;ambient light&#8221; + phong lighting + cubemap reflections made it to the final version.</p>
<p style="text-align: justify;"><a href="http://www.pixelnerve.com/v/wp-content/uploads/2010/04/1.jpg" rel="shadowbox[post-1064];player=img;"><img class="alignnone size-medium wp-image-1065" title="1" src="http://www.pixelnerve.com/v/wp-content/uploads/2010/04/1-638x406.jpg" alt="" width="638" height="406" /></a></p>
<p style="text-align: justify;">This is an  awesome project and i really enjoyed working with the team. As said  before this should not be a closed project, it was projected to live and  change so it can fit other ambients, so expect to see more from the  *mighty* <strong>Grazing Jellies</strong>.</p>
<p style="text-align: justify;"><a href="http://www.pixelnerve.com/v/wp-content/uploads/2010/04/3.jpg" rel="shadowbox[post-1064];player=img;"><img class="alignnone size-medium wp-image-1067" title="3" src="http://www.pixelnerve.com/v/wp-content/uploads/2010/04/3-638x359.jpg" alt="" width="638" height="359" /></a></p>
<p style="text-align: justify;">Some videos on the <a href="http://grazingjellies.tumblr.com/">development  blog</a>.</p>
<p style="text-align: justify;">Full article on the festival @ <a href="http://www.wired.co.uk/news/archive/2010-04/06/abandon-normal-devices-digital-art-meets-a-forest.aspx">Wired</a>.</p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.11';
var flattr_uid = 'pixelnerve';
var flattr_url = 'http://www.pixelnerve.com/v';
var flattr_lng = 'en_GB';
var flattr_cat = 'video';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'V // Pixelnerve';
var flattr_dsc = '';
</script>
<script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script>]]></content:encoded>
			<wfw:commentRss>http://www.pixelnerve.com/v/2010/04/21/grazing-jellies/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mass cube rendering</title>
		<link>http://www.pixelnerve.com/v/2010/04/03/mass-cube-rendering/</link>
		<comments>http://www.pixelnerve.com/v/2010/04/03/mass-cube-rendering/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 12:02:01 +0000</pubDate>
		<dc:creator>victormartins</dc:creator>
				<category><![CDATA[Generative]]></category>
		<category><![CDATA[Graphics programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[geometry shader]]></category>
		<category><![CDATA[gpu]]></category>
		<category><![CDATA[instancing]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[shaders]]></category>

		<guid isPermaLink="false">http://www.pixelnerve.com/v/?p=1033</guid>
		<description><![CDATA[I have recently done some experimental work in order to render mass amounts of cubes. I was moved by this video from Smash, i wanted to know how far i would be able to go on my NVidia GT240M (rendering side). My first choice was Geometry Shaders. I quickly wrote an app that sent a [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I have recently done some experimental work in order to render mass amounts of cubes. I was moved by <a href="http://vimeo.com/9888065" target="_blank">this video from Smash</a>, i wanted to know how far i would be able to go on my NVidia GT240M (rendering side). My first choice was <a href="http://en.wikipedia.org/wiki/Geometry_shader" target="_blank">Geometry Shaders</a>.<br />
I quickly wrote an app that sent a list of points in space to the GPU and a geometry shader would generate a cube mesh for each one of  the points. Tested it on 100.000 cubes and the framerate was bad(10fps or so). The time was now for optimization.</p>
<p><a href="http://www.pixelnerve.com/v/wp-content/uploads/2010/04/frame_127.png" rel="shadowbox[post-1033];player=img;"><img class="size-medium wp-image-1051" title="100k cubes using GS + cpu animation" src="http://www.pixelnerve.com/v/wp-content/uploads/2010/04/frame_127-634x356.png" alt="" width="634" height="356" /></a></p>
<p style="text-align: justify;">Next step was to optimize the cube generation by lowering from a 24 vertex cube to 14 vertex triangle strip. Things got better, but nothing close to my expectations. I was not satisfied, i mean, i had alot of cubes on screen (100K which was not that much) and that was it, nothing else. We&#8217;re talking about 20fps or so, for 100.000 cubes (around 1.2 million triangles per frame). Later on i added vertex normals to the geometry shader and started to work on some lighting/shadowing, but i ended up going back on the rendering side of the job. Meanwhile, i was speaking with a <a href="http://diogo.codingcorner.net/" target="_blank">friend of mine</a> about this idea and we were discussing ways to compute lighting but i couldn&#8217;t stop thinking about my real problem. So it came to me.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="360" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=10501999&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="640" height="360" src="http://vimeo.com/moogaloop.swf?clip_id=10501999&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p style="text-align: justify;">Previously, i have done some experiments with opengl hardware instancing, but never got  to do much about it .  What better time than now, so i grabbed the project and took it for a spin. After a few hours i had the same amount of cubes on screen with a much much better framerate. Quickly implemented some eye-candy (coloring, texturing, vertex lighting), some tweaking here and there and as i was listening to Mr. Peter Broderick (hi, i love you man) added some audio analysis to the feature list.<br />
Last but not least, a kind of &#8220;Brownian Motion&#8221; was used to generate points in space, increased the cube count to 512*512 and watched it flow ( at 20fps ).</p>
<p style="text-align: justify;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="360" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=10503489&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="640" height="360" src="http://vimeo.com/moogaloop.swf?clip_id=10503489&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p style="text-align: justify;">In conclusion, Hardware instancing was much easier to implement  and performance seems much better at first sight. Above is a video of 262.144 audio-reactive cubes with GPU animation and basic lighting at around 20fps. For my video card i think that is very good. On a sidenote, i have not given up on the geometry shaders. I am not sure what will be my next step regarding the subject (back to geometry shaders?) but for now this is it. Hardware Instancing kicked Geometry Shaders in the ass.</p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.11';
var flattr_uid = 'pixelnerve';
var flattr_url = 'http://www.pixelnerve.com/v';
var flattr_lng = 'en_GB';
var flattr_cat = 'video';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'V // Pixelnerve';
var flattr_dsc = '';
</script>
<script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script>]]></content:encoded>
			<wfw:commentRss>http://www.pixelnerve.com/v/2010/04/03/mass-cube-rendering/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Function2Form</title>
		<link>http://www.pixelnerve.com/v/2010/03/08/function2form/</link>
		<comments>http://www.pixelnerve.com/v/2010/03/08/function2form/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 00:01:00 +0000</pubDate>
		<dc:creator>victormartins</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.pixelnerve.com/v/?p=995</guid>
		<description><![CDATA[Function2Form is a work created for The Viewer, an online magazine focused on photography and video. &#8220;Function2Form is a work on form and shape generation from the subdivision of space and image analysis. It has no rules other than the creation/deformation of limited space. It&#8217;s a study on photography. It&#8217;s a random case of geometry [...]]]></description>
			<content:encoded><![CDATA[<p>Function2Form is a work created for <a title="The Viewer" href="http://www.theviewer.fr" target="_blank">The Viewer</a>, an online magazine focused on photography and video.</p>
<p style="text-align: justify;"><em>&#8220;</em><em>Function2Form is a work on form and shape generation from the subdivision of space and image analysis. It has no rules other than the creation/deformation of limited space. It&#8217;s a study on photography. It&#8217;s a random case of geometry generation and a study of differences for different parameters and areas. Based on randomness i would say these are unique and lost generated pieces of a kind.</em><em>&#8220;</em></p>
<p>Created with a <a href="http://www.pixelnerve.com/processing/libraries/vitamin" target="_blank">custom framework</a> for scene generation and 3dsmax for the rendering.</p>

<a href='http://www.pixelnerve.com/v/wp-content/uploads/2010/03/000.png' rel='shadowbox[album-995];player=img;' title='#000'><img width="150" height="150" src="http://www.pixelnerve.com/v/wp-content/uploads/2010/03/000-150x150.png" class="attachment-thumbnail" alt="#000" title="#000" /></a>
<a href='http://www.pixelnerve.com/v/wp-content/uploads/2010/03/001.png' rel='shadowbox[album-995];player=img;' title='#001'><img width="150" height="150" src="http://www.pixelnerve.com/v/wp-content/uploads/2010/03/001-150x150.png" class="attachment-thumbnail" alt="#001" title="#001" /></a>
<a href='http://www.pixelnerve.com/v/wp-content/uploads/2010/03/008__5-1-C3_2.png' rel='shadowbox[album-995];player=img;' title='#008__5-1-C3_2'><img width="150" height="150" src="http://www.pixelnerve.com/v/wp-content/uploads/2010/03/008__5-1-C3_2-150x150.png" class="attachment-thumbnail" alt="#008__5-1-C3_2" title="#008__5-1-C3_2" /></a>
<a href='http://www.pixelnerve.com/v/wp-content/uploads/2010/03/010__T2-LV.png' rel='shadowbox[album-995];player=img;' title='#010__T2-LV'><img width="150" height="150" src="http://www.pixelnerve.com/v/wp-content/uploads/2010/03/010__T2-LV-150x150.png" class="attachment-thumbnail" alt="#010__T2-LV" title="#010__T2-LV" /></a>

<p>Note: For the complete series, check out <a href="http://www.theviewer.fr/flash5/viewernumero5.html" target="_blank">The Viewer #5</a></p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.11';
var flattr_uid = 'pixelnerve';
var flattr_url = 'http://www.pixelnerve.com/v';
var flattr_lng = 'en_GB';
var flattr_cat = 'video';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'V // Pixelnerve';
var flattr_dsc = '';
</script>
<script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script>]]></content:encoded>
			<wfw:commentRss>http://www.pixelnerve.com/v/2010/03/08/function2form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monologue Muet &#8211; Outside projection</title>
		<link>http://www.pixelnerve.com/v/2010/03/07/monologue-muet-outside-projection/</link>
		<comments>http://www.pixelnerve.com/v/2010/03/07/monologue-muet-outside-projection/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 20:18:22 +0000</pubDate>
		<dc:creator>victormartins</dc:creator>
				<category><![CDATA[Generative]]></category>
		<category><![CDATA[Graphics programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Works]]></category>
		<category><![CDATA[exhibition]]></category>
		<category><![CDATA[projection mapping]]></category>

		<guid isPermaLink="false">http://www.pixelnerve.com/v/?p=981</guid>
		<description><![CDATA[This is the outside projection for Monologue Muet exhibition, a photography work by Sue Elie Andrade De. Based on her video called The Rain, i have created the outside projection with response to physical properties, like doors and windows.]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">This is the outside projection for <a title="Monologue Muet" href="http://www.pixelnerve.com/s/index.php?/projects/work-in-progress-research/" target="_blank">Monologue Muet</a> exhibition, a photography work by <a href="http://www.sueelieandradede.com/" target="_blank">Sue Elie Andrade De</a>.<br />
Based on her video called <a title="The Rain" href="http://vimeo.com/8760693" target="_blank">The Rain</a>, i have created the outside projection with response to physical properties, like doors and windows.</p>
<p style="text-align: justify;"><a rel="attachment wp-att-986" href="http://www.pixelnerve.com/v/2010/03/07/monologue-muet-outside-projection/pic_1198/"><img class="alignnone size-medium wp-image-986" title="PIC_1198" src="http://www.pixelnerve.com/v/wp-content/uploads/2010/03/PIC_1198-634x475.jpg" alt="" width="634" height="475" /></a></p>
<p style="text-align: justify;"><a rel="attachment wp-att-988" href="http://www.pixelnerve.com/v/2010/03/07/monologue-muet-outside-projection/pic_1205/"><img class="alignnone size-medium wp-image-988" title="PIC_1205" src="http://www.pixelnerve.com/v/wp-content/uploads/2010/03/PIC_1205-634x475.jpg" alt="" width="634" height="475" /></a></p>
<p style="text-align: justify;"><a rel="attachment wp-att-987" href="http://www.pixelnerve.com/v/2010/03/07/monologue-muet-outside-projection/pic_1203/"><img class="alignnone size-medium wp-image-987" title="PIC_1203" src="http://www.pixelnerve.com/v/wp-content/uploads/2010/03/PIC_1203-634x475.jpg" alt="" width="634" height="475" /></a></p>
<p style="text-align: justify;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="480" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=9908918&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="640" height="480" src="http://vimeo.com/moogaloop.swf?clip_id=9908918&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.11';
var flattr_uid = 'pixelnerve';
var flattr_url = 'http://www.pixelnerve.com/v';
var flattr_lng = 'en_GB';
var flattr_cat = 'video';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'V // Pixelnerve';
var flattr_dsc = '';
</script>
<script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script>]]></content:encoded>
			<wfw:commentRss>http://www.pixelnerve.com/v/2010/03/07/monologue-muet-outside-projection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
