<?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>Geeks3D.com &#187; GeeXLab</title>
	<atom:link href="http://www.geeks3d.com/category/geeks3d/geexlab-geeks3d/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geeks3d.com</link>
	<description>3D Tech News, Pixel Hacking, Data Visualization and 3D Programming</description>
	<lastBuildDate>Fri, 19 Mar 2010 13:48:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[TIPS] Mipmap Levels Debugging with a DDS Debug Texture</title>
		<link>http://www.geeks3d.com/20100311/tips-mipmap-levels-debugging-with-a-dds-debug-texture/</link>
		<comments>http://www.geeks3d.com/20100311/tips-mipmap-levels-debugging-with-a-dds-debug-texture/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 15:03:16 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[dds]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[lod]]></category>
		<category><![CDATA[mipmap]]></category>
		<category><![CDATA[mipmap chain]]></category>
		<category><![CDATA[mipmapping]]></category>
		<category><![CDATA[texture2DLod]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=6980</guid>
		<description><![CDATA[
DDS debug texture (available in the GeeXLab demo)
Mipmapping debugging in GeeXLab


A mipmap is a collection of images with different resolutions. A mipmap is arranged in a chain where each image is half the size of the previous one. Each resolution is a level of detail or LOD. The first level (LOD 0) is the biggest [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20091019/shader-library-bump-mapping-shader-with-multiple-lights-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Bump Mapping Shader with Multiple Lights (GLSL)'>[Shader Library] Bump Mapping Shader with Multiple Lights (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091112/shader-library-dream-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Dream Vision Post Processing Filter (GLSL)'>[Shader Library] Dream Vision Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] 2D Shockwave Post Processing Filter (GLSL)'>[Shader Library] 2D Shockwave Post Processing Filter (GLSL)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/201003/dds_mipmap_debug_texture.jpg" alt="DDS debug texture"/><br/><i>DDS debug texture (available in the GeeXLab demo)</i></p>
<p><img src="http://www.geeks3d.com/public/jegx/201003/dds_debugging.jpg" alt="DDS debugging in GeeXLab"/><br/><i>Mipmapping debugging in GeeXLab</i></p>
<p></center><br />
<span id="more-6980"></span></p>
<p>A <b>mipmap</b> is a collection of images with different resolutions. A mipmap is arranged in a chain where each image is half the size of the previous one. Each resolution is a <b>level of detail or LOD</b>. The first level (LOD 0) is the biggest image while the last level is the smallest image.</p>
<p>Mipmapping is a widely used technique in 3D programming and game development. Almost all games use mipmaping. When the camera is near a textured object, the level 0 of the mipmap is used. And when the camera moves away from the object, a smaller resolution is used (smaller resolution = higher level).</p>
<p><b>Debugging a mipmap chain</b> can be made easier with the use of a <b>debug DDS texture</b>. This DDS texture (provided in the GeeXLab demo below) is made of 7 mipmap levels: level 0: red, level 1: green, level 2: blue, level 3: yellow, level 4: pink, level 5: black and level 6: white.</p>
<p>The simple GeeXLab demo I coded for this article uses a <b>GLSL shader</b> to render a textured plane.</p>
<p>The GLSL shader is very simple:</p>
<pre>
[Vertex_Shader]
void main(void)
{
  gl_Position = ftransform();
  gl_TexCoord[0] = gl_MultiTexCoord0;
}
[Pixel_Shader]
uniform sampler2D colorMap;
uniform float lod;
void main (void)
{
  vec4 base = texture2DLod(colorMap, gl_TexCoord[0].st, lod);
  //vec4 base = texture2D(colorMap, gl_TexCoord[0].st);
  gl_FragColor = base;
}
</pre>
<p>The <b>texture2DLod</b> GLSL function makes it possible to fetch the texels of a particular mipmap level. You can select the level (lod) with the tweak bar:</p>
<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/201003/dds_debugger_lod_0.jpg" alt="DDS debugging in GeeXLab"/><br/><i>Mipmap level 0</i></p>
<p><img src="http://www.geeks3d.com/public/jegx/201003/dds_debugger_lod_1.jpg" alt="DDS debugging in GeeXLab"/><br/><i>Mipmap level 1</i></p>
<p><img src="http://www.geeks3d.com/public/jegx/201003/dds_debugger_lod_3.jpg" alt="DDS debugging in GeeXLab"/><br/><i>Mipmap level 3</i></p>
<p></center></p>
<p>And when you replace <b>texture2DLod</b> by <b>texture2D</b> in the fragment shader, you can see how OpenGL does the transition between two levels when you move the camera away the plane:<br />
<center></p>
<p><img src="http://www.geeks3d.com/public/jegx/201003/dds_debugger_01.jpg" alt="DDS debugging in GeeXLab"/></p>
<p><img src="http://www.geeks3d.com/public/jegx/201003/dds_debugger_02.jpg" alt="DDS debugging in GeeXLab"/></p>
<p><img src="http://www.geeks3d.com/public/jegx/201003/dds_debugger_03.jpg" alt="DDS debugging in GeeXLab"/></p>
<p></center></p>
<p>And depending on the point of view, you can see all mipmap levels in the same time:<br />
<center></p>
<p><img src="http://www.geeks3d.com/public/jegx/201003/mipmap_level_visualization.jpg" alt="DDS debugging in GeeXLab"/></p>
<p></center></p>
<p><br/><br/><br />
You can download the GeeXLab demo here<br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=127" title="Version 2010.03.11 downloaded 45 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download GXL - Mipmap level debugging demo Version 2010.03.11" /></a></p>
<p>You need the latest version of GeeXLab to play with the demo. You can download GeeXLab <a href="http://www.geeks3d.com/geexlab/">HERE</a>.</p>
<p>Just drop the <b>mipmap_debug.xml</b> into GeeXLab and you&#8217;re ready.</p>
<p>For this demo, I used <b>Lua</b> as scripting language so if you don&#8217;t have Python or don&#8217;t want to install it, just download the version of GeeXLab without Python.</p>
<p>Some links about mipmapping:</p>
<ul>
<li><a href="http://blogs.msdn.com/shawnhar/archive/2009/09/14/texture-filtering-mipmaps.aspx">Texture filtering: mipmaps</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ee422498%28VS.85%29.aspx">Texture Filtering with Mipmaps (Direct3D 9)</a></li>
<li><a href="http://en.wikipedia.org/wiki/Mipmap">Mipmap @ wikipedia</a></li>
</ul>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20091019/shader-library-bump-mapping-shader-with-multiple-lights-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Bump Mapping Shader with Multiple Lights (GLSL)'>[Shader Library] Bump Mapping Shader with Multiple Lights (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091112/shader-library-dream-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Dream Vision Post Processing Filter (GLSL)'>[Shader Library] Dream Vision Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] 2D Shockwave Post Processing Filter (GLSL)'>[Shader Library] 2D Shockwave Post Processing Filter (GLSL)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20100311/tips-mipmap-levels-debugging-with-a-dds-debug-texture/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[TEST] Hardware Tessellation on Radeon in OpenGL: Radeon HD 5000 Tessellators Details</title>
		<link>http://www.geeks3d.com/20100210/test-hardware-tessellation-on-radeon-in-opengl-radeon-hd-5000-tessellators-details/</link>
		<comments>http://www.geeks3d.com/20100210/test-hardware-tessellation-on-radeon-in-opengl-radeon-hd-5000-tessellators-details/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 08:57:53 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[GPU]]></category>
		<category><![CDATA[Game Development]]></category>
		<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[AMD]]></category>
		<category><![CDATA[direct3d 11]]></category>
		<category><![CDATA[evergreen]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[radeon]]></category>
		<category><![CDATA[radeon hd 5000]]></category>
		<category><![CDATA[tessellation]]></category>
		<category><![CDATA[tessellator]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=6929</guid>
		<description><![CDATA[



This short article brings some details to the first articles published yesterday about hardware tessellation on Radeon graphics cards:

[TEST] Hardware Tessellation on Radeon in OpenGL (Part 1/2) &#8211; Theory
[TEST] Hardware Tessellation on Radeon in OpenGL (Part 2/2) &#8211; Practice


AMD just provided me some clarification about the hardware tessellation on Radeon.
The main question in both first [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20100209/test-hardware-tessellation-on-radeon-in-opengl-part-12/' rel='bookmark' title='Permanent Link: [TEST] Hardware Tessellation on Radeon in OpenGL (Part 1/2)'>[TEST] Hardware Tessellation on Radeon in OpenGL (Part 1/2)</a></li>
<li><a href='http://www.geeks3d.com/20100211/amd-publishes-6-new-direct3d-10-and-11-demos-quick-test-and-new-details-about-tessellation/' rel='bookmark' title='Permanent Link: AMD Publishes 6 New Direct3D 10 and 11 Demos: Quick Test and New Details About Tessellation'>AMD Publishes 6 New Direct3D 10 and 11 Demos: Quick Test and New Details About Tessellation</a></li>
<li><a href='http://www.geeks3d.com/20100209/test-hardware-tessellation-on-radeon-in-opengl-part-22/' rel='bookmark' title='Permanent Link: [TEST] Hardware Tessellation on Radeon in OpenGL (Part 2/2)'>[TEST] Hardware Tessellation on Radeon in OpenGL (Part 2/2)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/gpu_tessellation_radeon.jpg" alt="GPU Tessellation on Radeon"/></p>
<p></center><br />
<span id="more-6929"></span></p>
<p>This short article brings some details to the first articles published yesterday about hardware tessellation on Radeon graphics cards:</p>
<ul>
<li><a href="http://www.geeks3d.com/20100209/test-hardware-tessellation-on-radeon-in-opengl-part-12/">[TEST] Hardware Tessellation on Radeon in OpenGL (Part 1/2) &#8211; Theory</a></li>
<li><a href="http://www.geeks3d.com/20100209/test-hardware-tessellation-on-radeon-in-opengl-part-22/">[TEST] Hardware Tessellation on Radeon in OpenGL (Part 2/2) &#8211; Practice</a></li>
</ul>
<p><br/><br/><br />
AMD just provided me some clarification about the hardware tessellation on Radeon.</p>
<p>The main question in both first articles was about the max value of the tessellation factor. </p>
<p>On Radeon HD 2000, 3000 and 4000, the hardware tessellation unit (called <b>tessellator</b>) has a <b>max tessellation factor of 15.0</b>. <b>This is a hardware limitation</b> that can&#8217;t be changed by software tweaks. The tessellator of Radeon HD 2000, 3000 and 4000 is a <b>fixed function unit</b> and we can&#8217;t program it with a shader. In OpenGL there are only two functions (described <a href="http://www.geeks3d.com/20100209/test-hardware-tessellation-on-radeon-in-opengl-part-12/">HERE</a>) that allow to control it.</p>
<p>On Radeon HD 5000 series (Evergreen family), things are different. The Radeon HD 5000 includes the fixed tessellator of HD 2000, 3000 and 4000 <b>AND</b> a new programmable tessellation unit. This <b>new programmable tessellation unit</b> will be exposed via a new OpenGL extension (available shortly). And this new extension will allow to exploit the maximum tessellation factor supported on HD 5000 graphics cards: <b>64.0</b>. And this value of 64.0 is forced by Direct3D 11 specification. So we&#8217;ll be able to do Direct3D11-like  tessellation in OpenGL shortly under all versions of Windows. Great news my friends <img src='http://www.geeks3d.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>On Evergreen family, both tessellation engines (fixed and programmable) are <b>physically separated</b>. </p>
<p>That&#8217;s why in the <a href="http://www.geeks3d.com/20100209/test-hardware-tessellation-on-radeon-in-opengl-part-22/">GeeXLab demo</a> I was limited to 15.0 on my HD 5770. Currently GeeXLab uses the fixed tessellator (with a factor limited to 15.0) and not the new tessellator (with a factor of 64.0).</p>
<p>I can&#8217;t wait to test the new tessellator in OpenGL and add this support in <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a>.</p>
<p>And good news, the support of the fixed tessellation unit will be kept in all new Radeon and Catalyst.</p>
<p>Thanks to AMD for this clarification <img src='http://www.geeks3d.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<hr/>
<b>Update (2010.02.12):</b><br />
The Radeon HD 5000 has two physically separated tessellation units: the old one (max factor of 15.0 – Radeon HD 2000, 3000, 4000 and 5000) and the new one (max factor of 64.0 – Radeon HD 5000 only). <b>In both cases, the hardware tessellator (or tessellation stage) is a fixed function</b>. The difference between both tessellation units is that in HD 5000 the tessellation stage is between new programmable stages (hull and domain) whereas in HD 2000, 3000 and 4000 the tessellation stage is alone.</p>
<p>References:</p>
<ul>
<li><a href="http://www.geeks3d.com/20100211/amd-publishes-6-new-direct3d-10-and-11-demos-quick-test-and-new-details-about-tessellation/">AMD Publishes 6 New Direct3D 10 and 11 Demos: Quick Test and New Details About Tessellation</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ee417841(VS.85).aspx">Tessellation Overview @ Microsoft DX11</a></li>
</ul>
<hr/>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20100209/test-hardware-tessellation-on-radeon-in-opengl-part-12/' rel='bookmark' title='Permanent Link: [TEST] Hardware Tessellation on Radeon in OpenGL (Part 1/2)'>[TEST] Hardware Tessellation on Radeon in OpenGL (Part 1/2)</a></li>
<li><a href='http://www.geeks3d.com/20100211/amd-publishes-6-new-direct3d-10-and-11-demos-quick-test-and-new-details-about-tessellation/' rel='bookmark' title='Permanent Link: AMD Publishes 6 New Direct3D 10 and 11 Demos: Quick Test and New Details About Tessellation'>AMD Publishes 6 New Direct3D 10 and 11 Demos: Quick Test and New Details About Tessellation</a></li>
<li><a href='http://www.geeks3d.com/20100209/test-hardware-tessellation-on-radeon-in-opengl-part-22/' rel='bookmark' title='Permanent Link: [TEST] Hardware Tessellation on Radeon in OpenGL (Part 2/2)'>[TEST] Hardware Tessellation on Radeon in OpenGL (Part 2/2)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20100210/test-hardware-tessellation-on-radeon-in-opengl-radeon-hd-5000-tessellators-details/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Atrium Sponza Palace Model Available in OBJ and 3ds Max Formats</title>
		<link>http://www.geeks3d.com/20100210/atrium-sponza-palace-model-available-in-obj-and-3ds-max-formats/</link>
		<comments>http://www.geeks3d.com/20100210/atrium-sponza-palace-model-available-in-obj-and-3ds-max-formats/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 07:54:33 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[Modeling]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[3ds max]]></category>
		<category><![CDATA[Atrium]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[obj]]></category>
		<category><![CDATA[sponza]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=6928</guid>
		<description><![CDATA[
Sponza model in GeeXLab


We can find on Crytek&#8217;s website an updated version of the famous Sponza model used in many global illumination tests like this one:



The model is available in OBJ and 3ds Max formats and all texture maps are provided.
You can download the Sponza model HERE.
Just for fun, I quickly tested the OBJ format [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20080513/3ds-max-tutorial-making-of-italian-creek/' rel='bookmark' title='Permanent Link: 3DS MAX Tutorial: Making of Italian Creek'>3DS MAX Tutorial: Making of Italian Creek</a></li>
<li><a href='http://www.geeks3d.com/20100224/physx-tool-convert-physics-scenes-into-an-obj-file-with-physx2obj/' rel='bookmark' title='Permanent Link: PhysX Tool: Convert Physics Scenes into an OBJ file with PhysX2Obj'>PhysX Tool: Convert Physics Scenes into an OBJ file with PhysX2Obj</a></li>
<li><a href='http://www.geeks3d.com/20100228/global-illumination-in-cryengine-3-tech-trailer/' rel='bookmark' title='Permanent Link: Global Illumination in CryEngine 3 Tech Trailer'>Global Illumination in CryEngine 3 Tech Trailer</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/sponza_model_geexlab.jpg" alt="Atrium Sponza Palace Model in GeeXLab"/><br/><i>Sponza model in GeeXLab</i></p>
<p></center><br />
<span id="more-6928"></span></p>
<p>We can find on Crytek&#8217;s website an updated version of the famous Sponza model used in many global illumination tests like this one:</p>
<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/sponza_global_illumination.jpg" alt="Atrium Sponza Palace Model  - global illumination"/></p>
<p></center></p>
<p>The model is available in OBJ and 3ds Max formats and all texture maps are provided.</p>
<p>You can download the Sponza model <a href="http://www.crytek.com/downloads/technology/">HERE</a>.</p>
<p>Just for fun, I quickly tested the OBJ format in <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a> with basic texturing and no lighting. I cleaned a little bit the material file to make relative the path to textures and also removed the Tr coefficient (transparency for GeeXLab).</p>
<p>When I&#8217;ll find a little time, I&#8217;ll try to improve the rendering by using the normal maps and other ambient maps (all available in the download).</p>
<p>According to GeeXLab, the OBJ version of Sponza model has <b>279,163 triangular faces</b>.</p>
<p><a href="http://www.realtimerendering.com/blog/7-things-for-february-9/">[via]</a></p>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20080513/3ds-max-tutorial-making-of-italian-creek/' rel='bookmark' title='Permanent Link: 3DS MAX Tutorial: Making of Italian Creek'>3DS MAX Tutorial: Making of Italian Creek</a></li>
<li><a href='http://www.geeks3d.com/20100224/physx-tool-convert-physics-scenes-into-an-obj-file-with-physx2obj/' rel='bookmark' title='Permanent Link: PhysX Tool: Convert Physics Scenes into an OBJ file with PhysX2Obj'>PhysX Tool: Convert Physics Scenes into an OBJ file with PhysX2Obj</a></li>
<li><a href='http://www.geeks3d.com/20100228/global-illumination-in-cryengine-3-tech-trailer/' rel='bookmark' title='Permanent Link: Global Illumination in CryEngine 3 Tech Trailer'>Global Illumination in CryEngine 3 Tech Trailer</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20100210/atrium-sponza-palace-model-available-in-obj-and-3ds-max-formats/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>[TEST] Hardware Tessellation on Radeon in OpenGL (Part 2/2)</title>
		<link>http://www.geeks3d.com/20100209/test-hardware-tessellation-on-radeon-in-opengl-part-22/</link>
		<comments>http://www.geeks3d.com/20100209/test-hardware-tessellation-on-radeon-in-opengl-part-22/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 15:52:31 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Test]]></category>
		<category><![CDATA[AMD]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[radeon hd 5000]]></category>
		<category><![CDATA[tessellation]]></category>
		<category><![CDATA[tessellator]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=6926</guid>
		<description><![CDATA[

Continuous tessellation &#8211; factor=15.0


This article is the second part of Hardware Tessellation on Radeon in OpenGL. The first part can be found HERE.

Update (2010.02.10): AMD provided me some important details about tessellation on Radeon. You can read these details HERE.


Tessellation on Radeon &#8211; Practice
I added the functionalities brought by GL_AMD_vertex_shader_tessellator in GeeXLab (in version 0.1.15) [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20100210/test-hardware-tessellation-on-radeon-in-opengl-radeon-hd-5000-tessellators-details/' rel='bookmark' title='Permanent Link: [TEST] Hardware Tessellation on Radeon in OpenGL: Radeon HD 5000 Tessellators Details'>[TEST] Hardware Tessellation on Radeon in OpenGL: Radeon HD 5000 Tessellators Details</a></li>
<li><a href='http://www.geeks3d.com/20100209/test-hardware-tessellation-on-radeon-in-opengl-part-12/' rel='bookmark' title='Permanent Link: [TEST] Hardware Tessellation on Radeon in OpenGL (Part 1/2)'>[TEST] Hardware Tessellation on Radeon in OpenGL (Part 1/2)</a></li>
<li><a href='http://www.geeks3d.com/20100211/amd-publishes-6-new-direct3d-10-and-11-demos-quick-test-and-new-details-about-tessellation/' rel='bookmark' title='Permanent Link: AMD Publishes 6 New Direct3D 10 and 11 Demos: Quick Test and New Details About Tessellation'>AMD Publishes 6 New Direct3D 10 and 11 Demos: Quick Test and New Details About Tessellation</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/gpu_tessellation_radeon.jpg" alt="GPU Tessellation on Radeon"/></p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/geexlab_amd_tessellation_demo_11.jpg" alt="AMD Tessellation Demo OpenGL - GeeXLab"/><br/>Continuous tessellation &#8211; factor=15.0</p>
<p></center><br />
<span id="more-6926"></span></p>
<p>This article is the <b>second part</b> of Hardware Tessellation on Radeon in OpenGL. The <b>first part</b> can be found <a href="">HERE</a>.</p>
<hr/>
<font color="#ff0000">Update (2010.02.10): <b>AMD provided me some important details about tessellation on Radeon</b>. You can read these details <a href="http://www.geeks3d.com/20100210/test-hardware-tessellation-on-radeon-in-opengl-radeon-hd-5000-tessellators-details/">HERE</a>.</font></p>
<hr/>
<p><br/></p>
<h2>Tessellation on Radeon &#8211; Practice</h2>
<p>I added the functionalities brought by <a href="http://www.opengl.org/registry/specs/AMD/vertex_shader_tessellator.txt">GL_AMD_vertex_shader_tessellator</a> in <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a> (in version <a href="http://www.geeks3d.com/20100209/geexlab-0-1-15-available/">0.1.15</a>) and coded a small demo that uses the shader given in the extension specification.</p>
<p>You can download the demo here<br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=124" title="Version 1.0 downloaded 392 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download GXL - AMD Tessellation Version 1.0" /></a></p>
<p>Just drop the demo in <a href="http://www.geeks3d.com/20100209/geexlab-0-1-15-available/">GeeXLab 0.1.15+</a>. That&#8217;s all.</p>
<p><br/><br/><br />
The demo is rather simple: a mesh plane is rendered (with VBO) in wireframe in order to see the impact of tessellation. </p>
<p>Here is the code of the shader used to render the mesh plane</p>
<pre>
[Vertex_Shader]
#extension GL_AMD_vertex_shader_tessellator : require
varying vec4 color;
__samplerVertexAMD VertexPosition; // 0
__samplerVertexAMD VertexColor; // 1
void main()
{
  vec4 gVertex = vec4(0.0);
  vec4 gColor = vec4(0.0);
  for (int i=0; i<3; i++)
  {
    float weight = gl_BarycentricCoord[i];
    gVertex += weight *
         vertexFetchAMD(VertexPosition, gl_VertexTriangleIndex[i]);

    gColor += weight *
         vertexFetchAMD(VertexColor, gl_VertexTriangleIndex[i]);
  }
  gl_Vertex = gVertex;
  color = gColor;
  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
[Pixel_Shader]
varying vec4 color;
void main (void)
{
  //gl_FragColor = color;
  gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}
</pre>
<p>This code works fine except the fetching of vertex color. Only the vertex position can be fetched. Color or normal fetching always returns the vector vec4(0.0, 0.0, 0.0, 0.0). A bug in GeeXLab? Maybe but after after many tests, I decided to download AMD's Catmull Clark Subdivision demo. It's an OpenGL demo that uses the tessellator. And same result: the color attribute can't be fetched.</p>
<p>So currently with <a href="http://www.geeks3d.com/20100128/ati-catalyst-10-1-whql-with-wrong-number-version/">Catalyst 10.1</a> only the vertex position can be fetched.</p>
<p>I tested the demo on a Radeon HD 5770. The Radeon HD 5770 is a DX11 card and I thought: cool I can increase the tessellation factor up to 64.0. Result: the max factor is 15.0. </p>
<p>Conclusion: <b>the tessellation amplication factor depends on the API used even if you have a DX11 hardware</b>. For DX9, DX10 and OpenGL 2, the tessellation factor<br />
is limited to 15.0. In Direct3D 11 the factor can be increased up to 64.0. And in OpenGL 3.0 ? I don't know yet. I have to code a small demo in GPU Caps Viewer for that. But I'll do it when all vertex attributes can be fetched.</p>
<p>The previous conclusion is valid at the time of the article writing. Maybe in a next release of Catalyst, AMD will allow a X64-tessellation factor for Radeon HD 5000 series.</p>
<p>Here are some screenshots forvarious tessellation factors:</p>
<h2>Discrete tessellation mode</h2>
<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/geexlab_amd_tessellation_demo_01.jpg" alt="AMD Tessellation Demo OpenGL - GeeXLab"/><br/>No tessellation</p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/geexlab_amd_tessellation_demo_02.jpg" alt="AMD Tessellation Demo OpenGL - GeeXLab"/><br/>Tessellation - factor=1.0</p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/geexlab_amd_tessellation_demo_03.jpg" alt="AMD Tessellation Demo OpenGL - GeeXLab"/><br/>Tessellation - factor=2.0</p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/geexlab_amd_tessellation_demo_04.jpg" alt="AMD Tessellation Demo OpenGL - GeeXLab"/><br/>Tessellation - factor=5.0</p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/geexlab_amd_tessellation_demo_05.jpg" alt="AMD Tessellation Demo OpenGL - GeeXLab"/><br/>Tessellation - factor=10.0</p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/geexlab_amd_tessellation_demo_06.jpg" alt="AMD Tessellation Demo OpenGL - GeeXLab"/><br/>Tessellation - factor=15.0</p>
<p></center></p>
<p><br/></p>
<h2>Continuous tessellation mode</h2>
<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/geexlab_amd_tessellation_demo_07.jpg" alt="AMD Tessellation Demo OpenGL - GeeXLab"/><br/>Continuous tessellation - factor=1.0</p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/geexlab_amd_tessellation_demo_08.jpg" alt="AMD Tessellation Demo OpenGL - GeeXLab"/><br/>Continuous tessellation - factor=1.2</p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/geexlab_amd_tessellation_demo_09.jpg" alt="AMD Tessellation Demo OpenGL - GeeXLab"/><br/>Continuous tessellation - factor=1.8</p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/geexlab_amd_tessellation_demo_10.jpg" alt="AMD Tessellation Demo OpenGL - GeeXLab"/><br/>Continuous tessellation - factor=4.5</p>
<p><img src="http://www.geeks3d.com/public/jegx/201002/geexlab_amd_tessellation_demo_11.jpg" alt="AMD Tessellation Demo OpenGL - GeeXLab"/><br/>Continuous tessellation - factor=15.0</p>
<p></center></p>
<p>These examples show us one limitation: to get a highly tessellated mesh, the coarse mesh (also called <b>control cage</b> or <b>superprimitive mesh</b>) must have enough polygons to generate the desired high-resolution mesh.</p>
<p>As soon as the fetching of all vertex attributes is okay, I'll code a displacement mapping demo with real time tessellation....</p>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20100210/test-hardware-tessellation-on-radeon-in-opengl-radeon-hd-5000-tessellators-details/' rel='bookmark' title='Permanent Link: [TEST] Hardware Tessellation on Radeon in OpenGL: Radeon HD 5000 Tessellators Details'>[TEST] Hardware Tessellation on Radeon in OpenGL: Radeon HD 5000 Tessellators Details</a></li>
<li><a href='http://www.geeks3d.com/20100209/test-hardware-tessellation-on-radeon-in-opengl-part-12/' rel='bookmark' title='Permanent Link: [TEST] Hardware Tessellation on Radeon in OpenGL (Part 1/2)'>[TEST] Hardware Tessellation on Radeon in OpenGL (Part 1/2)</a></li>
<li><a href='http://www.geeks3d.com/20100211/amd-publishes-6-new-direct3d-10-and-11-demos-quick-test-and-new-details-about-tessellation/' rel='bookmark' title='Permanent Link: AMD Publishes 6 New Direct3D 10 and 11 Demos: Quick Test and New Details About Tessellation'>AMD Publishes 6 New Direct3D 10 and 11 Demos: Quick Test and New Details About Tessellation</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20100209/test-hardware-tessellation-on-radeon-in-opengl-part-22/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>GeeXLab 0.1.15 Available</title>
		<link>http://www.geeks3d.com/20100209/geexlab-0-1-15-available/</link>
		<comments>http://www.geeks3d.com/20100209/geexlab-0-1-15-available/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 14:06:18 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[3d programming]]></category>
		<category><![CDATA[AMD]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[tessellation]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=6924</guid>
		<description><![CDATA[



A new update of GeeXLab is available. No big new feature in this release except two functions (available in Lua and Python APIs) for playing with AMD hardware tessellation unit. I will detail tessellation in the next post with a GeeXLab demo&#8230;
The Python version of GeeXLab has been compiled with the latest Python 2.6.4. 
And [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20091116/geexlab-0-1-14-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.14 Available'>GeeXLab 0.1.14 Available</a></li>
<li><a href='http://www.geeks3d.com/20091027/geexlab-0-1-13-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.13 Available'>GeeXLab 0.1.13 Available</a></li>
<li><a href='http://www.geeks3d.com/20091012/geexlab-0-1-12-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.12 Available'>GeeXLab 0.1.12 Available</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/common/geexlab_logo.jpg" alt="GeeXLab - 3D programming - OpenGL - Lua - Python"/></p>
<p></center><br />
<span id="more-6924"></span><br />
A new update of <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a> is available. No big new feature in this release except two functions (available in <b>Lua</b> and <b>Python</b> APIs) for playing with <b>AMD hardware tessellation</b> unit. I will detail tessellation in the next post with a GeeXLab demo&#8230;</p>
<p>The Python version of GeeXLab has been compiled with the latest <a href="http://python.org/ftp/python/2.6.4/python-2.6.4.msi">Python 2.6.4</a>. </p>
<p>And stay tuned, new versions of <b>GeeXLab</b> are planned shortly with <b>PhysX</b> update, <b>OpenCTM</b> support and other cool things&#8230; </p>
<p>As usual, GeeXLab is available in two versions: one with Python and Lua and the other with Lua only.</p>
<p><b>DOWNLOAD</b>: GeeXLab 0.1.15 full (Python + Lua)<br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=122" title="Version 0.1.15 downloaded 473 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download GeeXLab 0.1.15 Version 0.1.15" /></a><br />
<br/><br/><br />
<b>DOWNLOAD</b>: GeeXLab 0.1.15 no Python<br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=123" title="Version 0.1.15 downloaded 189 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download GeeXLab 0.1.15 No Python Version 0.1.15" /></a></p>
<p><br/><br />
<b>Changelog:</b></p>
<ul>
<li>New: added AMDSetTessellationFactor() and AMDSetTessellationMode() to HYP_Renderer lib (Lua / Python).</li>
<li>New: added GetFaceMaterialIndex() and GetFaceMaterialId() to HYP_Mesh (Python / Lua).</li>
<li>New: added Translate() to Python version of HYP_Object.</li>
<li>New: added export_pack_source_code attribute in script node to force the export of script source code to binary scene. By default if a script is not embedded in XML, the script file is not packed in binary scene file.</li>
<li>Change: updated with Python 2.6.4</li>
<li>Bugfix: in HYP_Utils.SetDrawVertexNormalLengthFactor() in Python. Length was processed by an integer leading to very large factors.</li>
<li>Bugfix: in the W4K loader when there were several materials per mesh.</li>
</ul>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20091116/geexlab-0-1-14-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.14 Available'>GeeXLab 0.1.14 Available</a></li>
<li><a href='http://www.geeks3d.com/20091027/geexlab-0-1-13-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.13 Available'>GeeXLab 0.1.13 Available</a></li>
<li><a href='http://www.geeks3d.com/20091012/geexlab-0-1-12-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.12 Available'>GeeXLab 0.1.12 Available</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20100209/geexlab-0-1-15-available/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Night Vision Post Processing Shader in Blender Game Engine</title>
		<link>http://www.geeks3d.com/20100119/night-vision-post-processing-shader-in-blender-game-engine/</link>
		<comments>http://www.geeks3d.com/20100119/night-vision-post-processing-shader-in-blender-game-engine/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 16:57:25 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[Blender]]></category>
		<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[game engine]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[glsl]]></category>
		<category><![CDATA[night vision]]></category>
		<category><![CDATA[shader]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=6727</guid>
		<description><![CDATA[



The night vision post processing effect I developed for GeeXLab has been ported to Blender Game Engine by a Blender user called Letun.  I tested Letun&#8217;s work on Blender 2.49a and the demo works fine. 
Remark: For the sake of speed rendering, the night vision effect is not used  as a post processing [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20091009/shader-library-night-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Night Vision Post Processing Filter (GLSL)'>[Shader Library] Night Vision Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091112/shader-library-dream-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Dream Vision Post Processing Filter (GLSL)'>[Shader Library] Dream Vision Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091027/shader-library-posterization-post-processing-effect-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Posterization Post Processing Effect (GLSL)'>[Shader Library] Posterization Post Processing Effect (GLSL)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/201001/night_vision_blender_game_engine.jpg" alt="Night Vision Shader in Blender Game Engine"/></p>
<p></center><br />
<span id="more-6727"></span></p>
<p>The <a href="http://www.geeks3d.com/20091009/shader-library-night-vision-post-processing-filter-glsl/">night vision post processing effect</a> I developed for <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a> has been ported to <b>Blender Game Engine</b> by a Blender user called Letun.  I tested Letun&#8217;s work on <a href="http://www.geeks3d.com/20090623/blender-2-49a-is-out/">Blender 2.49a</a> and the demo works fine. </p>
<p><i>Remark: For the sake of speed rendering, the night vision effect is not used  as a post processing filter over the final image. Rather, the shader is executed on a per-object basis (see the variable ShaderObjects).</i></p>
<p>You can find more details <a href="http://blenderartists.org/forum/showthread.php?t=176422">HERE</a>.</p>
<p>If you don&#8217;t have an account on blenderartists.org&#8217;s forums, you can grab the blend file right here:<br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=120" title=" downloaded 107 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download Night Vision Shader for Blender Game Engine " /></a></p>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20091009/shader-library-night-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Night Vision Post Processing Filter (GLSL)'>[Shader Library] Night Vision Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091112/shader-library-dream-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Dream Vision Post Processing Filter (GLSL)'>[Shader Library] Dream Vision Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091027/shader-library-posterization-post-processing-effect-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Posterization Post Processing Effect (GLSL)'>[Shader Library] Posterization Post Processing Effect (GLSL)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20100119/night-vision-post-processing-shader-in-blender-game-engine/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>[TIPS] How To Know If a PhysX Application Uses PhysX GPU</title>
		<link>http://www.geeks3d.com/20091126/how-to-know-if-a-physx-application-uses-physx-gpu/</link>
		<comments>http://www.geeks3d.com/20091126/how-to-know-if-a-physx-application-uses-physx-gpu/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 15:26:18 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[NVIDIA PhysX]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[195.62]]></category>
		<category><![CDATA[fluidmark]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[physx]]></category>
		<category><![CDATA[physx visual indicator]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=6227</guid>
		<description><![CDATA[




This is a little trick to know if a PhysX application is running with software PhysX or GPU PhysX. 
With NVIDIA&#8217;s display drivers R195.xx like the latest R195.62 WHQL, just open the NVIDIA Control Panel and you&#8217;ll find in the 3D Settings menu bar item, the PhysX Visual Indicator ON/OFF.



If the application uses PhysX GPU, you [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20091105/physx-visual-debugger-1-1-8-available/' rel='bookmark' title='Permanent Link: PhysX Visual Debugger 1.1.8 Available'>PhysX Visual Debugger 1.1.8 Available</a></li>
<li><a href='http://www.geeks3d.com/20100311/tips-mipmap-levels-debugging-with-a-dds-debug-texture/' rel='bookmark' title='Permanent Link: [TIPS] Mipmap Levels Debugging with a DDS Debug Texture'>[TIPS] Mipmap Levels Debugging with a DDS Debug Texture</a></li>
<li><a href='http://www.geeks3d.com/20090804/nvidia-application-acceleration-engines-optix-scenix-complex-and-physx-64/' rel='bookmark' title='Permanent Link: NVIDIA Application Acceleration Engines: OptiX, SceniX, CompleX and PhysX 64'>NVIDIA Application Acceleration Engines: OptiX, SceniX, CompleX and PhysX 64</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200911/fluidmark_physx_visual_indicator_01.jpg" alt="PhysX Visual Indicator"/></p>
<p><img src="http://www.geeks3d.com/public/jegx/200911/fluidmark_physx_visual_indicator_02.jpg" alt="PhysX Visual Indicator"/></p>
<p></center><br />
<span id="more-6227"></span><br />
This is a little trick to know if a PhysX application is running with software PhysX or GPU PhysX. </p>
<p>With NVIDIA&#8217;s display drivers R195.xx like the latest <a href="http://www.geeks3d.com/20091126/nvidia-forceware-195-62-whql/">R195.62 WHQL</a>, just open the NVIDIA Control Panel and you&#8217;ll find in the 3D Settings menu bar item, the <b>PhysX Visual Indicator</b> ON/OFF.<br />
<center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200911/enable_physx_visual_indicator.jpg" alt="PhysX Visual Indicator"/></p>
<p></center></p>
<p>If the application uses PhysX GPU, you will see <b>PhysX &gt; GPU</b> otherwise you&#8217;ll see <b>PhysX &gt; CPU</b> like in the <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a> simple PhysX demo:<br />
<center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200911/physx_visual_indicator_geexlab.jpg" alt="PhysX Visual Indicator - GeeXLab"/></p>
<p></center><br />
I will look at GeeXLab code if everything is ok because PhysX CPU is not normal&#8230;<br />
This functionality seems to be useful to developers <img src='http://www.geeks3d.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20091105/physx-visual-debugger-1-1-8-available/' rel='bookmark' title='Permanent Link: PhysX Visual Debugger 1.1.8 Available'>PhysX Visual Debugger 1.1.8 Available</a></li>
<li><a href='http://www.geeks3d.com/20100311/tips-mipmap-levels-debugging-with-a-dds-debug-texture/' rel='bookmark' title='Permanent Link: [TIPS] Mipmap Levels Debugging with a DDS Debug Texture'>[TIPS] Mipmap Levels Debugging with a DDS Debug Texture</a></li>
<li><a href='http://www.geeks3d.com/20090804/nvidia-application-acceleration-engines-optix-scenix-complex-and-physx-64/' rel='bookmark' title='Permanent Link: NVIDIA Application Acceleration Engines: OptiX, SceniX, CompleX and PhysX 64'>NVIDIA Application Acceleration Engines: OptiX, SceniX, CompleX and PhysX 64</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20091126/how-to-know-if-a-physx-application-uses-physx-gpu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>[Shader Library] 2D Shockwave Post Processing Filter (GLSL)</title>
		<link>http://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/</link>
		<comments>http://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 21:41:09 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[Post Processing]]></category>
		<category><![CDATA[2d shockwave]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[glsl]]></category>
		<category><![CDATA[post processing]]></category>
		<category><![CDATA[shader library]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=6140</guid>
		<description><![CDATA[




Geeks3D&#8217;s shader library is available in HERE.

This new shader shows a 2D shockwave post processing effect. In the GeeXLab demo, just hit the [K] key to create a shockwave at the mouse position. I found the original shader here.
You can download the demo here:
This demo requires GeeXLab and does not use Python so you can [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20091112/shader-library-dream-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Dream Vision Post Processing Filter (GLSL)'>[Shader Library] Dream Vision Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091020/shader-library-lens-circle-post-processing-effect-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Lens Circle Post Processing Effect (GLSL)'>[Shader Library] Lens Circle Post Processing Effect (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091009/shader-library-night-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Night Vision Post Processing Filter (GLSL)'>[Shader Library] Night Vision Post Processing Filter (GLSL)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200911/postfx_2d_shockwave.jpg" alt="Shader Library - 2D Shockwave PostFX"/></p>
<p></center><br />
<span id="more-6140"></span></p>
<hr/>
Geeks3D&#8217;s shader library is available in <a href="http://www.geeks3d.com/geexlab/shader_library.php">HERE</a>.</p>
<hr/>
<p>This new shader shows a <b>2D shockwave</b> post processing effect. In the GeeXLab demo, just hit the [K] key to create a shockwave at the mouse position. I found the original shader <a href="http://empire-defense.crystalin.fr/blog/2d_shock_wave_texture_with_shader">here</a>.</p>
<p>You can download the demo here:<br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=110" title=" downloaded 331 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download GXL - 2D Shockwave PostFX " /></a><br />
This demo requires <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a> and does not use Python so you can use the version of GeeXLab without Python. This demo has been tested with <a href="http://www.geeks3d.com/20091116/geexlab-0-1-14-available/">GeeXLab 0.1.14</a>.</p>
<p>Unzip the source code somewhere, start GeeXLab and drop the 2D_Shockwave_Demo.xml file in GeeXLab.</p>
<p>Here is a video of the effect in action (the 2d grid has been added to better visualize the shockwave effect):<br />
<center><br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/8emVKwiWbOY&#038;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed src="http://www.youtube.com/v/8emVKwiWbOY&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br />
</center></p>
<p><u><b>Shader desription</b></u></p>
<p><b>Language</b>: OpenGL 2 &#8211; GLSL</p>
<p><b>Type</b>: Post processing filter.</p>
<p><b>Inputs</b></p>
<ul>
<li>sceneTex (sampler2D): the final scene image.</li>
<li>center (vec2): mouse position (in texture coord space: [0 ; 1]).</li>
<li>time (float): shockwave elapsed time in second.</li>
<li>shockParams (vec3): shockwave parameters</li>
</ul>
<p><b>Ouputs</b>: color buffer</p>
<pre>
[Vertex_Shader]
void main(void)
{
  gl_Position = ftransform();
  gl_TexCoord[0] = gl_MultiTexCoord0;
}

[Pixel_Shader]
uniform sampler2D sceneTex; // 0
uniform vec2 center; // Mouse position
uniform float time; // effect elapsed time
uniform vec3 shockParams; // 10.0, 0.8, 0.1
void main()
{
  vec2 uv = gl_TexCoord[0].xy;
  vec2 texCoord = uv;
  float distance = distance(uv, center);
  if ( (distance <= (time + shockParams.z)) &#038;&#038;
       (distance >= (time - shockParams.z)) )
  {
    float diff = (distance - time);
    float powDiff = 1.0 - pow(abs(diff*shockParams.x),
                                shockParams.y);
    float diffTime = diff  * powDiff;
    vec2 diffUV = normalize(uv - center);
    texCoord = uv + (diffUV * diffTime);
  }
  gl_FragColor = texture2D(sceneTex, texCoord);
}
</pre>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20091112/shader-library-dream-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Dream Vision Post Processing Filter (GLSL)'>[Shader Library] Dream Vision Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091020/shader-library-lens-circle-post-processing-effect-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Lens Circle Post Processing Effect (GLSL)'>[Shader Library] Lens Circle Post Processing Effect (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091009/shader-library-night-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Night Vision Post Processing Filter (GLSL)'>[Shader Library] Night Vision Post Processing Filter (GLSL)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[GeeXLab] Discover your Future with YI QING</title>
		<link>http://www.geeks3d.com/20091116/geexlab-discover-your-future-with-yi-qing/</link>
		<comments>http://www.geeks3d.com/20091116/geexlab-discover-your-future-with-yi-qing/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 14:22:53 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[Video Games]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[physx]]></category>
		<category><![CDATA[video game]]></category>
		<category><![CDATA[yi king]]></category>
		<category><![CDATA[yi qing]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=6131</guid>
		<description><![CDATA[



Springer has released a small video game made with GeeXLab. This game a is simplified YI King simulation. The Yi King is an ancient Chinese system of divination. Press the SPACE key to throw two sticks and discovering your future!
A video is available here.
You can download this demo / game here:
The code source is included [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20091022/geexlab-yi-king-video-game-preview/' rel='bookmark' title='Permanent Link: [GeeXLab] YI King Video Game Preview'>[GeeXLab] YI King Video Game Preview</a></li>
<li><a href='http://www.geeks3d.com/20091027/geexlab-0-1-13-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.13 Available'>GeeXLab 0.1.13 Available</a></li>
<li><a href='http://www.geeks3d.com/20100209/geexlab-0-1-15-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.15 Available'>GeeXLab 0.1.15 Available</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200911/geexlab_yiqing_01.jpg" alt="GeeXLab - YIQING Game"/></p>
<p></center><br />
<span id="more-6131"></span><br />
<a href="http://www.bifurcations.fr">Springer</a> has released a small video game made with <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a>. This game a is simplified YI King simulation. The Yi King is an ancient Chinese system of divination. Press the SPACE key to throw two sticks and discovering your future!</p>
<p>A video is available <a href="http://www.geeks3d.com/20091022/geexlab-yi-king-video-game-preview/">here</a>.</p>
<p>You can download this demo / game here:<br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=113" title="Version Ver. 20091116 downloaded 102 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download GXL - YIQING demo Version Ver. 20091116" /></a></p>
<p>The code source is included and the main source code file is YIQING_GXL.xml. Scripting is done with Lua and PhysX is used for the fall of the two sticks.</p>
<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200911/geexlab_yiqing_02.jpg" alt="GeeXLab - YIQING Game"/></p>
<p></center></p>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20091022/geexlab-yi-king-video-game-preview/' rel='bookmark' title='Permanent Link: [GeeXLab] YI King Video Game Preview'>[GeeXLab] YI King Video Game Preview</a></li>
<li><a href='http://www.geeks3d.com/20091027/geexlab-0-1-13-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.13 Available'>GeeXLab 0.1.13 Available</a></li>
<li><a href='http://www.geeks3d.com/20100209/geexlab-0-1-15-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.15 Available'>GeeXLab 0.1.15 Available</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20091116/geexlab-discover-your-future-with-yi-qing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GeeXLab 0.1.14 Available</title>
		<link>http://www.geeks3d.com/20091116/geexlab-0-1-14-available/</link>
		<comments>http://www.geeks3d.com/20091116/geexlab-0-1-14-available/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 11:11:08 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[3d programming]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[glsl]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=6127</guid>
		<description><![CDATA[



A new update of GeeXLab is available. I did some minor changes in the management of windowed and fullscreen modes. 
As usual, GeeXLab is available in two versions: one with Python and Lua and the other with Lua only.
DOWNLOAD: GeeXLab 0.1.14 full (Python + Lua)
DOWNLOAD: GeeXLab 0.1.14 NO PYTHON
ChangeLog:

New: added float_depth_buffer attribute to shadow_mapping element [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20100209/geexlab-0-1-15-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.15 Available'>GeeXLab 0.1.15 Available</a></li>
<li><a href='http://www.geeks3d.com/20091027/geexlab-0-1-13-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.13 Available'>GeeXLab 0.1.13 Available</a></li>
<li><a href='http://www.geeks3d.com/20091009/geexlab-0-1-11-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.11 Available'>GeeXLab 0.1.11 Available</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/common/geexlab_logo.jpg" alt="GeeXLab"/></p>
<p></center><br />
<span id="more-6127"></span><br />
A new update of <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a> is available. I did some minor changes in the management of windowed and fullscreen modes. </p>
<p>As usual, GeeXLab is available in two versions: one with Python and Lua and the other with Lua only.</p>
<p>DOWNLOAD: GeeXLab 0.1.14 full (Python + Lua)<br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=111" title="Version 0.1.14 downloaded 644 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download GeeXLab 0.1.14 Version 0.1.14" /></a></p>
<p>DOWNLOAD: GeeXLab 0.1.14 NO PYTHON<br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=112" title="Version 0.1.14 downloaded 327 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download GeeXLab 0.1.14 No Python Version 0.1.14" /></a></p>
<p><b>ChangeLog:</b></p>
<ul>
<li>New: added float_depth_buffer attribute to shadow_mapping element of scene node.<br />
Setting this attribute to TRUE allows to use a 32-bit floating point depth buffer for shadow mapping.</li>
<li>Change: modified fullscreen management (now available in the free version).</li>
<li>Change: update Freeimage and OpenAL plugins with latest versions of respective libraries.</li>
</ul>
<p>I take advantage of this post to show the WIP of a <a href="http://www.geeks3d.com/forums/index.php/topic,733.0.html">space shooter</a>:<br />
<center><br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/DDQe46Imcas&#038;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed src="http://www.youtube.com/v/DDQe46Imcas&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br />
</center></p>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20100209/geexlab-0-1-15-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.15 Available'>GeeXLab 0.1.15 Available</a></li>
<li><a href='http://www.geeks3d.com/20091027/geexlab-0-1-13-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.13 Available'>GeeXLab 0.1.13 Available</a></li>
<li><a href='http://www.geeks3d.com/20091009/geexlab-0-1-11-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.11 Available'>GeeXLab 0.1.11 Available</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20091116/geexlab-0-1-14-available/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[GeeXLab] Twitter and PhysX</title>
		<link>http://www.geeks3d.com/20091114/geexlab-twitter-and-physx/</link>
		<comments>http://www.geeks3d.com/20091114/geexlab-twitter-and-physx/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 13:55:45 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[physx]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=6122</guid>
		<description><![CDATA[



Some PhysX tests with Twitter Python API in GeeXLab. Each tweet falling is bound to a PhysX actor. 





Related posts:GeeXLab 0.1.15 Available
GeeXLab 0.1.12 Available
GeeXLab 0.1.11 Available



Related posts:<ol><li><a href='http://www.geeks3d.com/20100209/geexlab-0-1-15-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.15 Available'>GeeXLab 0.1.15 Available</a></li>
<li><a href='http://www.geeks3d.com/20091012/geexlab-0-1-12-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.12 Available'>GeeXLab 0.1.12 Available</a></li>
<li><a href='http://www.geeks3d.com/20091009/geexlab-0-1-11-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.11 Available'>GeeXLab 0.1.11 Available</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center><br />
<object width="400" height="245"><param name="movie" value="http://www.dailymotion.com/swf/xb4j2i"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.dailymotion.com/swf/xb4j2i" type="application/x-shockwave-flash" width="400" height="245" allowfullscreen="true" allowscriptaccess="always"></embed></object><br />
</center><br />
<span id="more-6122"></span><br />
Some <b>PhysX</b> tests with <b>Twitter Python API</b> in <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a>. Each tweet falling is bound to a PhysX actor. </p>
<p><center><br />
<object width="480" height="245"><param name="movie" value="http://www.dailymotion.com/swf/xb1u2c&#038;related=0"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.dailymotion.com/swf/xb1u2c&#038;related=0" type="application/x-shockwave-flash" width="400" height="245" allowfullscreen="true" allowscriptaccess="always"></embed></object><br />
</center></p>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20100209/geexlab-0-1-15-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.15 Available'>GeeXLab 0.1.15 Available</a></li>
<li><a href='http://www.geeks3d.com/20091012/geexlab-0-1-12-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.12 Available'>GeeXLab 0.1.12 Available</a></li>
<li><a href='http://www.geeks3d.com/20091009/geexlab-0-1-11-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.11 Available'>GeeXLab 0.1.11 Available</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20091114/geexlab-twitter-and-physx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Shader Library] Dream Vision Post Processing Filter (GLSL)</title>
		<link>http://www.geeks3d.com/20091112/shader-library-dream-vision-post-processing-filter-glsl/</link>
		<comments>http://www.geeks3d.com/20091112/shader-library-dream-vision-post-processing-filter-glsl/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 13:57:22 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[Post Processing]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[glsl]]></category>
		<category><![CDATA[post processing]]></category>
		<category><![CDATA[shader library]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=6113</guid>
		<description><![CDATA[



This new shader, from Geeks3D&#8217;s shader library, shows the kind of vision one may have in a dream&#8230;
You can grab the GLSL shader and the demo here:
This demo requires GeeXLab and does not use Python so you can use the version of GeeXLab without Python.
Unzip the source code somewhere, start GeeXLab and drop the file [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20091009/shader-library-night-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Night Vision Post Processing Filter (GLSL)'>[Shader Library] Night Vision Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] 2D Shockwave Post Processing Filter (GLSL)'>[Shader Library] 2D Shockwave Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091020/shader-library-lens-circle-post-processing-effect-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Lens Circle Post Processing Effect (GLSL)'>[Shader Library] Lens Circle Post Processing Effect (GLSL)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200911/postfx_dream_vision.jpg" alt="Shader Library - Dream Vision PostFX"/></p>
<p></center><br />
<span id="more-6113"></span><br />
This new shader, from <a href="http://www.geeks3d.com/geexlab/shader_library.php">Geeks3D&#8217;s shader library</a>, shows the kind of vision one may have in a dream&#8230;</p>
<p>You can grab the GLSL shader and the demo here:<br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=109" title=" downloaded 226 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download GXL - Dream Vision PostFX " /></a><br />
This demo requires <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a> and does not use Python so you can use the version of GeeXLab without Python.</p>
<p>Unzip the source code somewhere, start GeeXLab and drop the file Dream_Vision_Demo.xml in GeeXLab.</p>
<p><u><b>Shader desription</b></u></p>
<p><b>Language</b>: OpenGL 2 &#8211; GLSL</p>
<p><b>Type</b>: Post processing filter.</p>
<p><b>Inputs</b></p>
<ul>
<li>sceneTex (sampler2D): the final scene image.</li>
</ul>
<p><b>Ouputs</b>: color buffer</p>
<p><b>Shader code</b>:</p>
<pre>
[Vertex_Shader]
void main()
{
  gl_Position = ftransform();
  gl_TexCoord[0] = gl_MultiTexCoord0;
}
[Pixel_Shader]
uniform sampler2D sceneTex; // 0
void main ()
{
  vec2 uv = gl_TexCoord[0].xy;
  vec4 c = texture2D(sceneTex, uv);

  c += texture2D(sceneTex, uv+0.001);
  c += texture2D(sceneTex, uv+0.003);
  c += texture2D(sceneTex, uv+0.005);
  c += texture2D(sceneTex, uv+0.007);
  c += texture2D(sceneTex, uv+0.009);
  c += texture2D(sceneTex, uv+0.011);

  c += texture2D(sceneTex, uv-0.001);
  c += texture2D(sceneTex, uv-0.003);
  c += texture2D(sceneTex, uv-0.005);
  c += texture2D(sceneTex, uv-0.007);
  c += texture2D(sceneTex, uv-0.009);
  c += texture2D(sceneTex, uv-0.011);

  c.rgb = vec3((c.r+c.g+c.b)/3.0);
  c = c / 9.5;
  gl_FragColor = c;
}
</pre>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20091009/shader-library-night-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Night Vision Post Processing Filter (GLSL)'>[Shader Library] Night Vision Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] 2D Shockwave Post Processing Filter (GLSL)'>[Shader Library] 2D Shockwave Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091020/shader-library-lens-circle-post-processing-effect-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Lens Circle Post Processing Effect (GLSL)'>[Shader Library] Lens Circle Post Processing Effect (GLSL)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20091112/shader-library-dream-vision-post-processing-filter-glsl/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PhysX Visual Debugger 1.1.8 Available</title>
		<link>http://www.geeks3d.com/20091105/physx-visual-debugger-1-1-8-available/</link>
		<comments>http://www.geeks3d.com/20091105/physx-visual-debugger-1-1-8-available/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 10:28:08 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[NVIDIA PhysX]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[physx]]></category>
		<category><![CDATA[physx visual debugger]]></category>
		<category><![CDATA[pvd]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=6036</guid>
		<description><![CDATA[



NVIDIA has released the new version of PhysX Visual Debugger (or PVD), the tool that allows you to visualize, debug, and interact with your PhysX based application.
I just tried this new version with GeeXLab. You can&#8217;t debug the first PhysX based app you have with PVD. The application must have an instruction to connect itself [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20091126/how-to-know-if-a-physx-application-uses-physx-gpu/' rel='bookmark' title='Permanent Link: [TIPS] How To Know If a PhysX Application Uses PhysX GPU'>[TIPS] How To Know If a PhysX Application Uses PhysX GPU</a></li>
<li><a href='http://www.geeks3d.com/20100209/geexlab-0-1-15-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.15 Available'>GeeXLab 0.1.15 Available</a></li>
<li><a href='http://www.geeks3d.com/20080807/nvidia-geforce-physx-performances-tests/' rel='bookmark' title='Permanent Link: NVIDIA GeForce PhysX Performances Tests'>NVIDIA GeForce PhysX Performances Tests</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200911/physx_visual_debugger_geexlab_01.jpg" alt="NVIDIA PhysX Visual Debugger"/></p>
<p></center><br />
<span id="more-6036"></span><br />
NVIDIA has released the new version of <a href="http://developer.nvidia.com/object/pvd_home.html">PhysX Visual Debugger</a> (or PVD), the tool that allows you to visualize, debug, and interact with your <b>PhysX</b> based application.</p>
<p>I just tried this new version with <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a>. You can&#8217;t debug the first PhysX based app you have with PVD. The application must have an instruction to connect itself to PVD. <b>GeeXLab</b> offers such a functionality. I took the <a href="http://www.geeks3d.com/geexlab/code_samples.php#demo_physx_joint_revolute">PhysX revolute joints demo</a> and I added the <a href="http://www.geeks3d.com/geexlab/scripting_physx.php#ConnectToVisualPhysXDebugger">HYP_PhysX.ConnectToVisualPhysXDebugger()</a> instruction in the init script. Then I launched  PVD, started GeeXLab, dropped the demo in GeeXLab and I was able to visualize and step inside the PhysX demo in PVD <img src='http://www.geeks3d.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200911/physx_visual_debugger_geexlab_02.jpg" alt="GeeXLab PhysX demo"/></p>
<p></center></p>
<p><a href="http://physxinfo.com/news/730/physx-visual-debugger-1-1-8-released/">[via]</a></p>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20091126/how-to-know-if-a-physx-application-uses-physx-gpu/' rel='bookmark' title='Permanent Link: [TIPS] How To Know If a PhysX Application Uses PhysX GPU'>[TIPS] How To Know If a PhysX Application Uses PhysX GPU</a></li>
<li><a href='http://www.geeks3d.com/20100209/geexlab-0-1-15-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.15 Available'>GeeXLab 0.1.15 Available</a></li>
<li><a href='http://www.geeks3d.com/20080807/nvidia-geforce-physx-performances-tests/' rel='bookmark' title='Permanent Link: NVIDIA GeForce PhysX Performances Tests'>NVIDIA GeForce PhysX Performances Tests</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20091105/physx-visual-debugger-1-1-8-available/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[GeeXLab] Shadow Mapping and Large Depth Map on Radeon HD 5770</title>
		<link>http://www.geeks3d.com/20091028/geexlab-shadow-mapping-and-large-depth-map-on-radeon-hd-5770/</link>
		<comments>http://www.geeks3d.com/20091028/geexlab-shadow-mapping-and-large-depth-map-on-radeon-hd-5770/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 15:38:36 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Test]]></category>
		<category><![CDATA[csm]]></category>
		<category><![CDATA[depth map]]></category>
		<category><![CDATA[fetch4]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[pcf]]></category>
		<category><![CDATA[radeon hd 5770]]></category>
		<category><![CDATA[Shadow Mapping]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=5928</guid>
		<description><![CDATA[



While updating GPU Caps Viewer (available very soon), I saw the max texture size for Radeon HD 5770 (and HD 5870 as well) is 16k or 16384&#215;16384. I said wow! In the previous generation of Radeon and in current GeForce, the max texture size is 8k (8192&#215;8192). With such a big resolution, I decided to [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20091216/geexlab-how-to-visualize-the-depth-buffer-in-glsl/' rel='bookmark' title='Permanent Link: [GeeXLab] How to Visualize the Depth Buffer in GLSL'>[GeeXLab] How to Visualize the Depth Buffer in GLSL</a></li>
<li><a href='http://www.geeks3d.com/20081008/real-time-shadow-algorithms-and-techniques-collection/' rel='bookmark' title='Permanent Link: Real-time Shadow Algorithms and Techniques Collection'>Real-time Shadow Algorithms and Techniques Collection</a></li>
<li><a href='http://www.geeks3d.com/20091116/geexlab-0-1-14-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.14 Available'>GeeXLab 0.1.14 Available</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_near_light_8192x8192.jpg" alt="Shadow Mapping and Depth Map Size"/></p>
<p></center><br />
<span id="more-5928"></span><br />
While updating GPU Caps Viewer (available very soon), I saw the max texture size for Radeon HD 5770 (and HD 5870 as well) is <b>16k or 16384&#215;16384</b>. I said wow! In the previous generation of Radeon and in current GeForce, the max texture size is 8k (8192&#215;8192). With such a big resolution, I decided to see how this will impact the shadow mapping by using largest possible depth map. </p>
<p>I coded a small demo with a textured ground, a textured torus, a light and, of course, the shadow mapping enabled. You can download the demo here:<br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=105" title=" downloaded 276 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download GXL - Large DepthMap Test on HD 5770 " /></a></p>
<p>As usual to run the demo you need the latest version of <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a>, and for this demo it&#8217;s the <a href="http://www.geeks3d.com/20091027/geexlab-0-1-13-available/">version 0.1.13</a>. If you don&#8217;t have Python, just download GeeXLab NO PYTHON.</p>
<p>Unzip the demo anywhere and drop ShadowMappingTest.xml in GeeXLab.</p>
<p>I did two kind of tests: the first one with the light near (x=0.0 y=150.0 z=50.0) the torus and the second one with the light further (x=0.0 y=500.0 z=200.0). The light position does not impact the FPS but impacts the visual aspect of the shadow due to depth map resolution.</p>
<p>In the first test, the depth map size varies from 128&#215;128 to the possible max size with a 16-bit resolution (OpenGL format = GL_DEPTH_COMPONENT16). When the light is near the object, a 16-bit depth map is enough. In the second test, the light is far from the object and a 32-bit depth map (OpenGL format = GL_DEPTH_COMPONENT32) is required. The filtering type (LINEAR or NONE) of the depth map does not change the FPS. I did the test with no filtering in order to visualize the depth map precision. </p>
<p>Linear depth map look up is actually the PCF (Percentage Closer Filtering) algorithm with 4 samples (equivalent to 4 texture fetches). GeForce and Radeon cards have a built-in PCF depth map look-up and this look-up is free. Linear depth map look up is called <b>fetch4</b> on Radeon. I&#8217;ll discuss about depth map filtering in another post.</p>
<p>Here are the results of this first test :</p>
<p>- Demo settings: 800&#215;600 windowed, no AA. </p>
<p><b>16-bit depth-map</b></p>
<ul>
<li>128&#215;128: 830 FPS</li>
<li>256&#215;256: 830 FPS</li>
<li>512&#215;512: 830 FPS</li>
<li>1024&#215;1024: 830 FPS &#8211; depth map size: 2MB</li>
<li>2048&#215;2048: 830 FPS &#8211; depth map size: 8MB</li>
<li>4096&#215;4096: 830 FPS &#8211; depth map size: 32MB</li>
<li>8192&#215;8192: 300 FPS &#8211; depth map size: 128MB</li>
<li>10000&#215;10000: 260 FPS &#8211; depth map size: 190MB</li>
<li>12000&#215;12000: 270 FPS &#8211; depth map size: 274MB</li>
<li>14000&#215;14000: 350 FPS &#8211; depth map size: 373MB</li>
<li>15350&#215;15350: 380 FPS &#8211; <b>depth map size: 449MB</b></li>
</ul>
<p>In this first test, <b>15350&#215;15350</b> seems to be the max size of the depth map. Up to 4k, the FPS is constant (830) and drops to 300 for a 8k depth map. Oddly for larger depth map the FPS goes up again. The Radeon HD 5770 supports NPOT (non power of two) textures that&#8217;s why we end up with a size like 15350.</p>
<p>Let&#8217;s see the results of the second test:</p>
<p>- Demo settings: 800&#215;600 windowed, no AA. </p>
<p><b>32-bit depth-map</b></p>
<ul>
<li>512&#215;512: 820 FPS</li>
<li>1024&#215;1024: 820 FPS &#8211; depth map size: 4MB</li>
<li>2048&#215;2048: 820 FPS &#8211; depth map size: 16MB</li>
<li>4096&#215;4096: 690 FPS &#8211; depth map size: 24MB</li>
<li>8192&#215;8192: 230 FPS &#8211; depth map size: 256MB</li>
<li>14015&#215;14015: 220 FPS &#8211; <b>depth map size: 749MB</b></li>
</ul>
<p>Ouch! <b>749MB</b> for the largest depth map. With 1GB of graphics memory, such a depth map is useless (except in this test <img src='http://www.geeks3d.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ). As for 16-bit depth map, there is a FPS collapse with 8k+ depth map (maybe a 2GB video card could improve a bit the situation&#8230;).</p>
<p>Here are the screenshots with the light close to the torus (16-bit depth map):<br />
<center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_near_light_128x128.jpg" alt="Shadow mapping"/><br/>128&#215;128 depth map</p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_near_light_256x256.jpg" alt="Shadow mapping"/><br/>256&#215;256 depth map</p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_near_light_512x512.jpg" alt="Shadow mapping"/><br/>512&#215;512 depth map</p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_near_light_1024x1024.jpg" alt="Shadow mapping"/><br/>1024&#215;1024 depth map</p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_near_light_2048x2048.jpg" alt="Shadow mapping"/><br/>2048&#215;2048 depth map</p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_near_light_4096x4096.jpg" alt="Shadow mapping"/><br/>4096&#215;4096 depth map</p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_near_light_8192x8192.jpg" alt="Shadow mapping"/><br/>8192&#215;8192 depth map</p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_near_light_12kx12k.jpg" alt="Shadow mapping"/><br/>12000&#215;12000 depth map</p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_near_light_15350x15350.jpg" alt="Shadow mapping"/><br/>15350&#215;15350 depth map</p>
<p></center><br />
Under 128&#215;128, the depth map resolution is too low and no shadow is rendered.</p>
<p>Now the screenshots with the light far from the torus (32-bit shadow map):<br />
<center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_far_light_512x512.jpg" alt="Shadow mapping"/><br/>512&#215;512 depth map</p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_far_light_1024x1024.jpg" alt="Shadow mapping"/><br/>1024&#215;1024 depth map</p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_far_light_2048x2048.jpg" alt="Shadow mapping"/><br/>2048&#215;2048 depth map</p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_far_light_4096x4096.jpg" alt="Shadow mapping"/><br/>4096&#215;4096 depth map</p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_far_light_8192x8192.jpg" alt="Shadow mapping"/><br/>8k x 8k depth map</p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_far_light_14015x14015.jpg" alt="Shadow mapping"/><br/>14015&#215;14015 depth map</p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/hd5770_shadow_mapping_far_light_14020x14020.jpg" alt="Shadow mapping"/><br/>14020&#215;14020 depth map &#8211; it&#8217;s too much!</p>
<p></center><br />
Under 512&#215;512, the depth map resolution is too low and no shadow is rendered. </p>
<p>As you see, high resolution depth maps are graphics memory ogres and FPS killers that &#8217;s why usually low resolution depth maps are used in games. Low resolution depth maps combined with some algorithms like <b>cascaded shadow maps</b> (CSM) make it possible to shadow large areas where light is far from objects.</p>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20091216/geexlab-how-to-visualize-the-depth-buffer-in-glsl/' rel='bookmark' title='Permanent Link: [GeeXLab] How to Visualize the Depth Buffer in GLSL'>[GeeXLab] How to Visualize the Depth Buffer in GLSL</a></li>
<li><a href='http://www.geeks3d.com/20081008/real-time-shadow-algorithms-and-techniques-collection/' rel='bookmark' title='Permanent Link: Real-time Shadow Algorithms and Techniques Collection'>Real-time Shadow Algorithms and Techniques Collection</a></li>
<li><a href='http://www.geeks3d.com/20091116/geexlab-0-1-14-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.14 Available'>GeeXLab 0.1.14 Available</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20091028/geexlab-shadow-mapping-and-large-depth-map-on-radeon-hd-5770/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Shader Library] Posterization Post Processing Effect (GLSL)</title>
		<link>http://www.geeks3d.com/20091027/shader-library-posterization-post-processing-effect-glsl/</link>
		<comments>http://www.geeks3d.com/20091027/shader-library-posterization-post-processing-effect-glsl/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 17:41:23 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[Post Processing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[glsl]]></category>
		<category><![CDATA[posterization]]></category>
		<category><![CDATA[real-time]]></category>
		<category><![CDATA[shader]]></category>
		<category><![CDATA[shader library]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=5906</guid>
		<description><![CDATA[



More shaders are available here: Geeks3D Shader Library.
Image posterization is the tranformation of an image with a continuous gradation of tone to several regions of fewer tones, with abrupt changes from one tone to another. The left part of the image shows the posterization effect while the right part shows the normal image.
You can download [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20091020/shader-library-lens-circle-post-processing-effect-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Lens Circle Post Processing Effect (GLSL)'>[Shader Library] Lens Circle Post Processing Effect (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091009/shader-library-night-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Night Vision Post Processing Filter (GLSL)'>[Shader Library] Night Vision Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] 2D Shockwave Post Processing Filter (GLSL)'>[Shader Library] 2D Shockwave Post Processing Filter (GLSL)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/postfx_posterization_01.jpg" alt="Shader Library - Posterization Post Processing Effect"/></p>
<p></center><br />
<span id="more-5906"></span><br />
More shaders are available here: <a href="http://www.geeks3d.com/geexlab/shader_library.php">Geeks3D Shader Library</a>.</p>
<p>Image <b>posterization</b> is the tranformation of an image with a continuous gradation of tone to several regions of fewer tones, with abrupt changes from one tone to another. The left part of the image shows the posterization effect while the right part shows the normal image.</p>
<p>You can download the demo source code here:<br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=104" title=" downloaded 182 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download GXL PostFX - Posterization " /></a><br />
To see the shader in real time, you need <a href="http://www.geeks3d.com/20091027/geexlab-0-1-13-available/">GeeXLab 0.1.13</a>. This demo does not use Python so you can use the version of GeeXLab without Python.</p>
<p>Unzip the source code somewhere, start GeeXLab and drop the file Posterize_Effect_Demo.xml in GeeXLab.</p>
<p>Some results:</p>
<ul>
<li>AMD X2 3800+ / Radeon HD 5770 (Cat9.11 beta) / WinXP SP2: 710 FPS (640&#215;480) and 690 FPS (1920&#215;1080)</li>
</ul>
<p><u><b>Shader desription (for NVIDIA and ATI)</b></u></p>
<p><b>Language</b>: OpenGL 2 &#8211; GLSL</p>
<p><b>Type</b>: Post processing filter</p>
<p><b>Inputs</b>: </p>
<ul>
<li>sceneBuffer (sampler2D): the scene buffer.</li>
<li>numColors (float): number of tone regions. Default=8.0</li>
<li>gamma (float): gamma factor. Default=0.6</li>
</ul>
<p><b>Ouputs</b>: color buffer</p>
<p><b>Shader code</b>:</p>
<pre>
[Vertex_Shader]
void main(void)
{
  gl_Position = ftransform();
  gl_TexCoord[0] = gl_MultiTexCoord0;
}
[Pixel_Shader]
uniform sampler2D sceneTex; // 0
uniform float gamma; // 0.6
uniform float numColors; // 8.0
void main()
{
  vec3 c = texture2D(sceneTex, gl_TexCoord[0].xy).rgb;
  c = pow(c, vec3(gamma, gamma, gamma));
  c = c * numColors;
  c = floor(c);
  c = c / numColors;
  c = pow(c, vec3(1.0/gamma));
  gl_FragColor = vec4(c, 1.0);
}
</pre>
<p><b>References</b></p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Posterization">Posterization @ wikipedia</a></li>
</ul>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20091020/shader-library-lens-circle-post-processing-effect-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Lens Circle Post Processing Effect (GLSL)'>[Shader Library] Lens Circle Post Processing Effect (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091009/shader-library-night-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Night Vision Post Processing Filter (GLSL)'>[Shader Library] Night Vision Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] 2D Shockwave Post Processing Filter (GLSL)'>[Shader Library] 2D Shockwave Post Processing Filter (GLSL)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20091027/shader-library-posterization-post-processing-effect-glsl/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>GeeXLab 0.1.13 Available</title>
		<link>http://www.geeks3d.com/20091027/geexlab-0-1-13-available/</link>
		<comments>http://www.geeks3d.com/20091027/geexlab-0-1-13-available/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 17:06:53 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[real-time]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=5899</guid>
		<description><![CDATA[



An update of GeeXLab is available. GeeXLab is now available in two versions: with and without Python. The version without Python will allow people that do not have a valid Python installation to use GeeXLab without problem.  Lua is still available in both versions. As usual, the Python version requires the installation of Python [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20100209/geexlab-0-1-15-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.15 Available'>GeeXLab 0.1.15 Available</a></li>
<li><a href='http://www.geeks3d.com/20091009/geexlab-0-1-11-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.11 Available'>GeeXLab 0.1.11 Available</a></li>
<li><a href='http://www.geeks3d.com/20091012/geexlab-0-1-12-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.12 Available'>GeeXLab 0.1.12 Available</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/common/geexlab_logo.jpg" alt="GeeXLab - real time 3D - Lua, Python, GLSL"/></p>
<p></center><br />
<span id="more-5899"></span><br />
An update of <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a> is available. GeeXLab is now available in two versions: with and without <b>Python</b>. The version without Python will allow people that do not have a valid Python installation to use GeeXLab without problem.  <b>Lua</b> is still available in both versions. As usual, the Python version requires the installation of <a href="http://www.python.org/ftp/python/2.6.3/python-2.6.3.msi">Python 2.6.3</a>.</p>
<p>The <a href="http://www.geeks3d.com/geexlab/code_samples.php">code samples</a> have been updated.</p>
<p>DOWNLOAD: <b>GeeXLab 0.1.13 full</b><br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=102" title="Version 0.1.13 downloaded 248 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download GeeXLab 0.1.13 Version 0.1.13" /></a></p>
<p>DOWNLOAD: <b>GeeXLab 0.1.13 NO PYTHON</b><br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=103" title="Version 0.1.13 downloaded 155 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download GeeXLab 0.1.13 No Py Version 0.1.13" /></a></p>
<p><b>ChangeLog</b></p>
<ul>
<li>New: added depth_bits attribute to shadow_mapping element of scene node.</li>
<li>New: added in config file the possibility to initialize the number of bits for color, depth and stencil buffers.</li>
<li>Change: VSYNC is OFF by default.</li>
<li>Bugfix: fixed a crash in anti-aliasing on Radeon when MSAA was greater than max MSAA supported.</li>
<li>Bugfix: in the Python version of HYP_Utils::OpenUrl().</li>
</ul>
<p><b>Related links</b></p>
<ul>
<li><a href="http://www.geeks3d.com/20091005/geexlab-laboratory-for-real-time-3d-learning-and-experiments/">GeeXLab: Laboratory for Real Time 3D Learning and Experiments</a></li>
<li><a href="http://www.geeks3d.com/20091022/geexlab-yi-king-video-game-preview/">YI King Video Game Preview</a></li>
</ul>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20100209/geexlab-0-1-15-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.15 Available'>GeeXLab 0.1.15 Available</a></li>
<li><a href='http://www.geeks3d.com/20091009/geexlab-0-1-11-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.11 Available'>GeeXLab 0.1.11 Available</a></li>
<li><a href='http://www.geeks3d.com/20091012/geexlab-0-1-12-available/' rel='bookmark' title='Permanent Link: GeeXLab 0.1.12 Available'>GeeXLab 0.1.12 Available</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20091027/geexlab-0-1-13-available/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[GeeXLab] YI King Video Game Preview</title>
		<link>http://www.geeks3d.com/20091022/geexlab-yi-king-video-game-preview/</link>
		<comments>http://www.geeks3d.com/20091022/geexlab-yi-king-video-game-preview/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 19:16:36 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[physx]]></category>
		<category><![CDATA[video game]]></category>
		<category><![CDATA[yi king]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=5853</guid>
		<description><![CDATA[



This is a video of a small game made with GeeXLab. I haven&#8217;t had yet the time to review and release the game (I&#8217;ll do it asap) but it sounds good.
This game a is simplified YI King simulation scripted in Lua and uses PhysX for&#8230; physics! The Yi King is an ancient Chinese system of [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20091116/geexlab-discover-your-future-with-yi-qing/' rel='bookmark' title='Permanent Link: [GeeXLab] Discover your Future with YI QING'>[GeeXLab] Discover your Future with YI QING</a></li>
<li><a href='http://www.geeks3d.com/20081119/mirrors-edge-upcoming-video-game-with-physx-effects/' rel='bookmark' title='Permanent Link: Mirror&#8217;s Edge: Upcoming Video Game With PhysX Effects'>Mirror&#8217;s Edge: Upcoming Video Game With PhysX Effects</a></li>
<li><a href='http://www.geeks3d.com/20090702/underwater-wars-a-video-game-with-directx-10-and-physx/' rel='bookmark' title='Permanent Link: Underwater Wars: a Video Game with DirectX 10 and PhysX'>Underwater Wars: a Video Game with DirectX 10 and PhysX</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center><br />
<object width="400" height="245"><param name="movie" value="http://www.dailymotion.com/swf/xavykq"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.dailymotion.com/swf/xavykq" type="application/x-shockwave-flash" width="400" height="245" allowfullscreen="true" allowscriptaccess="always"></object><br />
</center><br />
<span id="more-5853"></span><br />
This is a video of a small game made with <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a>. I haven&#8217;t had yet the time to review and release the game (I&#8217;ll do it asap) but it sounds good.</p>
<p>This game a is simplified <b>YI King</b> simulation scripted in <b>Lua</b> and uses PhysX for&#8230; physics! The Yi King is an ancient Chinese system of divination. Throw two sticks and interpret the result to discover your future!</p>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20091116/geexlab-discover-your-future-with-yi-qing/' rel='bookmark' title='Permanent Link: [GeeXLab] Discover your Future with YI QING'>[GeeXLab] Discover your Future with YI QING</a></li>
<li><a href='http://www.geeks3d.com/20081119/mirrors-edge-upcoming-video-game-with-physx-effects/' rel='bookmark' title='Permanent Link: Mirror&#8217;s Edge: Upcoming Video Game With PhysX Effects'>Mirror&#8217;s Edge: Upcoming Video Game With PhysX Effects</a></li>
<li><a href='http://www.geeks3d.com/20090702/underwater-wars-a-video-game-with-directx-10-and-physx/' rel='bookmark' title='Permanent Link: Underwater Wars: a Video Game with DirectX 10 and PhysX'>Underwater Wars: a Video Game with DirectX 10 and PhysX</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20091022/geexlab-yi-king-video-game-preview/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>[Shader Library] Lens Circle Post Processing Effect (GLSL)</title>
		<link>http://www.geeks3d.com/20091020/shader-library-lens-circle-post-processing-effect-glsl/</link>
		<comments>http://www.geeks3d.com/20091020/shader-library-lens-circle-post-processing-effect-glsl/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 19:53:27 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[Post Processing]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[glsl]]></category>
		<category><![CDATA[lens]]></category>
		<category><![CDATA[post processing]]></category>
		<category><![CDATA[shader library]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=5823</guid>
		<description><![CDATA[



More shaders are available here: Geeks3D Shader Library.
This simple shader adds a lens circle effect to the final scene image. The core of this effect is the smoothstep() function:

smoothstep(outer, inner, dist);

How this function works? If dist is greater than outer, smoothstep returns 0. If dist is lesser than inner, smoothstep returns 1. Between outer and [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20091027/shader-library-posterization-post-processing-effect-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Posterization Post Processing Effect (GLSL)'>[Shader Library] Posterization Post Processing Effect (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] 2D Shockwave Post Processing Filter (GLSL)'>[Shader Library] 2D Shockwave Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091112/shader-library-dream-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Dream Vision Post Processing Filter (GLSL)'>[Shader Library] Dream Vision Post Processing Filter (GLSL)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/postfx_lens_circle_01.jpg" alt="Shader Library - Lens Circle Post Processing Effect"/></p>
<p></center><br />
<span id="more-5823"></span><br />
More shaders are available here: <a href="http://www.geeks3d.com/geexlab/shader_library.php">Geeks3D Shader Library</a>.</p>
<p>This simple shader adds a lens circle effect to the final scene image. The core of this effect is the <b>smoothstep()</b> function:</p>
<pre>
smoothstep(outer, inner, dist);
</pre>
<p>How this function works? If dist is greater than outer, smoothstep returns 0. If dist is lesser than inner, smoothstep returns 1. Between outer and inner, smoothstep returns an interpolated value between 0.0 and 1.0.</p>
<p>You can download the demo source code here:<br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=100" title=" downloaded 148 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download PostFX_LensCircle.zip " /></a></p>
<p><b>To see the shader in real time, you need <a href="http://www.geeks3d.com/20091012/geexlab-0-1-12-available/">GeeXLab 0.1.12</a> and <a href="http://www.python.org/ftp/python/2.6.3/python-2.6.3.msi">Python 2.6.3</a></b>.</p>
<p>Unzip the source code somewhere, start <a href="http://www.geeks3d.com/geexlab/">GeeXLab</a> and drop the file Lens_Circle_Effect_Demo.xml in GeeXLab.</p>
<p>Some results:</p>
<ul>
<li>Core 2 Duo E8400 / Radeon HD 5770 (Cat9.10 beta) / WinXP SP2: 830 FPS (640&#215;480) and 750 FPS (1920&#215;1200)</li>
<li>AMD X2 3800+ / GeForce GTS 250 (fw191.07) / WinXP SP2: 644 FPS (640&#215;480) and 620 FPS (1920&#215;1080)</li>
</ul>
<p><u><b>Shader desription (for NVIDIA and ATI)</b></u></p>
<p><b>Language</b>: OpenGL 2 &#8211; GLSL</p>
<p><b>Type</b>: Post processing filter</p>
<p><b>Inputs</b>: </p>
<ul>
<li>sceneBuffer (sampler2D): the scene buffer.</li>
<li>lensRadius (vec2): outer (default=0.45) and inner (default=0.38) radius.</li>
</ul>
<p><b>Ouputs</b>: color buffer</p>
<p><b>Shader code</b>:</p>
<pre>
[Vertex_Shader]
void main(void)
{
  gl_Position = ftransform();
  gl_TexCoord[0] = gl_MultiTexCoord0;
}
[Pixel_Shader]
uniform sampler2D sceneTex; // 0
uniform vec2 lensRadius; // 0.45, 0.38
void main()
{
  vec4 Color = texture2D(sceneTex, gl_TexCoord[0].xy);
  float dist = distance(gl_TexCoord[0].xy, vec2(0.5,0.5));
  Color.rgb *= smoothstep(lensRadius.x, lensRadius.y, dist);
  gl_FragColor = Color;
}
</pre>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20091027/shader-library-posterization-post-processing-effect-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Posterization Post Processing Effect (GLSL)'>[Shader Library] Posterization Post Processing Effect (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] 2D Shockwave Post Processing Filter (GLSL)'>[Shader Library] 2D Shockwave Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091112/shader-library-dream-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Dream Vision Post Processing Filter (GLSL)'>[Shader Library] Dream Vision Post Processing Filter (GLSL)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20091020/shader-library-lens-circle-post-processing-effect-glsl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Shader Library] Bump Mapping Shader with Multiple Lights (GLSL)</title>
		<link>http://www.geeks3d.com/20091019/shader-library-bump-mapping-shader-with-multiple-lights-glsl/</link>
		<comments>http://www.geeks3d.com/20091019/shader-library-bump-mapping-shader-with-multiple-lights-glsl/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 09:45:35 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[Lighting]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[bump mapping]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[glsl]]></category>
		<category><![CDATA[shader]]></category>
		<category><![CDATA[shader library]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=5808</guid>
		<description><![CDATA[



More shaders are available here:  Geeks3D Shader Library.
This is a bump mapping shader (Phong lighting) based on this tutorial.
This shader supports several lights (up to 8). 
You can download a GeeXLab demo to see the shader in real time:
Unzip the archive somewhere and launch the demo with  Start_Demo_ATI_NVIDIA.bat.
Some results:

Core 2 Duo E8400 / [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20091013/shader-library-phong-shader-with-multiple-lights-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Phong Shader with Multiple Lights (GLSL)'>[Shader Library] Phong Shader with Multiple Lights (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091009/shader-library-night-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Night Vision Post Processing Filter (GLSL)'>[Shader Library] Night Vision Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091027/shader-library-posterization-post-processing-effect-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Posterization Post Processing Effect (GLSL)'>[Shader Library] Posterization Post Processing Effect (GLSL)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/lighting_bump_mapping_02.jpg" alt="Shader Library - Bump mapping"/></p>
<p></center><br />
<span id="more-5808"></span><br />
More shaders are available here: <a href="http://www.geeks3d.com/geexlab/shader_library.php"> Geeks3D Shader Library</a>.</p>
<p>This is a bump mapping shader (Phong lighting) based on <a href="http://www.ozone3d.net/tutorials/bump_mapping.php">this tutorial</a>.<br />
This shader supports several lights (up to 8). </p>
<p>You can download a GeeXLab demo to see the shader in real time:<br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=98" title=" downloaded 409 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download GLSL_Bump_Mapping_Multiple_Lights.zip " /></a></p>
<p>Unzip the archive somewhere and launch the demo with  <b>Start_Demo_ATI_NVIDIA.bat</b>.</p>
<p>Some results:</p>
<ul>
<li>Core 2 Duo E8400 / GeForce GTS 250 (Fw191.07) / WinXP SP2: 2050FPS (800&#215;600) and 650 FPS (1920&#215;1200)</li>
<li>AMD X2 3800+ / Radeon HD 4850 (Cat9.9) / WinXP SP2: 2480FPS (800&#215;600) and 1150 FPS (1920&#215;1080)</li>
</ul>
<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/lighting_bump_mapping_01.jpg" alt="Shader Library - Bump mapping"/></p>
<p></center></p>
<p><u><b>Shader desription (for NVIDIA and ATI)</b></u></p>
<p><b>Language</b>: OpenGL 2 &#8211; GLSL</p>
<p><b>Type</b>: Lighting</p>
<p><b>Inputs</b>: </p>
<ul>
<li>glTangent4f (vec4): tangent space vector per vertex. glTangent4f is a vertex attribute and is provided by GeeXLab 3D engine.</li>
<li>colorMap (sampler2D): color texture on texture unit 0</li>
<li>normalMap (sampler2D): normal texture on texture unit 1</li>
</ul>
<p><b>Ouputs</b>: color buffer</p>
<p><b>Shader code</b>:</p>
<pre>
[Vertex_Shader]
#define MAX_LIGHTS 8
#define NUM_LIGHTS 3
varying vec3 lightVec[MAX_LIGHTS];
varying vec3 viewVec;
attribute vec4 glTangent4f;
void main(void)
{
  gl_Position = ftransform();
  gl_TexCoord[0] = gl_MultiTexCoord0;

  vec3 n = normalize(gl_NormalMatrix * gl_Normal);
  vec3 t = normalize(gl_NormalMatrix * glTangent4f.xyz);
  vec3 b = cross(n, t);

  vec3 v;
  vec3 vVertex = vec3(gl_ModelViewMatrix * gl_Vertex);
  int i;
  for (i=0; i&lt;NUM_LIGHTS; ++i)
  {
    vec3 lVec = gl_LightSource[i].position.xyz - vVertex;
    v.x = dot(lVec, t);
    v.y = dot(lVec, b);
    v.z = dot(lVec, n);
    lightVec[i] = v;
  }

  vec3 vVec = -vVertex;
  v.x = dot(vVec, t);
  v.y = dot(vVec, b);
  v.z = dot(vVec, n);
  viewVec = v;
}

[Pixel_Shader]
#define MAX_LIGHTS 8
#define NUM_LIGHTS 3
varying vec3 lightVec[MAX_LIGHTS];
varying vec3 viewVec;
uniform sampler2D colorMap;
uniform sampler2D normalMap;
void main (void)
{
  vec2 uv = gl_TexCoord[0].st * 4.0;
  vec4 base = texture2D(colorMap, uv);
  vec4 final_color = vec4(0.2, 0.2, 0.2, 1.0) * base;
  vec3 vVec = normalize(viewVec);
  vec3 bump =
     normalize(texture2D(normalMap, uv).xyz * 2.0 - 1.0);
  vec3 R = reflect(-vVec, bump);
  int i;
  for (i=0; i&lt;NUM_LIGHTS; ++i)
  {
    vec3 lVec = normalize(lightVec[i]);
    float diffuse = max(dot(lVec, bump), 0.0);
    vec4 vDiffuse =
       gl_FrontLightProduct[i].diffuse *
       diffuse * base;
    final_color += vDiffuse;

    float specular =
      pow(clamp(dot(R, lVec), 0.0, 1.0),
            gl_FrontMaterial.shininess);
    vec4 vSpecular =
      gl_FrontLightProduct[i].specular *
      specular * diffuse;
    final_color += vSpecular;
  }

  gl_FragColor = final_color;
}
</pre>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20091013/shader-library-phong-shader-with-multiple-lights-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Phong Shader with Multiple Lights (GLSL)'>[Shader Library] Phong Shader with Multiple Lights (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091009/shader-library-night-vision-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Night Vision Post Processing Filter (GLSL)'>[Shader Library] Night Vision Post Processing Filter (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091027/shader-library-posterization-post-processing-effect-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Posterization Post Processing Effect (GLSL)'>[Shader Library] Posterization Post Processing Effect (GLSL)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20091019/shader-library-bump-mapping-shader-with-multiple-lights-glsl/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>[Shader Library] Phong Shader with Multiple Lights (GLSL)</title>
		<link>http://www.geeks3d.com/20091013/shader-library-phong-shader-with-multiple-lights-glsl/</link>
		<comments>http://www.geeks3d.com/20091013/shader-library-phong-shader-with-multiple-lights-glsl/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 15:31:52 +0000</pubDate>
		<dc:creator>JeGX</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[GeeXLab]]></category>
		<category><![CDATA[Lighting]]></category>
		<category><![CDATA[geexlab]]></category>
		<category><![CDATA[glsl]]></category>
		<category><![CDATA[lighting]]></category>
		<category><![CDATA[phong]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[shader]]></category>
		<category><![CDATA[shader library]]></category>

		<guid isPermaLink="false">http://www.geeks3d.com/?p=5762</guid>
		<description><![CDATA[



More shaders are available here:Geeks3D Shader Library.
This is a lighting shader based on my old Phong model tutorial. This shader supports several lights (up to 8). There are two versions of the shader: the first one that works on both NVIDIA and ATI boards. The second one, more flexible, accepts the number of lights as [...]


Related posts:<ol><li><a href='http://www.geeks3d.com/20091019/shader-library-bump-mapping-shader-with-multiple-lights-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Bump Mapping Shader with Multiple Lights (GLSL)'>[Shader Library] Bump Mapping Shader with Multiple Lights (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091027/shader-library-posterization-post-processing-effect-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Posterization Post Processing Effect (GLSL)'>[Shader Library] Posterization Post Processing Effect (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] 2D Shockwave Post Processing Filter (GLSL)'>[Shader Library] 2D Shockwave Post Processing Filter (GLSL)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/glsl_lighting_phong_multiple_lights_01.jpg" alt="Shader Library - Phong lighting with multiple lights"/></p>
<p></center><br />
<span id="more-5762"></span><br />
More shaders are available here:<a href="http://www.geeks3d.com/geexlab/shader_library.php">Geeks3D Shader Library</a>.</p>
<p>This is a lighting shader based on my old <a href="http://www.ozone3d.net/tutorials/glsl_lighting_phong.php">Phong model</a> tutorial. This shader supports several lights (up to 8). There are two versions of the shader: the first one that works on both NVIDIA and ATI boards. The second one, more flexible, accepts the number of lights as an uniform variable. This uniform variable is used in a for() loop (in both vertex and pixel shaders). <b>Currently, only NVIDIA GeForce and ATI Radeon HD 5000 support this construction</b>. A bug in Catalyst prevents previous generation of Radeon (HD 4k, 3k, 2k) from executing the second shader.</p>
<p>You can download a GeeXLab demo to see the shader in real time:<br />
<a class="downloadlink dlimg" href="http://www.geeks3d.com/wp-content/plugins/download-monitor/download.php?id=96" title=" downloaded 397 times" ><img src="http://www.geeks3d.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download Shader Lib - Lighting_Phong_Multiple_Lights_GLSL.zip " /></a></p>
<p>Unzip the archive somewhere. You can start the ATI/NVIDIA demo with <b>Start_Demo_ATI_NVIDIA.bat</b> and the NVIDIA and ATI HD 5000 demo with <b>Start_Demo_NVIDIA_only.bat</b>.</p>
<p>Some results:</p>
<ul>
<li>Core 2 Duo E8400 / GeForce GTS 250 (Fw191.07) / WinXP SP2: <b>2800 FPS</b> (800&#215;600) and <b>800 FPS</b> (1920&#215;1200)</li>
<li>AMD X2 3800+ / Radeon HD 4850 (Cat9.9) / WinXP SP2: <b>2850 FPS</b> (800&#215;600) and <b>1350 FPS</b> (1920&#215;1080)</li>
</ul>
<p><center></p>
<p><img src="http://www.geeks3d.com/public/jegx/200910/glsl_lighting_phong_multiple_lights_02.jpg" alt="Shader Library - Phong lighting with multiple lights"/></p>
<p></center></p>
<p><u><b>First Shader desription (for NVIDIA and ATI)</b></u></p>
<p><b>Language</b>: OpenGL 2 &#8211; GLSL</p>
<p><b>Type</b>: Lighting</p>
<p><b>Inputs</b>: none (the number of lights is hard coded: see NUM_LIGHTS define). </p>
<p><b>Ouputs</b>: color buffer</p>
<p><b>Shader code</b>:</p>
<pre>
[Vertex_Shader]
varying vec3 normal, eyeVec;
#define MAX_LIGHTS 8
#define NUM_LIGHTS 3
varying vec3 lightDir[MAX_LIGHTS];
void main()
{
  gl_Position = ftransform();
  normal = gl_NormalMatrix * gl_Normal;
  vec4 vVertex = gl_ModelViewMatrix * gl_Vertex;
  eyeVec = -vVertex.xyz;
  int i;
  for (i=0; i&lt;NUM_LIGHTS; ++i)
    lightDir[i] =
      vec3(gl_LightSource[i].position.xyz - vVertex.xyz);
}
[Pixel_Shader]
varying vec3 normal, eyeVec;
#define MAX_LIGHTS 8
#define NUM_LIGHTS 3
varying vec3 lightDir[MAX_LIGHTS];
void main (void)
{
  vec4 final_color =
       gl_FrontLightModelProduct.sceneColor;
  vec3 N = normalize(normal);
  int i;
  for (i=0; i&lt;NUM_LIGHTS; ++i)
  {
    vec3 L = normalize(lightDir[i]);
    float lambertTerm = dot(N,L);
    if (lambertTerm &gt; 0.0)
    {
      final_color +=
        gl_LightSource[i].diffuse *
        gl_FrontMaterial.diffuse *
        lambertTerm;
      vec3 E = normalize(eyeVec);
      vec3 R = reflect(-L, N);
      float specular = pow(max(dot(R, E), 0.0),
                           gl_FrontMaterial.shininess);
      final_color +=
        gl_LightSource[i].specular *
        gl_FrontMaterial.specular *
        specular;
    }
  }
  gl_FragColor = final_color;
}
</pre>
<p><u><b>Second Shader desription (for NVIDIA and ATI Radeon HD 5000 only)</b></u></p>
<p><b>Language</b>: OpenGL 2 &#8211; GLSL</p>
<p><b>Type</b>: Lighting</p>
<p><b>Inputs</b></p>
<ul>
<li>numLights (int): number of lights. Max = 8.</li>
</ul>
<p><b>Ouputs</b>: color buffer</p>
<p><b>Shader code</b>:</p>
<pre>
[Vertex_Shader]
varying vec3 normal, eyeVec;
#define MAX_LIGHTS 8
varying vec3 lightDir[MAX_LIGHTS];
uniform int numLights;
void main()
{
  gl_Position = ftransform();
  normal = gl_NormalMatrix * gl_Normal;
  vec4 vVertex = gl_ModelViewMatrix * gl_Vertex;
  eyeVec = -vVertex.xyz;
  int i;
  for (i=0; i&lt;numLights; ++i)
    lightDir[i] =
      vec3(gl_LightSource[i].position.xyz - vVertex.xyz);
}
[Pixel_Shader]
varying vec3 normal, eyeVec;
#define MAX_LIGHTS 8
varying vec3 lightDir[MAX_LIGHTS];
uniform int numLights;
void main (void)
{
  vec4 final_color =
       gl_FrontLightModelProduct.sceneColor;
  vec3 N = normalize(normal);
  int i;
  for (i=0; i&lt;numLights; ++i)
  {
    vec3 L = normalize(lightDir[i]);
    float lambertTerm = dot(N,L);
    if (lambertTerm &gt; 0.0)
    {
      final_color +=
        gl_LightSource[i].diffuse *
        gl_FrontMaterial.diffuse *
        lambertTerm;
      vec3 E = normalize(eyeVec);
      vec3 R = reflect(-L, N);
      float specular = pow(max(dot(R, E), 0.0),
                           gl_FrontMaterial.shininess);
      final_color +=
        gl_LightSource[i].specular *
        gl_FrontMaterial.specular *
        specular;
    }
  }
  gl_FragColor = final_color;
}
</pre>
<p>And for lazy people, the one light shader (works both on ATI and NVIDIA):</p>
<p><b>Shader code</b>:</p>
<pre>
[Vertex_Shader]
varying vec3 normal, eyeVec, lightDir;
void main()
{
  gl_Position = ftransform();
  normal = gl_NormalMatrix * gl_Normal;
  vec4 vVertex = gl_ModelViewMatrix * gl_Vertex;
  eyeVec = -vVertex.xyz;
  lightDir =
      vec3(gl_LightSource[0].position.xyz - vVertex.xyz);
}
[Pixel_Shader]
varying vec3 normal, eyeVec, lightDir;
void main (void)
{
  vec4 final_color =
       gl_FrontLightModelProduct.sceneColor;
  vec3 N = normalize(normal);
  vec3 L = normalize(lightDir[0]);
  float lambertTerm = dot(N,L);
  if (lambertTerm &gt; 0.0)
  {
    final_color +=
      gl_LightSource[0].diffuse *
      gl_FrontMaterial.diffuse *
      lambertTerm;
    vec3 E = normalize(eyeVec);
    vec3 R = reflect(-L, N);
    float specular = pow(max(dot(R, E), 0.0),
                         gl_FrontMaterial.shininess);
    final_color +=
      gl_LightSource[0].specular *
      gl_FrontMaterial.specular *
      specular;
  }
  gl_FragColor = final_color;
}
</pre>


<p>Related posts:<ol><li><a href='http://www.geeks3d.com/20091019/shader-library-bump-mapping-shader-with-multiple-lights-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Bump Mapping Shader with Multiple Lights (GLSL)'>[Shader Library] Bump Mapping Shader with Multiple Lights (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091027/shader-library-posterization-post-processing-effect-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] Posterization Post Processing Effect (GLSL)'>[Shader Library] Posterization Post Processing Effect (GLSL)</a></li>
<li><a href='http://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/' rel='bookmark' title='Permanent Link: [Shader Library] 2D Shockwave Post Processing Filter (GLSL)'>[Shader Library] 2D Shockwave Post Processing Filter (GLSL)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.geeks3d.com/20091013/shader-library-phong-shader-with-multiple-lights-glsl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
