<?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 &#187; opengl</title>
	<atom:link href="http://www.pixelnerve.com/v/tag/opengl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pixelnerve.com/v</link>
	<description></description>
	<lastBuildDate>Sun, 30 Oct 2011 23:43:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>DroidTUIO</title>
		<link>http://www.pixelnerve.com/v/2010/11/04/dt/</link>
		<comments>http://www.pixelnerve.com/v/2010/11/04/dt/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 19:40:30 +0000</pubDate>
		<dc:creator>victormartins</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Works]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[tuio]]></category>

		<guid isPermaLink="false">http://www.pixelnerve.com/v/?p=1317</guid>
		<description><![CDATA[DroidTUIO is my first application made for Android OS. It was created for OS version 2.1+  with OpenGL ES renderer. This application is available to the public as i hope to get feedback, so please, spare a few minutes and let me know how it worked out for you. Now.. on with the application.  First [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><strong>DroidTUIO</strong> is my first application made for Android OS. It was created for OS version 2.1+  with OpenGL ES renderer. This application is available to the public as i hope to get feedback, so please, spare a few minutes and let me know how it worked out for you. Now.. on with the application.  First thing you need to do is to run the application and then press MENU/Settings. Enter your network IP and press connect. Once connected, use your phone to send TUIO events (2dcursor only for the moment). Have fun.</p>
<p style="text-align: justify;">Update! The link has been removed as the application was removed from online. I will get a new link ASAP.<a href="http://www.pixelnerve.com/v/wp-content/uploads/2010/11/dT.png" rel="shadowbox[sbpost-1317];player=img;"><br />
</a></p>
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://www.pixelnerve.com/v/2010/11/04/dt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GML Viscosity</title>
		<link>http://www.pixelnerve.com/v/2010/09/07/gml-viscosity/</link>
		<comments>http://www.pixelnerve.com/v/2010/09/07/gml-viscosity/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 07:32:25 +0000</pubDate>
		<dc:creator>victormartins</dc:creator>
				<category><![CDATA[GPU]]></category>
		<category><![CDATA[Graphics programming]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[Works]]></category>
		<category><![CDATA[cgfx]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[gml]]></category>
		<category><![CDATA[gpu]]></category>
		<category><![CDATA[graffiti]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[realtime]]></category>
		<category><![CDATA[shaders]]></category>
		<category><![CDATA[vitamin]]></category>

		<guid isPermaLink="false">http://www.pixelnerve.com/v/?p=1259</guid>
		<description><![CDATA[So here it is, the application and source code for GML Viscosity. I finally took the time to clean up this project and make a public release. In the packages you will find binaries and source code for the application, so if you&#8217;re thinking of using it and come up with something nice, let me [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">So here it is, the application and source code for <strong>GML Viscosity</strong>.</p>
<p style="text-align: justify;"><a href="http://www.pixelnerve.com/v/wp-content/uploads/2010/09/Frame_0233.jpg" rel="shadowbox[sbpost-1259];player=img;"><img class="alignnone size-medium wp-image-1280" title="Frame_0233" src="http://www.pixelnerve.com/v/wp-content/uploads/2010/09/Frame_0233-638x357.jpg" alt="" width="638" height="357" /></a></p>
<p style="text-align: justify;">I finally took the time to clean up this project and make a public release. In the packages you will find binaries and source code for the application, so if you&#8217;re thinking of using it and come up with something nice, let me know. After the first release i have fixed some problems with memory access and crashes. I have also added a simple UI for easy pick of tags from the &#8220;data/tags&#8221; folder on your hard-drive.</p>
<p><iframe src="http://player.vimeo.com/video/13550099?title=0&amp;byline=0&amp;portrait=0&amp;color=ffffff" width="640" height="360" frameborder="0"></iframe></p>
<p style="text-align: justify;"><i>What is it?</i><strong><br />
- GML Viscosity</strong> is an experiment. It is application used to draw GML tags on a viscous liquid rendered purely on the GPU side.</p>
<p style="text-align: justify;"><i>What does it do?</i><br />
- It liquifies your tags, in a way you can hardly read them but still looks cool (thats graffiti).<br />
- It is possible to load gml files from the disk or directly from the <a title="http://000000book.com/" href="http://000000book.com/">&#8220;lots of zeros&#8221;book</a> database.</p>
<p style="text-align: justify;"><a href="http://www.pixelnerve.com/v/wp-content/uploads/2010/09/Frame_0228.jpg" rel="shadowbox[sbpost-1259];player=img;"><img class="alignnone size-medium wp-image-1277" title="Frame_0228" src="http://www.pixelnerve.com/v/wp-content/uploads/2010/09/Frame_0228-638x357.jpg" alt="" width="638" height="357" /></a></p>
<p style="text-align: justify;"><i>How can I interact?</i><br />
- Not implemented on this version. This version selects and draw gml files randomly from the web or from a tags folder. For a smart person it should be easy to add mouse support. The code is also prepared to support multitouch so, it should be easy to implement TUIO and create your multitouch version.<br />
- Use &#8216;r&#8217; key to randomly fetch a new tag from the website and if available it will draw it on the screen.<br />
- Use the GUI window to pick any tag from the folder &#8220;tags&#8221; inside data folder.</p>
<p style="text-align: justify;">
<p style="text-align: justify;"><i>Where can i get it?</i><br />
<a title="GML Viscosity" href="http://www.pixelnerve.com/downloads/processing/GMLViscosity_win.zip" target="_blank">Windows Version</a> | <a title="GML Viscosity" href="http://www.pixelnerve.com/downloads/processing/GMLViscosity_osx.zip" target="_blank">MacOSX Version</a></p>
<p style="text-align: justify;">Have fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelnerve.com/v/2010/09/07/gml-viscosity/feed/</wfw:commentRss>
		<slash:comments>2</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>
		ImageArray<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> ImageArray<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 every frame. 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 language. 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>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>
        <span style="color: #666666; font-style: italic;">// RGBA8 buffer</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_UNSIGNED_BYTE, <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&#8217;ll need to access data from your previous buffer right? Using the CPU that would be trivial as you have the last frame&#8217;s memory buffer allocated somewhere which you can read/write access directly. That doesn&#8217;t really work on the gpu side that way (but we&#8217;re getting closer with CL, CUDA, DC) </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>
]]></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>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[sbpost-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>
]]></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>MovieGL &#8211; Rendering movies with JOGL in Java/Processing</title>
		<link>http://www.pixelnerve.com/v/2009/10/28/moviegl-rendering-movies-with-jogl-in-javaprocessing/</link>
		<comments>http://www.pixelnerve.com/v/2009/10/28/moviegl-rendering-movies-with-jogl-in-javaprocessing/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 21:17:57 +0000</pubDate>
		<dc:creator>victormartins</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[jogl]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[loader]]></category>
		<category><![CDATA[movie]]></category>
		<category><![CDATA[opengl]]></category>

		<guid isPermaLink="false">http://www.pixelnerve.com/v/?p=821</guid>
		<description><![CDATA[I have tested most of the libraries available for processing able to render video files, but i never was happy. Either it became slow, unstable or just crashing. I wanted something better, so i went looking into JMF (Java Media Framework). During my research i came across this Pirelenito&#8217;s website with a great example on [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I have tested most of the libraries available for processing able to render video files, but i never was happy. Either it became slow, unstable or just crashing. I wanted something better, so i went looking into JMF (Java Media Framework).</p>
<p style="text-align: justify;">During my research i came across this <a href="http://blog.pirelenito.org/2008/08/java-movie-playback-jogl-fobs4jmf/" target="_blank">Pirelenito&#8217;s website</a> with a great example on using FOBS+JMF, exactly what i needed. So i  downloaded it and started working on it, putting into it a bit of myself.</p>
<p style="text-align: justify;">So here it is, a first pre-beta version of a library capable of rendering movie files (with sound) with Java/Processing without much effort.</p>
<p style="text-align: justify;">NOTE! I&#8217;m still having problems with a couple of codecs like DivX, Xvid, H264. It crashes on me when rendering some of these, but it works just fine for Mpeg4, PhotoJPEG, Cinepak. It isn&#8217;t perfect, but if you be careful and use the right format/codec it will go smooth. Meanwhile i will be working on a better version.</p>
<p style="text-align: justify;">Website: <a title="movieGL" href="http://www.pixelnerve.com/processing/libraries/moviegl" target="_blank">www.pixelnerve.com/processing/libraries/moviegl</a><br />
Library Package(s) at: :  <a title="MovieGL" href="http://code.google.com/p/victamin/downloads/list" target="_blank">http://code.google.com/p/victamin/downloads/list</a></p>
<p style="text-align: justify;">Have fun!</p>
<p style="text-align: justify;">
<p style="text-align: justify;">Credits goto <a href="http://blog.pirelenito.org/" target="_blank">Pirelenito</a>. Thanks for sharing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelnerve.com/v/2009/10/28/moviegl-rendering-movies-with-jogl-in-javaprocessing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sidescroll, prototype.</title>
		<link>http://www.pixelnerve.com/v/2009/06/08/sidescroll-prototype/</link>
		<comments>http://www.pixelnerve.com/v/2009/06/08/sidescroll-prototype/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 18:27:50 +0000</pubDate>
		<dc:creator>victormartins</dc:creator>
				<category><![CDATA[Graphics programming]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[realtime]]></category>

		<guid isPermaLink="false">http://www.pixelnerve.com/v/?p=534</guid>
		<description><![CDATA[Sidescroll. This is a small clip of a project i started last year, and haven&#8217;t got back to it since then. It&#8217;s sitting in my hd, waiting for some motivation and will (anyone?). Anyway, I wanted to make something different from my other stuff, something that looked good and had no fancy 3d, even if [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Sidescroll. This is a small clip of a project i started last year, and haven&#8217;t got back to it since then. It&#8217;s sitting in my hd, waiting for some motivation and will (anyone?). Anyway, I wanted to make something different from my other stuff, something that looked good and had no fancy 3d, even if i used 3d meshes (which i do as &#8220;flowers&#8221;) and was based on simple scrolling and that had a sunset-like look. So this is what i got  I have some new ideas for this one, some new pieces to put in and lots of rewriting so it sits on top of my framework and get rid of old and bad code. Anyway i thought i would publish this video as a prototype and hopefully i&#8217;ll get the finale somewhere along this year and ready for a demoparty.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="499" height="287" 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=5048888&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="499" height="287" src="http://vimeo.com/moogaloop.swf?clip_id=5048888&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;">PS. If you are a 2d artist and would love to contribute for this, you know where to find me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelnerve.com/v/2009/06/08/sidescroll-prototype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

