<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://horde3d.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mikmacer</id>
		<title>Horde3D Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://horde3d.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mikmacer"/>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Special:Contributions/Mikmacer"/>
		<updated>2026-06-09T19:38:33Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.29.3</generator>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:Community_portal&amp;diff=437</id>
		<title>Horde3D Wiki:Community portal</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:Community_portal&amp;diff=437"/>
				<updated>2009-01-04T08:36:49Z</updated>
		
		<summary type="html">&lt;p&gt;Mikmacer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__{{ContentBlock|width=800|color=orange&lt;br /&gt;
|content= '''The community portal section of the Horde3D wiki contains community contributed articles that are not part of the official documentation. Feel free to add articles to our wiki or links to external tutorials.'''}}&lt;br /&gt;
{{SpacerBlock}}&lt;br /&gt;
{{ContentBlock|width=800&lt;br /&gt;
|header=Horde3D is a cross-platform graphics engine. The currently supported platform are Windows, Linux and Mac OS X.&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
==Setting up the Development Environment==&lt;br /&gt;
*[[Horde3D Development Environment for Windows]]&lt;br /&gt;
*[[Horde3D Development Environment for Linux]]&lt;br /&gt;
*[[Horde3D Development Environment for Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
*[[Horde3D Development Environment from SVN]]&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
[[Category: Tutorials]]&lt;br /&gt;
&lt;br /&gt;
Fell free to write your tutorials here, for the benefit of the whole community. &lt;br /&gt;
===Beginner===&lt;br /&gt;
#[[Tutorial - Hello World]] - In this section we will create a simple application that loads a character and animates it using a walk cycle.&lt;br /&gt;
#[[Tutorial - Picking]] - In this section we will demonstrate picking the node under the mouse cursor&lt;br /&gt;
#[[Tutorial - Simple HUD]] - How to use showOverlay to create a simple HUD.&lt;br /&gt;
#[[Tutorial - Setup Horde with SDL]]   - How to Setup Horde with SDL.&lt;br /&gt;
#[[Tutorial - Setup Horde with Qt4]]   - How to Setup Horde with Qt4.&lt;br /&gt;
#[[Tutorial - Setup Horde with Gtkmm]] - How to Setup Horde with Gtkmm&lt;br /&gt;
&lt;br /&gt;
===Intermediate===&lt;br /&gt;
#[[Basic Pipeline Tutorial]] - Create your first custom pipeline.&lt;br /&gt;
&lt;br /&gt;
===Advanced===&lt;br /&gt;
&lt;br /&gt;
==Techniques==&lt;br /&gt;
[[Category: Techniques]]&lt;br /&gt;
&lt;br /&gt;
===Shading===&lt;br /&gt;
#[[Shading Technique - Dot Product Detail Texturing]] - Using the dot product of vectors and signed textures for high frequency detail&lt;br /&gt;
#[[Shading Technique - Palette Coloring]] - Quick and dirty palette recoloration of objects&lt;br /&gt;
#[[Shading Technique - Gloss Mapping]] - Mask which areas of an object have specular highlights&lt;br /&gt;
#[[Shading Technique - Glow Mapping]] - Allow areas on an object to emit a strong glowing highlight&lt;br /&gt;
#[[Shading Technique - Fresnel]] - Using reflection and refraction&lt;br /&gt;
#[[Shading Technique - Linear Depth Buffer]] - Create a custom linear depth buffer using vertex&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Content Import==&lt;br /&gt;
[[Category: Content Import]]&lt;br /&gt;
#[[Collada - 3DS Max and Maya]] - Exporting from 3D Studio Max and Maya. &lt;br /&gt;
#[[Collada - Modo]] - Exporting from Modo. &lt;br /&gt;
#[[Direct Export from Blender]] - Exporting from Blender.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Mikmacer</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Basic_Pipeline_Tutorial&amp;diff=436</id>
		<title>Basic Pipeline Tutorial</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Basic_Pipeline_Tutorial&amp;diff=436"/>
				<updated>2009-01-04T08:35:32Z</updated>
		
		<summary type="html">&lt;p&gt;Mikmacer: New page: {|  border=&amp;quot;0&amp;quot;  | {{ContentBlock|width=800|color=white |content={{!!}}  == Overview == In this tutorial, I will try to show you how the Horde3D pipeline system works. At the first look, wh...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|  border=&amp;quot;0&amp;quot; &lt;br /&gt;
| {{ContentBlock|width=800|color=white&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
In this tutorial, I will try to show you how the Horde3D pipeline system works. At the first look, when you haven't really work with an advanced pipeline system before, it may look a little bit complicated, but I will show how user friendly it is and how this powerful tool is useful.&lt;br /&gt;
&lt;br /&gt;
'''Requirements:'''&amp;lt;BR/&amp;gt;&lt;br /&gt;
- The Horde3D SDK 2.0&lt;br /&gt;
&lt;br /&gt;
== Creating the pipeline ==&lt;br /&gt;
First of all, I will show you how to create a really basic pipeline with only one context. For this, we will use the chicago example in the Horde3D SDK to see how the pipeline and his context can affect a scene. If you use Visual Studio, open the &amp;quot;Horde3D.sln&amp;quot; file to get into the chicago sample, oterwhise use your configuration to open the chicago example or edit each files in your favorite editor. In the &amp;quot;app.cpp&amp;quot; file, we will change the foward pipeline resource to take our custom pipeline instead of the foward pipeline, so in the Application::init() function  change this line:&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Old code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
_forwardPipeRes = Horde3D::addResource( ResourceTypes::Pipeline, &amp;quot;forward.pipeline.xml&amp;quot;, 0 );&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By this line:&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  New code code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
_forwardPipeRes = Horde3D::addResource( ResourceTypes::Pipeline, &amp;quot;myPipeline.pipeline.xml&amp;quot;, 0 );&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, we need to create the &amp;quot;myPipeline.pipeline.xml&amp;quot; file. Go in the &amp;quot;Horde3D\Binaries\Content\pipelines&amp;quot; folder, and create a file named &amp;quot;myPipeline.pipeline.xml&amp;quot; . Open this file and add this :&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  myPipeline.pipeline.xml|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Pipeline&amp;gt;&lt;br /&gt;
	&amp;lt;CommandQueue&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
		&amp;lt;Stage id=&amp;quot;FirstStage&amp;quot; link=&amp;quot;globalSettings.material.xml&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;SwitchTarget target=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;ClearTarget depthBuf=&amp;quot;true&amp;quot; colBuf0=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
			&lt;br /&gt;
			&amp;lt;DrawGeometry context=&amp;quot;AMBIENTCOLOR&amp;quot; class=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;/Stage&amp;gt;&lt;br /&gt;
		&lt;br /&gt;
	&amp;lt;/CommandQueue&amp;gt;&lt;br /&gt;
&amp;lt;/Pipeline&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have tried to make this pipeline as simple as possible. I will explain how it work :&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Pipeline tag|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Pipeline&amp;gt;&lt;br /&gt;
&amp;lt;/Pipeline&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This tag means that his childs tags gonna be pipelines tags related.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  CommandQueuetag tag|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;CommandQueue&amp;gt;	&lt;br /&gt;
&amp;lt;/CommandQueue&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tag means that his child tags gonna be related to direct rendering tags.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Stage tag|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Stage id=&amp;quot;FirstStage&amp;quot; link=&amp;quot;globalSettings.material.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/Stage&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
The stage is here to include a series of actions, and you can have multiple stage if you want even if in this exmaple have only one. It is useful since you can disable or enable a stage within an Horde3D function, and you can link it a material within the optional &amp;quot;link&amp;quot; attribute. If you want, you can look at the &amp;quot;globalSettings.material.xml&amp;quot; file to see what it contain, and if everyting is normal, you should see that a cube map is binded to the texture unit 7, this gonna be the ambient texture that will determine the ambient color of the scene. Finally, for each stages, don't forget to add an id, and in this example the id gonna be &amp;quot;FirstStage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  SwitchTarget tag|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;SwitchTarget target=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This tag is useful to designate a render target. It can be a buffer, but in this example we don't have any buffers so the target is the screen. An empty &amp;quot;target&amp;quot; means that everyhing next, until a new &amp;quot;SwitchTarget&amp;quot; tag, gonna be rendered on the screen. When you use a buffer as a target, it is not rendered on the screen, so an empty &amp;quot;target&amp;quot; attribute is required somewhere for each pipelines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  ClearTarget tag|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ClearTarget depthBuf=&amp;quot;true&amp;quot; colBuf0=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This tag is used to clear the contain of the current target. The attribute &amp;quot;depthBuf&amp;quot; is used to determine if you want to clear the depth buffer of the target, and each &amp;quot;colBufX&amp;quot; are attributes to clear the specified color buffer of the target. In this example, we use only one color buffer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  DrawGeometry tag|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;DrawGeometry context=&amp;quot;AMBIENTCOLOR&amp;quot; class=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This tag mean that you want to draw geometries in the current target. The &amp;quot;context&amp;quot; attribute designate the shader used to render the geometry. It is directly linked to the .shader.xml of each materials of each geometries. If a geometry linked to a material don't have this context in his shader file, the geometry won't be rendered. The class attribute linked to the material file, and an empty &amp;quot;class&amp;quot; attribute means that each class will be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have to compile the chicago example. Go in the &amp;quot;build&amp;quot; folder, and copy the new executable in the &amp;quot;win32&amp;quot; folder of the SDK. Is you execute this example you should see nothing. If you look at the engine log and there is no error, it means that everyhing have been rightly done. If you see a black screen, it's because there is no &amp;quot;AMBIENTCOLOR&amp;quot; in each shaders linked to each geometries. You have to add this context to each used shaders.&lt;br /&gt;
&lt;br /&gt;
In the chicago sample, three shaders are used : one for the animated model one for the sky and one for the parform. Open the &amp;quot;skinning.shader.xml&amp;quot; file since it's the shader used for the animated man. Next, you have to add this within the &amp;quot;shader&amp;quot; tag:&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;Context id=&amp;quot;AMBIENTCOLOR&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;VertexShader&amp;gt;&lt;br /&gt;
			&amp;lt;InsCode code=&amp;quot;utilityLib/vertCommon.glsl&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;DefCode&amp;gt;&lt;br /&gt;
			&amp;lt;![CDATA[&lt;br /&gt;
				// Those attributes are given by the Horde3D context&lt;br /&gt;
				attribute vec2 texCoords0; 	// Tex coordinate&lt;br /&gt;
				attribute vec3 normal;		// The normal vector of the vertex&lt;br /&gt;
&lt;br /&gt;
				varying vec2 vTextCoords;	// Tex coordinate&lt;br /&gt;
				varying vec3 vNormal;		// The normal in world space&lt;br /&gt;
&lt;br /&gt;
				void main( void )&lt;br /&gt;
				{&lt;br /&gt;
				&lt;br /&gt;
					// Get the world position of the vertex. At his initial position, gl_Vertex is in object space,&lt;br /&gt;
					// so we must transform his initial position to get the world position&lt;br /&gt;
					vec4 pos = calcWorldPos( gl_Vertex );&lt;br /&gt;
					&lt;br /&gt;
					// Get the normal in the world space from the object space&lt;br /&gt;
					vNormal = calcWorldVec( normal );&lt;br /&gt;
					&lt;br /&gt;
					// Get the tex coordinate&lt;br /&gt;
					vTextCoords = texCoords0;&lt;br /&gt;
					&lt;br /&gt;
					// The gl_ModelViewProjectionMatrix contain two matrices. The first one is the modelview matrix, and &lt;br /&gt;
					// within the horde3d context, this matrix transform a position into the view space, or camera space.&lt;br /&gt;
					// To get the view space position with this matrix, you must first get the world position of the vertex before.&lt;br /&gt;
					// The second matrix is the projection matrix, it is used to project the image into clipping space.&lt;br /&gt;
					gl_Position = gl_ModelViewProjectionMatrix * pos;&lt;br /&gt;
				}&lt;br /&gt;
			]]&amp;gt;&lt;br /&gt;
			&amp;lt;/DefCode&amp;gt;&lt;br /&gt;
		&amp;lt;/VertexShader&amp;gt;&lt;br /&gt;
		&lt;br /&gt;
		&amp;lt;FragmentShader&amp;gt;&lt;br /&gt;
			&amp;lt;DefCode&amp;gt;&lt;br /&gt;
			&amp;lt;![CDATA[&lt;br /&gt;
				uniform sampler2D tex0;		// This is the first texture, it is defined within the material file of the man&lt;br /&gt;
				uniform samplerCube tex7;	// This texture is from the global setting material that we have linked in the pipeline file&lt;br /&gt;
				varying vec3 vNormal;		// The normal in world space&lt;br /&gt;
				varying vec2 vTextCoords;	// The tex coordinate&lt;br /&gt;
&lt;br /&gt;
				void main( void )&lt;br /&gt;
				{&lt;br /&gt;
					// Get the texture color of the current texel&lt;br /&gt;
					vec3 albedo = texture2D( tex0, vTextCoords ).rgb;&lt;br /&gt;
					&lt;br /&gt;
					// Get the ambient color of the texel within the ambient cubemap defined in the &amp;quot;globalSettings.material.xml&amp;quot; file.&lt;br /&gt;
					vec3 ambient = textureCube( tex7, vNormal ).rgb;&lt;br /&gt;
					&lt;br /&gt;
					// Get the final texel color by mixing the ambient and the albedo color&lt;br /&gt;
					gl_FragColor.rgb = albedo * ambient;&lt;br /&gt;
				}&lt;br /&gt;
			]]&amp;gt;&lt;br /&gt;
			&amp;lt;/DefCode&amp;gt;&lt;br /&gt;
		&amp;lt;/FragmentShader&amp;gt;&lt;br /&gt;
	&amp;lt;/Context&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, the id of the context tag is &amp;quot;AMBIENTCOLOR&amp;quot;, exactly like the context in our pipeline. It means that within this context this shader will be executed for the current geometry. Then, you have the &amp;quot;InsCode&amp;quot; tag. It is here to insert the &amp;quot;vertCommon.glsl&amp;quot; file wich contain some really useful functions for the vertex shader, like &amp;quot;calcWorldVec()&amp;quot; and &amp;quot;calcWorldPos()&amp;quot;. Finally, I have tried to make the vertex and the pixel shader self-explained, so you can read them if you want to learn how basically the context for the shader is within Horde3D.&lt;br /&gt;
&lt;br /&gt;
Now you can execute the chicago sample and you should see each man moving, but they sould not have any animations because, in the shader, we don't use skinning. If you want to learn how skining work with Horde3D, look at the shader within the &amp;quot;AMBIENT&amp;quot; context of the file, and you should see the difference between both vertex shaders. For the other two shader, the one for the sly and the one for the platform, you can copy the &amp;quot;AMBIENT&amp;quot; context of each shaders file and name them &amp;quot;AMBIENTCOLOR&amp;quot; to see them in the scene.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Finally, I have tried to make this tutorial as simple as possible, with a basic pipeline, so that it souldn't be too hard for any programmers to learn how the pipeline system work. It's why there is no lighting or multiple buffers, but with the basics, you can learn more by yourself by looking at any of the others Horde3D SDK pipelines and by trying things by yourself!&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
|  valign=&amp;quot;top&amp;quot; | {{Extension_Summary&lt;br /&gt;
|name = Tutorial - Basic Pipeline Tutoial&lt;br /&gt;
|screenshot = &lt;br /&gt;
|description = A basic pipeline tutorial&lt;br /&gt;
|version = 1.0&lt;br /&gt;
|horde3dversion = 1.0 beta 2&lt;br /&gt;
|released = 2009-01-04&lt;br /&gt;
|author = [http://www.horde3d.org/forums/memberlist.php?mode=viewprofile&amp;amp;u=154 Mikmacer]|&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
[[category: Tutorial]]&lt;/div&gt;</summary>
		<author><name>Mikmacer</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Linear_Depth_Buffer&amp;diff=354</id>
		<title>Shading Technique - Linear Depth Buffer</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Linear_Depth_Buffer&amp;diff=354"/>
				<updated>2008-09-07T02:03:06Z</updated>
		
		<summary type="html">&lt;p&gt;Mikmacer: Change creation date to the good one&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|  border=&amp;quot;0&amp;quot; &lt;br /&gt;
| {{ContentBlock|width=800|color=white&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
'''Why using a custom Depth buffer?''' &lt;br /&gt;
The default depth buffer generated by Horde3D is a non-linear depth buffer and it is relative to the &amp;quot;Z Far&amp;quot; and the &amp;quot;Z Near&amp;quot; parameter. If you need to create screen space shader like &amp;quot;Depth of field&amp;quot; and &amp;quot;Screen Space Ambien Occlusion&amp;quot;, a non-linear depth buffer could cause some problems since you will need to linearize the depth buffer each frames and any changement to the Z far and the Z near could affect any shaders using the Depth Buffer.&lt;br /&gt;
&lt;br /&gt;
'''Requirements:'''&amp;lt;BR/&amp;gt;&lt;br /&gt;
- Basic knowledge of the Horde3D pipeline system.&lt;br /&gt;
&lt;br /&gt;
== The shader ==&lt;br /&gt;
&lt;br /&gt;
'''Vertex shader:'''&lt;br /&gt;
Here, you can change the max distance constant. It determine the range and the precision of the depth buffer. &lt;br /&gt;
&lt;br /&gt;
As you can see, there is two ways to calculate the depth of a vertex. The first one is to take the view space position of the vertex, and with this, you can take the Z value to get the depth. The second way is to create a vector from the view position to the vertex position, wich gave a slightly different result.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Linear Depth - Vertex Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
// Viewer position&lt;br /&gt;
uniform vec3 viewer;&lt;br /&gt;
			&lt;br /&gt;
// Depth vertex color&lt;br /&gt;
varying vec4 vVertexColor; // Black/near --&amp;gt; White/far&lt;br /&gt;
						&lt;br /&gt;
const float MAX_DISTANCE = 1000.0;&lt;br /&gt;
				&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
	// Calculate world space position&lt;br /&gt;
	vec4 pos = calcWorldPos( gl_Vertex );&lt;br /&gt;
&lt;br /&gt;
	// Calculate view space position&lt;br /&gt;
	vec4 vsPos = calcViewPos( pos );&lt;br /&gt;
&lt;br /&gt;
	// Calculate Depth&lt;br /&gt;
	float distance = -vsPos.z / MAX_DISTANCE;//length(pos.xyz - viewer) / MAX_DISTANCE;&lt;br /&gt;
					&lt;br /&gt;
	// Colorize the vertex with the distance&lt;br /&gt;
	vVertexColor = vec4(distance);&lt;br /&gt;
				&lt;br /&gt;
	gl_Position = gl_ModelViewProjectionMatrix * pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
'''Fragment shader:'''&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Linear Depth - Fragment Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
varying vec4 vVertexColor;&lt;br /&gt;
				&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
	gl_FragColor = vVertexColor;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Pipeline integration ==&lt;br /&gt;
&lt;br /&gt;
First of all, you need to add a buffer in the setup tag:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Setup&amp;gt;&lt;br /&gt;
    &amp;lt;RenderTarget id=&amp;quot;VERTDEPTHBUF&amp;quot; depthBuf=&amp;quot;true&amp;quot; numColBufs=&amp;quot;1&amp;quot; format=&amp;quot;RGBA16F&amp;quot;  scale=&amp;quot;1.0&amp;quot; /&amp;gt;	&lt;br /&gt;
&amp;lt;/Setup&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you need to add the depth buffer pass:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Stage id=&amp;quot;VertexDepth&amp;quot;&amp;gt;		&lt;br /&gt;
	&amp;lt;SwitchTarget target=&amp;quot;VERTDEPTHBUF&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;ClearTarget depthBuf=&amp;quot;true&amp;quot; colBuf0=&amp;quot;true&amp;quot; /&amp;gt; 	&lt;br /&gt;
	&amp;lt;DrawGeometry context=&amp;quot;DEPTH&amp;quot; class=&amp;quot;~Translucent&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/Stage&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this, you only have to bind the VERTDEPTHBUF to any stage you want.&lt;br /&gt;
&lt;br /&gt;
I have called the depth pass DEPTH, but you can call it whatever you want. Don't forget to put the shader pass in EACH shaders that need to be affected by the depth buffer.&lt;br /&gt;
&lt;br /&gt;
== How to use it == &lt;br /&gt;
You must put the shader pass in EACH shaders that need to be affected by the depth buffer.&lt;br /&gt;
&lt;br /&gt;
== Example Result == &lt;br /&gt;
&lt;br /&gt;
To be added.&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
http://img255.imageshack.us/img255/7348/customdepthqi6.png&lt;br /&gt;
&lt;br /&gt;
== To-Do List for this Article ==&lt;br /&gt;
- Add an exemple &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
|  valign=&amp;quot;top&amp;quot; | {{Extension_Summary&lt;br /&gt;
|name = Technique - Linear Depth Buffer&lt;br /&gt;
|screenshot = &lt;br /&gt;
|description = Creating a custom linear depth buffer&lt;br /&gt;
|version = 1.0&lt;br /&gt;
|horde3dversion = 1.0 beta&lt;br /&gt;
|released = 2008-09-06&lt;br /&gt;
|author = [http://www.horde3d.org/forums/memberlist.php?mode=viewprofile&amp;amp;u=154 Mikmacer]|&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
[[category: Technique]]&lt;/div&gt;</summary>
		<author><name>Mikmacer</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Linear_Depth_Buffer&amp;diff=353</id>
		<title>Shading Technique - Linear Depth Buffer</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Linear_Depth_Buffer&amp;diff=353"/>
				<updated>2008-09-07T01:47:15Z</updated>
		
		<summary type="html">&lt;p&gt;Mikmacer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|  border=&amp;quot;0&amp;quot; &lt;br /&gt;
| {{ContentBlock|width=800|color=white&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
'''Why using a custom Depth buffer?''' &lt;br /&gt;
The default depth buffer generated by Horde3D is a non-linear depth buffer and it is relative to the &amp;quot;Z Far&amp;quot; and the &amp;quot;Z Near&amp;quot; parameter. If you need to create screen space shader like &amp;quot;Depth of field&amp;quot; and &amp;quot;Screen Space Ambien Occlusion&amp;quot;, a non-linear depth buffer could cause some problems since you will need to linearize the depth buffer each frames and any changement to the Z far and the Z near could affect any shaders using the Depth Buffer.&lt;br /&gt;
&lt;br /&gt;
'''Requirements:'''&amp;lt;BR/&amp;gt;&lt;br /&gt;
- Basic knowledge of the Horde3D pipeline system.&lt;br /&gt;
&lt;br /&gt;
== The shader ==&lt;br /&gt;
&lt;br /&gt;
'''Vertex shader:'''&lt;br /&gt;
Here, you can change the max distance constant. It determine the range and the precision of the depth buffer. &lt;br /&gt;
&lt;br /&gt;
As you can see, there is two ways to calculate the depth of a vertex. The first one is to take the view space position of the vertex, and with this, you can take the Z value to get the depth. The second way is to create a vector from the view position to the vertex position, wich gave a slightly different result.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Linear Depth - Vertex Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
// Viewer position&lt;br /&gt;
uniform vec3 viewer;&lt;br /&gt;
			&lt;br /&gt;
// Depth vertex color&lt;br /&gt;
varying vec4 vVertexColor; // Black/near --&amp;gt; White/far&lt;br /&gt;
						&lt;br /&gt;
const float MAX_DISTANCE = 1000.0;&lt;br /&gt;
				&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
	// Calculate world space position&lt;br /&gt;
	vec4 pos = calcWorldPos( gl_Vertex );&lt;br /&gt;
&lt;br /&gt;
	// Calculate view space position&lt;br /&gt;
	vec4 vsPos = calcViewPos( pos );&lt;br /&gt;
&lt;br /&gt;
	// Calculate Depth&lt;br /&gt;
	float distance = -vsPos.z / MAX_DISTANCE;//length(pos.xyz - viewer) / MAX_DISTANCE;&lt;br /&gt;
					&lt;br /&gt;
	// Colorize the vertex with the distance&lt;br /&gt;
	vVertexColor = vec4(distance);&lt;br /&gt;
				&lt;br /&gt;
	gl_Position = gl_ModelViewProjectionMatrix * pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
'''Fragment shader:'''&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Linear Depth - Fragment Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
varying vec4 vVertexColor;&lt;br /&gt;
				&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
	gl_FragColor = vVertexColor;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Pipeline integration ==&lt;br /&gt;
&lt;br /&gt;
First of all, you need to add a buffer in the setup tag:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Setup&amp;gt;&lt;br /&gt;
    &amp;lt;RenderTarget id=&amp;quot;VERTDEPTHBUF&amp;quot; depthBuf=&amp;quot;true&amp;quot; numColBufs=&amp;quot;1&amp;quot; format=&amp;quot;RGBA16F&amp;quot;  scale=&amp;quot;1.0&amp;quot; /&amp;gt;	&lt;br /&gt;
&amp;lt;/Setup&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you need to add the depth buffer pass:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Stage id=&amp;quot;VertexDepth&amp;quot;&amp;gt;		&lt;br /&gt;
	&amp;lt;SwitchTarget target=&amp;quot;VERTDEPTHBUF&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;ClearTarget depthBuf=&amp;quot;true&amp;quot; colBuf0=&amp;quot;true&amp;quot; /&amp;gt; 	&lt;br /&gt;
	&amp;lt;DrawGeometry context=&amp;quot;DEPTH&amp;quot; class=&amp;quot;~Translucent&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/Stage&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this, you only have to bind the VERTDEPTHBUF to any stage you want.&lt;br /&gt;
&lt;br /&gt;
I have called the depth pass DEPTH, but you can call it whatever you want. Don't forget to put the shader pass in EACH shaders that need to be affected by the depth buffer.&lt;br /&gt;
&lt;br /&gt;
== How to use it == &lt;br /&gt;
You must put the shader pass in EACH shaders that need to be affected by the depth buffer.&lt;br /&gt;
&lt;br /&gt;
== Example Result == &lt;br /&gt;
&lt;br /&gt;
To be added.&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
http://img255.imageshack.us/img255/7348/customdepthqi6.png&lt;br /&gt;
&lt;br /&gt;
== To-Do List for this Article ==&lt;br /&gt;
- Add an exemple &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
|  valign=&amp;quot;top&amp;quot; | {{Extension_Summary&lt;br /&gt;
|name = Technique - Linear Depth Buffer&lt;br /&gt;
|screenshot = &lt;br /&gt;
|description = Creating a custom linear depth buffer&lt;br /&gt;
|version = 1.0&lt;br /&gt;
|horde3dversion = 1.0 beta&lt;br /&gt;
|released = 2008-08-10&lt;br /&gt;
|author = [http://www.horde3d.org/forums/memberlist.php?mode=viewprofile&amp;amp;u=154 Mikmacer]|&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
[[category: Technique]]&lt;/div&gt;</summary>
		<author><name>Mikmacer</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:Community_portal&amp;diff=352</id>
		<title>Horde3D Wiki:Community portal</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:Community_portal&amp;diff=352"/>
				<updated>2008-09-07T01:46:08Z</updated>
		
		<summary type="html">&lt;p&gt;Mikmacer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__{{ContentBlock|width=800|color=orange&lt;br /&gt;
|content= '''The community portal section of the Horde3D wiki contains community contributed articles that are not part of the official documentation. Feel free to add articles to our wiki or links to external tutorials.'''}}&lt;br /&gt;
{{SpacerBlock}}&lt;br /&gt;
{{ContentBlock|width=800&lt;br /&gt;
|header=Horde3D is a cross-platform graphics engine. The currently supported platform are Windows, Linux and Mac OS X.&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
==How-To setup a Horde3D Development Environment==&lt;br /&gt;
*[[Horde3D Development Environment for Windows]]&lt;br /&gt;
*[[Horde3D Development Environment for Linux]]&lt;br /&gt;
*[[Horde3D Development Environment for Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
*[[Horde3D Development Environment from SVN]]&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
[[Category: Tutorials]]&lt;br /&gt;
&lt;br /&gt;
Fell free to write your tutorials here, for the benefit of the whole community. &lt;br /&gt;
===Beginner===&lt;br /&gt;
#[[Tutorial - Hello World]] - In this section we will create a simple application that loads a character and animates it using a walk cycle.&lt;br /&gt;
#[[Tutorial - Picking]] - In this section we will demonstrate picking the node under the mouse cursor&lt;br /&gt;
#[[Tutorial - Simple HUD]] - How to use showOverlay to create a simple HUD.&lt;br /&gt;
#[[Tutorial - Setup Horde with SDL]]   - How to Setup Horde with SDL.&lt;br /&gt;
#[[Tutorial - Setup Horde with Qt4]]   - How to Setup Horde with Qt4.&lt;br /&gt;
#[[Tutorial - Setup Horde with Gtkmm]] - How to Setup Horde with Gtkmm&lt;br /&gt;
===Intermediate===&lt;br /&gt;
&lt;br /&gt;
===Advanced===&lt;br /&gt;
&lt;br /&gt;
==Techniques==&lt;br /&gt;
[[Category: Techniques]]&lt;br /&gt;
&lt;br /&gt;
===Shading===&lt;br /&gt;
#[[Shading Technique - Dot Product Detail Texturing]] - Using the dot product of vectors and signed textures for high frequency detail&lt;br /&gt;
#[[Shading Technique - Palette Coloring]] - Quick and dirty palette recoloration of objects&lt;br /&gt;
#[[Shading Technique - Gloss Mapping]] - Mask which areas of an object have specular highlights&lt;br /&gt;
#[[Shading Technique - Glow Mapping]] - Allow areas on an object to emit a strong glowing highlight&lt;br /&gt;
#[[Shading Technique - Fresnel]] - Using reflection and refraction&lt;br /&gt;
#[[Shading Technique - Linear Depth Buffer]] - Create a custom linear depth buffer using vertex&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Content Import==&lt;br /&gt;
[[Category: Content Import]]&lt;br /&gt;
#[[Collada - 3DS Max and Maya]] - Exporting from 3D Studio Max and Maya. &lt;br /&gt;
#[[Collada - Modo]] - Exporting from Modo. &lt;br /&gt;
#[[Collada - Blender]] - Exporting from Blender.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Mikmacer</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Linear_Depth_Buffer&amp;diff=351</id>
		<title>Shading Technique - Linear Depth Buffer</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Linear_Depth_Buffer&amp;diff=351"/>
				<updated>2008-09-07T01:41:58Z</updated>
		
		<summary type="html">&lt;p&gt;Mikmacer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|  border=&amp;quot;0&amp;quot; &lt;br /&gt;
| {{ContentBlock|width=800|color=white&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
'''Why using a custom Depth buffer?''' &lt;br /&gt;
The default depth buffer generated by Horde3D is a non-linear depth buffer and it is relative to the &amp;quot;Z Far&amp;quot; and the &amp;quot;Z Near&amp;quot; parameter. If you need to create screen space shader like &amp;quot;Depth of field&amp;quot; and &amp;quot;Screen Space Ambien Occlusion&amp;quot;, a non-linear depth buffer could cause some problems since you will need to linearize the depth buffer each frames and any changement to the Z far and the Z near could affect any shaders using the Depth Buffer.&lt;br /&gt;
&lt;br /&gt;
'''Requirements:'''&amp;lt;BR/&amp;gt;&lt;br /&gt;
- Basic knowledge of the Horde3D pipeline system.&lt;br /&gt;
&lt;br /&gt;
== The shader ==&lt;br /&gt;
&lt;br /&gt;
'''Vertex shader:'''&lt;br /&gt;
Here, you can change the max distance constant. It determine the range and the precision of the depth buffer. &lt;br /&gt;
&lt;br /&gt;
As you can see, there is two ways to calculate the depth of a vertex. The first one is to take the view space position of the vertex, and with this, you can take the Z value to get the depth. The second way is to create a vector from the view position to the vertex position, wich gave a slightly different result.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Linear Depth - Vertex Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
// Viewer position&lt;br /&gt;
uniform vec3 viewer;&lt;br /&gt;
			&lt;br /&gt;
// Depth vertex color&lt;br /&gt;
varying vec4 vVertexColor; // Black/near --&amp;gt; White/far&lt;br /&gt;
						&lt;br /&gt;
const float MAX_DISTANCE = 1000.0;&lt;br /&gt;
				&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
	// Calculate world space position&lt;br /&gt;
	vec4 pos = calcWorldPos( gl_Vertex );&lt;br /&gt;
&lt;br /&gt;
	// Calculate view space position&lt;br /&gt;
	vec4 vsPos = calcViewPos( pos );&lt;br /&gt;
&lt;br /&gt;
	// Calculate Depth&lt;br /&gt;
	float distance = -vsPos.z / MAX_DISTANCE;//length(pos.xyz - viewer) / MAX_DISTANCE;&lt;br /&gt;
					&lt;br /&gt;
	// Colorize the vertex with the distance&lt;br /&gt;
	vVertexColor = vec4(distance);&lt;br /&gt;
				&lt;br /&gt;
	gl_Position = gl_ModelViewProjectionMatrix * pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
'''Fragment shader:'''&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Linear Depth - Fragment Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
varying vec4 vVertexColor;&lt;br /&gt;
				&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
	gl_FragColor = vVertexColor;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Pipeline integration ==&lt;br /&gt;
&lt;br /&gt;
First of all, you need to add a buffer in the setup tag:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Setup&amp;gt;&lt;br /&gt;
    &amp;lt;RenderTarget id=&amp;quot;VERTDEPTHBUF&amp;quot; depthBuf=&amp;quot;true&amp;quot; numColBufs=&amp;quot;1&amp;quot; format=&amp;quot;RGBA16F&amp;quot;  scale=&amp;quot;1.0&amp;quot; /&amp;gt;	&lt;br /&gt;
&amp;lt;/Setup&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you need to add the depth buffer pass:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Stage id=&amp;quot;VertexDepth&amp;quot;&amp;gt;		&lt;br /&gt;
	&amp;lt;SwitchTarget target=&amp;quot;VERTDEPTHBUF&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;ClearTarget depthBuf=&amp;quot;true&amp;quot; colBuf0=&amp;quot;true&amp;quot; /&amp;gt; 	&lt;br /&gt;
	&amp;lt;DrawGeometry context=&amp;quot;DEPTH&amp;quot; class=&amp;quot;~Translucent&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/Stage&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this, you only have to bind the VERTDEPTHBUF to any stage you want.&lt;br /&gt;
&lt;br /&gt;
I have called the depth pass DEPTH, but you can call it wathever you want. Don't forget to put the shader pass in EACH shaders that need to be affected by the depth buffer.&lt;br /&gt;
&lt;br /&gt;
== How to use it == &lt;br /&gt;
You must put the shader pass in EACH shaders that need to be affected by the depth buffer.&lt;br /&gt;
&lt;br /&gt;
== Example Result == &lt;br /&gt;
&lt;br /&gt;
To be added.&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
http://img255.imageshack.us/img255/7348/customdepthqi6.png&lt;br /&gt;
&lt;br /&gt;
== To-Do List for this Article ==&lt;br /&gt;
- Add an exemple &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
|  valign=&amp;quot;top&amp;quot; | {{Extension_Summary&lt;br /&gt;
|name = Technique - Linear Depth Buffer&lt;br /&gt;
|screenshot = &lt;br /&gt;
|description = Creating a custom linear depth buffer&lt;br /&gt;
|version = 1.0&lt;br /&gt;
|horde3dversion = 1.0 beta&lt;br /&gt;
|released = 2008-08-10&lt;br /&gt;
|author = [http://www.horde3d.org/forums/memberlist.php?mode=viewprofile&amp;amp;u=154 Mikmacer]|&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
[[category: Technique]]&lt;/div&gt;</summary>
		<author><name>Mikmacer</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Linear_Depth_Buffer&amp;diff=350</id>
		<title>Shading Technique - Linear Depth Buffer</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Linear_Depth_Buffer&amp;diff=350"/>
				<updated>2008-09-07T01:37:34Z</updated>
		
		<summary type="html">&lt;p&gt;Mikmacer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|  border=&amp;quot;0&amp;quot; &lt;br /&gt;
| {{ContentBlock|width=800|color=white&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
'''Why using a custom Depth buffer?''' &lt;br /&gt;
The default depth buffer generated by Horde3D is a non-linear depth buffer and it is relative to the &amp;quot;Z Far&amp;quot; and the &amp;quot;Z Near&amp;quot; parameter. If you need to create screen space shader like &amp;quot;Depth of field&amp;quot; and &amp;quot;Screen Space Ambien Occlusion&amp;quot;, a non-linear depth buffer could cause some problems since you will need to linearize the depth buffer each frames and any changement to the Z far and the Z near could affect any shaders using the Depth Buffer.&lt;br /&gt;
&lt;br /&gt;
'''Requirements:'''&amp;lt;BR/&amp;gt;&lt;br /&gt;
- Basic knowledge of the Horde3D pipeline system.&lt;br /&gt;
&lt;br /&gt;
== The shader ==&lt;br /&gt;
Can be put in the ATTRIBPASS or AMBIENT context to be used with the examples pipelines in the Horde3D SDK 1.0 beta.&lt;br /&gt;
&lt;br /&gt;
'''Vertex shader:'''&lt;br /&gt;
Here, you can change the max distance constant. It determine the range and the precision of the depth buffer. &lt;br /&gt;
&lt;br /&gt;
As you can see, there is two ways to calculate the depth of a vertex. The first one is to take the view space position of the vertex, and with this, you can take the Z value to get the depth. The second way is to create a vector from the view position to the vertex position, wich gave a slightly different result.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Linear Depth - Vertex Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
// Viewer position&lt;br /&gt;
uniform vec3 viewer;&lt;br /&gt;
			&lt;br /&gt;
// Depth vertex color&lt;br /&gt;
varying vec4 vVertexColor; // Black/near --&amp;gt; White/far&lt;br /&gt;
						&lt;br /&gt;
const float MAX_DISTANCE = 1000.0;&lt;br /&gt;
				&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
	// Calculate world space position&lt;br /&gt;
	vec4 pos = calcWorldPos( gl_Vertex );&lt;br /&gt;
&lt;br /&gt;
	// Calculate view space position&lt;br /&gt;
	vec4 vsPos = calcViewPos( pos );&lt;br /&gt;
&lt;br /&gt;
	// Calculate Depth&lt;br /&gt;
	float distance = -vsPos.z / MAX_DISTANCE;//length(pos.xyz - viewer) / MAX_DISTANCE;&lt;br /&gt;
					&lt;br /&gt;
	// Colorize the vertex with the distance&lt;br /&gt;
	vVertexColor = vec4(distance);&lt;br /&gt;
				&lt;br /&gt;
	gl_Position = gl_ModelViewProjectionMatrix * pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
'''Fragment shader:'''&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Linear Depth - Fragment Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
varying vec4 vVertexColor;&lt;br /&gt;
				&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
	gl_FragColor = vVertexColor;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Pipeline integration ==&lt;br /&gt;
&lt;br /&gt;
First of all, you need to add a buffer in the setup tag:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Setup&amp;gt;&lt;br /&gt;
    &amp;lt;RenderTarget id=&amp;quot;VERTDEPTHBUF&amp;quot; depthBuf=&amp;quot;true&amp;quot; numColBufs=&amp;quot;1&amp;quot; format=&amp;quot;RGBA16F&amp;quot;  scale=&amp;quot;1.0&amp;quot; /&amp;gt;	&lt;br /&gt;
&amp;lt;/Setup&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you need to add the depth buffer pass:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Stage id=&amp;quot;VertexDepth&amp;quot;&amp;gt;		&lt;br /&gt;
	&amp;lt;SwitchTarget target=&amp;quot;VERTDEPTHBUF&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;ClearTarget depthBuf=&amp;quot;true&amp;quot; colBuf0=&amp;quot;true&amp;quot; /&amp;gt; 	&lt;br /&gt;
	&amp;lt;DrawGeometry context=&amp;quot;DEPTH&amp;quot; class=&amp;quot;~Translucent&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/Stage&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this, you only have to bind the VERTDEPTHBUF to any stage you want.&lt;br /&gt;
&lt;br /&gt;
I have called the depth pass DEPTH, but you can call it wathever you want. Don't forget to put the shader pass in EACH shaders that need to be affected by the depth buffer.&lt;br /&gt;
&lt;br /&gt;
== How to use it == &lt;br /&gt;
You must put the shader pass in EACH shaders that need to be affected by the depth buffer.&lt;br /&gt;
&lt;br /&gt;
== Example Result == &lt;br /&gt;
&lt;br /&gt;
To be added.&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
To be added.&lt;br /&gt;
&lt;br /&gt;
== To-Do List for this Article ==&lt;br /&gt;
- Add an exemple &amp;lt;br /&amp;gt;&lt;br /&gt;
- Add a picture &amp;lt;br /&amp;gt;&lt;br /&gt;
- Add an exemple pipeline &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
|  valign=&amp;quot;top&amp;quot; | {{Extension_Summary&lt;br /&gt;
|name = Technique - Linear Depth Buffer&lt;br /&gt;
|screenshot = &lt;br /&gt;
|description = Creating a custom linear depth buffer&lt;br /&gt;
|version = 1.0&lt;br /&gt;
|horde3dversion = 1.0 beta&lt;br /&gt;
|released = 2008-08-10&lt;br /&gt;
|author = [http://www.horde3d.org/forums/memberlist.php?mode=viewprofile&amp;amp;u=154 Mikmacer]|&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
[[category: Technique]]&lt;/div&gt;</summary>
		<author><name>Mikmacer</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Linear_Depth_Buffer&amp;diff=349</id>
		<title>Shading Technique - Linear Depth Buffer</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Linear_Depth_Buffer&amp;diff=349"/>
				<updated>2008-09-07T01:07:17Z</updated>
		
		<summary type="html">&lt;p&gt;Mikmacer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|  border=&amp;quot;0&amp;quot; &lt;br /&gt;
| {{ContentBlock|width=800|color=white&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
'''Why using a custom Depth buffer?''' &lt;br /&gt;
The default depth buffer generated by Horde3D is a non-linear depth buffer and it is relative to the &amp;quot;Z Far&amp;quot; and the &amp;quot;Z Near&amp;quot; parameter. If you need to create screen space shader like &amp;quot;Depth of field&amp;quot; and &amp;quot;Screen Space Ambien Occlusion&amp;quot;, a non-linear depth buffer could cause some problems since you will need to linearize the depth buffer each frames and any changement to the Z far and the Z near could affect any shaders using the Depth Buffer.&lt;br /&gt;
&lt;br /&gt;
'''Requirements:'''&amp;lt;BR/&amp;gt;&lt;br /&gt;
- Basic knowledge of the Horde3D pipeline system.&lt;br /&gt;
&lt;br /&gt;
== The shader ==&lt;br /&gt;
Can be put in the ATTRIBPASS or AMBIENT context to be used with the examples pipelines in the Horde3D SDK 1.0 beta.&lt;br /&gt;
&lt;br /&gt;
'''Vertex shader:'''&lt;br /&gt;
Here, you can change the max distance constant. It determine the range and the precision of the depth buffer. &lt;br /&gt;
&lt;br /&gt;
As you can see, there is two ways to calculate the depth of a vertex. The first one is to take the view space position of the vertex, and with this, you can take the Z value to get the depth. The second way is to create a vector from the view position to the vertex position, wich gave a slighter different result.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Linear Depth - Vertex Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
// Viewer position&lt;br /&gt;
uniform vec3 viewer;&lt;br /&gt;
			&lt;br /&gt;
// Depth vertex color&lt;br /&gt;
varying vec4 vVertexColor; // Black/near --&amp;gt; White/far&lt;br /&gt;
				&lt;br /&gt;
// Text coord&lt;br /&gt;
varying vec2 vTexCoords;&lt;br /&gt;
attribute vec2 texCoords0;&lt;br /&gt;
				&lt;br /&gt;
const float MAX_DISTANCE = 1000.0;&lt;br /&gt;
				&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
	// Calculate world space position&lt;br /&gt;
	vec4 pos = calcWorldPos( gl_Vertex );&lt;br /&gt;
&lt;br /&gt;
	// Calculate view space position&lt;br /&gt;
	vec4 vsPos = calcViewPos( pos );&lt;br /&gt;
&lt;br /&gt;
	// Calculate Depth&lt;br /&gt;
	float distance = -vsPos.z / MAX_DISTANCE;//length(pos.xyz - viewer) / MAX_DISTANCE;&lt;br /&gt;
					&lt;br /&gt;
	// Colorize the vertex with the distance&lt;br /&gt;
	vVertexColor = vec4(distance);&lt;br /&gt;
				&lt;br /&gt;
	gl_Position = gl_ModelViewProjectionMatrix * pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
'''Fragment shader:'''&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Linear Depth - Fragment Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
varying vec4 vVertexColor;&lt;br /&gt;
				&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
	gl_FragColor = vVertexColor;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== How to use it == &lt;br /&gt;
You must put the shader in EACH shaders that need to be affected by the depth buffer.&lt;br /&gt;
&lt;br /&gt;
== Example Result == &lt;br /&gt;
&lt;br /&gt;
To be added.&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
To be added.&lt;br /&gt;
&lt;br /&gt;
== To-Do List for this Article ==&lt;br /&gt;
- Add an exemple &amp;lt;br /&amp;gt;&lt;br /&gt;
- Add a picture &amp;lt;br /&amp;gt;&lt;br /&gt;
- Add an exemple pipeline &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
|  valign=&amp;quot;top&amp;quot; | {{Extension_Summary&lt;br /&gt;
|name = Technique - Linear Depth Buffer&lt;br /&gt;
|screenshot = &lt;br /&gt;
|description = Creating a custom linear depth buffer&lt;br /&gt;
|version = 1.0&lt;br /&gt;
|horde3dversion = 1.0 beta&lt;br /&gt;
|released = 2008-08-10&lt;br /&gt;
|author = [http://www.horde3d.org/forums/memberlist.php?mode=viewprofile&amp;amp;u=154 Mikmacer]|&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
[[category: Technique]]&lt;/div&gt;</summary>
		<author><name>Mikmacer</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Linear_Depth_Buffer&amp;diff=348</id>
		<title>Shading Technique - Linear Depth Buffer</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Linear_Depth_Buffer&amp;diff=348"/>
				<updated>2008-09-07T01:06:18Z</updated>
		
		<summary type="html">&lt;p&gt;Mikmacer: New page: {|  border=&amp;quot;0&amp;quot;  | {{ContentBlock|width=800|color=white |content={{!!}}  == Overview == '''Why using a custom Depth buffer?'''  The default depth buffer generated by Horde3D is a non-linear...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|  border=&amp;quot;0&amp;quot; &lt;br /&gt;
| {{ContentBlock|width=800|color=white&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
'''Why using a custom Depth buffer?''' &lt;br /&gt;
The default depth buffer generated by Horde3D is a non-linear depth buffer and it is relative to the &amp;quot;Z Far&amp;quot; and the &amp;quot;Z Near&amp;quot; parameter. If you need to create screen space shader like &amp;quot;Depth of field&amp;quot; and &amp;quot;Screen Space Ambien Occlusion&amp;quot;, a non-linear depth buffer could cause some problems since you will need to linearize the depth buffer each frames and any changement to the Z far and the Z near could affect any shaders using the Depth Buffer.&lt;br /&gt;
&lt;br /&gt;
'''Requirements:'''&amp;lt;BR/&amp;gt;&lt;br /&gt;
- Basic knowledge of the Horde3D pipeline system.&lt;br /&gt;
&lt;br /&gt;
== The shader ==&lt;br /&gt;
Can be put in the ATTRIBPASS or AMBIENT context to be used with the examples pipelines in the Horde3D SDK 1.0 beta.&lt;br /&gt;
&lt;br /&gt;
'''Vertex shader:'''&lt;br /&gt;
Here, you can change the max distance constant. It determine the range and the precision of the depth buffer. &lt;br /&gt;
&lt;br /&gt;
As you can see, there is two ways to calculate the depth of a vertex. The first one is to take the view space position of the vertex, and with this, you can take the Z value to get the depth. The second way is to create a vector from the view position to the vertex position, wich gave a slighter different result.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Linear Depth - Vertex Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
// Viewer position&lt;br /&gt;
uniform vec3 viewer;&lt;br /&gt;
			&lt;br /&gt;
// Depth vertex color&lt;br /&gt;
varying vec4 vVertexColor; // Black/near --&amp;gt; White/far&lt;br /&gt;
				&lt;br /&gt;
// Text coord&lt;br /&gt;
varying vec2 vTexCoords;&lt;br /&gt;
attribute vec2 texCoords0;&lt;br /&gt;
				&lt;br /&gt;
const float MAX_DISTANCE = 1000.0;&lt;br /&gt;
				&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
	// Calculate world space position&lt;br /&gt;
	vec4 pos = calcWorldPos( gl_Vertex );&lt;br /&gt;
&lt;br /&gt;
	// Calculate view space position&lt;br /&gt;
	vec4 vsPos = calcViewPos( pos );&lt;br /&gt;
					&lt;br /&gt;
	// Texture coordinate&lt;br /&gt;
	vTexCoords = texCoords0;&lt;br /&gt;
&lt;br /&gt;
	// Calculate Depth&lt;br /&gt;
	float distance = -vsPos.z / MAX_DISTANCE;//length(pos.xyz - viewer) / MAX_DISTANCE;&lt;br /&gt;
					&lt;br /&gt;
	// Colorize the vertex with the distance&lt;br /&gt;
	vVertexColor = vec4(distance);&lt;br /&gt;
				&lt;br /&gt;
	gl_Position = gl_ModelViewProjectionMatrix * pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
'''Fragment shader:'''&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Linear Depth - Fragment Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
varying vec4 vVertexColor;&lt;br /&gt;
varying vec2 texCoords;&lt;br /&gt;
				&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
	gl_FragColor = vVertexColor;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== How to use it == &lt;br /&gt;
You must put the shader in EACH shaders that need to be affected by the depth buffer.&lt;br /&gt;
&lt;br /&gt;
== Example Result == &lt;br /&gt;
&lt;br /&gt;
To be added.&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
To be added.&lt;br /&gt;
&lt;br /&gt;
== To-Do List for this Article ==&lt;br /&gt;
- Add an exemple &amp;lt;br /&amp;gt;&lt;br /&gt;
- Add a picture &amp;lt;br /&amp;gt;&lt;br /&gt;
- Add an exemple pipeline &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
|  valign=&amp;quot;top&amp;quot; | {{Extension_Summary&lt;br /&gt;
|name = Technique - Linear Depth Buffer&lt;br /&gt;
|screenshot = &lt;br /&gt;
|description = Creating a custom linear depth buffer&lt;br /&gt;
|version = 1.0&lt;br /&gt;
|horde3dversion = 1.0 beta&lt;br /&gt;
|released = 2008-08-10&lt;br /&gt;
|author = [http://www.horde3d.org/forums/memberlist.php?mode=viewprofile&amp;amp;u=154 Mikmacer]|&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
[[category: Technique]]&lt;/div&gt;</summary>
		<author><name>Mikmacer</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Community_Roadmap&amp;diff=346</id>
		<title>Community Roadmap</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Community_Roadmap&amp;diff=346"/>
				<updated>2008-09-06T22:02:33Z</updated>
		
		<summary type="html">&lt;p&gt;Mikmacer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As a way to keep the Horde3D community on the same page in regards to the development of future features, this Community Roadmap will keep an up to date log of the undergoing activities.&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;width: 100%&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#6699FF&amp;quot; style=&amp;quot;font-size: medium; font-weight: bold&amp;quot;&lt;br /&gt;
| Feature&lt;br /&gt;
| Description&lt;br /&gt;
| Assigned to&lt;br /&gt;
| Completion&lt;br /&gt;
| Released in&lt;br /&gt;
|-&lt;br /&gt;
| D3D Backend&lt;br /&gt;
| Write a D3D9/D3D10 backend, in addition to the current OpenGL backend&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|- bgcolor=&amp;quot;#FFFF66&amp;quot;&lt;br /&gt;
| [http://horde3d.org/wiki/index.php5?title=Community_Roadmap_-_Compressed_Texture_Support Compressed Texture Support]&lt;br /&gt;
| Support for DDS, PowerVR, and other Texture formats.&lt;br /&gt;
| swiftcoder&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| OpenGL ES2.x Backend&lt;br /&gt;
| Write a OpenGL ES2.x backend, Horde3D port for mobile platforms&lt;br /&gt;
| DDd&lt;br /&gt;
| 10%&lt;br /&gt;
| (EST.) December 2008&lt;br /&gt;
|-&lt;br /&gt;
| Ambient Occlusion&lt;br /&gt;
| Add ambient occlusion support for Horde3D&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h3&amp;gt;&amp;lt;span class=&amp;quot;mw-headline&amp;quot;&amp;gt;Upcoming Horde3D Version: 1.0&amp;lt;/span&amp;gt;&amp;lt;/h3&amp;gt;&lt;br /&gt;
| &amp;lt;h3&amp;gt;&amp;lt;span class=&amp;quot;mw-headline&amp;quot;&amp;gt;Upcoming Horde3D Editor version: 1.0&amp;lt;/span&amp;gt;&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;The current version is: v1.0.0 Beta1&amp;lt;/b&amp;gt;&lt;br /&gt;
| &amp;lt;b&amp;gt;The current version is: v0.7.0&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|For version 1.0.0 Beta1 of Horde3D the following features have been &lt;br /&gt;
		integrated:&amp;lt;/p&amp;gt;&lt;br /&gt;
		&amp;lt;ul&amp;gt;&lt;br /&gt;
			&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Occlusion Culling&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
			&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Render-to-Texture&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
			&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Stereo Rendering&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
			&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Software Skinning&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
			&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Node Sorting&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
		&amp;lt;/ul&amp;gt;&lt;br /&gt;
The first will give polygonally dense worlds a boost in speed and the second can be used to do all sorts of effects. See also the&lt;br /&gt;
[http://www.horde3d.org/docs/_changeLog.html changelog] for more details. &lt;br /&gt;
In the following weeks no new features will be implemented. Instead the development will be focused on bug fixes and further documentation.&lt;br /&gt;
| The next version 0.7.0 will be based on Horde3D v.1.0.0 Beta1 and will focus on a better extensibility using plugins (e.g. the terrain node extension will be a plugin and not a fixed part of the editor anymore). Further on there will be support for front, top, and right view of the scene with orthographic projection.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Mikmacer</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Fresnel&amp;diff=316</id>
		<title>Shading Technique - Fresnel</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Fresnel&amp;diff=316"/>
				<updated>2008-08-10T19:26:52Z</updated>
		
		<summary type="html">&lt;p&gt;Mikmacer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|  border=&amp;quot;0&amp;quot; &lt;br /&gt;
| {{ContentBlock|width=800|color=white&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
'''What is the Fresnel shader?''' &lt;br /&gt;
This shader combine reflection and refraction that depends on the viewing angle.&lt;br /&gt;
&lt;br /&gt;
'''What is refraction?''' &lt;br /&gt;
According to the &amp;quot;OpenGL Shading Language Book&amp;quot;, refraction is the blending of light as it passes trough a boundary between surfaces with different optical densities.&lt;br /&gt;
&lt;br /&gt;
'''Requirements:'''&amp;lt;BR/&amp;gt;&lt;br /&gt;
- A cube map texture.&lt;br /&gt;
&lt;br /&gt;
== The shader ==&lt;br /&gt;
Can be put in the ATTRIBPASS or AMBIENT context to be used with the examples pipelines in the Horde3D SDK 1.0 beta.&lt;br /&gt;
&lt;br /&gt;
'''Vertex shader:'''&lt;br /&gt;
In the vertex shader, you can freely change the indices of refraction or the degree of reflectivity to change de final result.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Fresnel - Vertex Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
const float Eta = 0.67;          // Ratio of indices of refraction (air -&amp;gt; glass)&lt;br /&gt;
const float FresnelPower = 10.0; // Controls degree of reflectivity at grazing angles&lt;br /&gt;
&lt;br /&gt;
const float F  = ((1.0 - Eta) * (1.0 - Eta)) / ((1.0 + Eta) * (1.0 + Eta));&lt;br /&gt;
&lt;br /&gt;
varying vec3  Reflect;&lt;br /&gt;
varying vec3  Refract;&lt;br /&gt;
varying float Ratio;&lt;br /&gt;
&lt;br /&gt;
attribute vec3 normal;&lt;br /&gt;
&lt;br /&gt;
uniform vec3 viewer;&lt;br /&gt;
&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
    vec4 worldPosition = calcWorldPos( gl_Vertex );&lt;br /&gt;
    vec3 ecPosition3  = worldPosition.xyz - viewer;&lt;br /&gt;
&lt;br /&gt;
    vec3 i = normalize(ecPosition3);&lt;br /&gt;
    vec3 n = normalize( calcWorldVec(normal) );&lt;br /&gt;
&lt;br /&gt;
    Ratio = F + (1.0 - F) * pow((1.0 - dot(-i, n)), FresnelPower);&lt;br /&gt;
    //Ratio = 1.0 - Ratio; // Add this line if your cube map is not based on the right side&lt;br /&gt;
&lt;br /&gt;
    Refract = refract(i, n, Eta);&lt;br /&gt;
    Refract = vec3(gl_TextureMatrix[0] * vec4(Refract, 1.0));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Reflect = reflect(i, n);&lt;br /&gt;
    Reflect = vec3(gl_TextureMatrix[0] * vec4(Reflect, 1.0));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    gl_Position   = gl_ModelViewProjectionMatrix * worldPosition;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
'''Fragment shader:'''&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Fresnel - Fragment Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
varying vec3  Reflect;&lt;br /&gt;
varying vec3  Refract;&lt;br /&gt;
varying float Ratio;&lt;br /&gt;
&lt;br /&gt;
uniform samplerCube tex0;&lt;br /&gt;
&lt;br /&gt;
void main(void)&lt;br /&gt;
{&lt;br /&gt;
    vec3 refractColor = vec3 (textureCube(tex0, Refract));&lt;br /&gt;
    vec3 reflectColor = vec3 (textureCube(tex0, Reflect));&lt;br /&gt;
&lt;br /&gt;
    vec3 color   = mix(refractColor, reflectColor, Ratio);&lt;br /&gt;
&lt;br /&gt;
    gl_FragColor = vec4(color, 1.0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== How to use it == &lt;br /&gt;
You must create a material in wich the shader is defined as the fresnel shader. Then, you must add the Texture unit 0 with a cube map type texture.&lt;br /&gt;
&lt;br /&gt;
== Example Result == &lt;br /&gt;
&lt;br /&gt;
http://www.horde3d.org/forums/download/file.php?id=52&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
http://img143.imageshack.us/img143/2072/fresnel3ej6.png&lt;br /&gt;
&lt;br /&gt;
== To-Do List for this Article ==&lt;br /&gt;
- Better explanation &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
|  valign=&amp;quot;top&amp;quot; | {{Extension_Summary&lt;br /&gt;
|name = Technique - Fresnel&lt;br /&gt;
|screenshot = &lt;br /&gt;
|description = Using reflection and refraction&lt;br /&gt;
|version = 1.0&lt;br /&gt;
|horde3dversion = 1.0 beta&lt;br /&gt;
|released = 2008-08-10&lt;br /&gt;
|author = [http://www.horde3d.org/forums/memberlist.php?mode=viewprofile&amp;amp;u=154 Mikmacer]|&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
[[category: Technique]]&lt;/div&gt;</summary>
		<author><name>Mikmacer</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Fresnel&amp;diff=315</id>
		<title>Shading Technique - Fresnel</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Fresnel&amp;diff=315"/>
				<updated>2008-08-10T19:26:31Z</updated>
		
		<summary type="html">&lt;p&gt;Mikmacer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|  border=&amp;quot;0&amp;quot; &lt;br /&gt;
| {{ContentBlock|width=800|color=white&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
'''What is the Fresnel shader?''' &lt;br /&gt;
This shader combine reflection and refraction that depends on the viewing angle.&lt;br /&gt;
&lt;br /&gt;
'''What is refraction?''' &lt;br /&gt;
According to the &amp;quot;OpenGL Shading Language Book&amp;quot;, refraction is the blending of light as it passes trough a boundary between surfaces with different optical densities.&lt;br /&gt;
&lt;br /&gt;
'''Requirements:'''&amp;lt;BR/&amp;gt;&lt;br /&gt;
- A cube map texture.&lt;br /&gt;
&lt;br /&gt;
== The shader ==&lt;br /&gt;
Can be put in the ATTRIBPASS or AMBIENT context to be used with the examples pipelines in the Horde3D SDK 1.0 beta.&lt;br /&gt;
&lt;br /&gt;
'''Vertex shader:'''&lt;br /&gt;
In the vertex shader, you can freely change the indices of refraction or the degree of reflectivity to change de final result.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Fresnel - Vertex Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
const float Eta = 0.67;          // Ratio of indices of refraction (air -&amp;gt; glass)&lt;br /&gt;
const float FresnelPower = 10.0; // Controls degree of reflectivity at grazing angles&lt;br /&gt;
&lt;br /&gt;
const float F  = ((1.0 - Eta) * (1.0 - Eta)) / ((1.0 + Eta) * (1.0 + Eta));&lt;br /&gt;
&lt;br /&gt;
varying vec3  Reflect;&lt;br /&gt;
varying vec3  Refract;&lt;br /&gt;
varying float Ratio;&lt;br /&gt;
&lt;br /&gt;
attribute vec3 normal;&lt;br /&gt;
&lt;br /&gt;
uniform vec3 viewer;&lt;br /&gt;
&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
    vec4 worldPosition = calcWorldPos( gl_Vertex );&lt;br /&gt;
    vec3 ecPosition3  = worldPosition.xyz - viewer;//viewer - worldPosition.xyz;&lt;br /&gt;
&lt;br /&gt;
    vec3 i = normalize(ecPosition3);&lt;br /&gt;
    vec3 n = normalize( calcWorldVec(normal) );&lt;br /&gt;
&lt;br /&gt;
    Ratio = F + (1.0 - F) * pow((1.0 - dot(-i, n)), FresnelPower);&lt;br /&gt;
    //Ratio = 1.0 - Ratio; // Add this line if your cube map is not based on the right side&lt;br /&gt;
&lt;br /&gt;
    Refract = refract(i, n, Eta);&lt;br /&gt;
    Refract = vec3(gl_TextureMatrix[0] * vec4(Refract, 1.0));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Reflect = reflect(i, n);&lt;br /&gt;
    Reflect = vec3(gl_TextureMatrix[0] * vec4(Reflect, 1.0));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    gl_Position   = gl_ModelViewProjectionMatrix * worldPosition;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
'''Fragment shader:'''&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Fresnel - Fragment Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
varying vec3  Reflect;&lt;br /&gt;
varying vec3  Refract;&lt;br /&gt;
varying float Ratio;&lt;br /&gt;
&lt;br /&gt;
uniform samplerCube tex0;&lt;br /&gt;
&lt;br /&gt;
void main(void)&lt;br /&gt;
{&lt;br /&gt;
    vec3 refractColor = vec3 (textureCube(tex0, Refract));&lt;br /&gt;
    vec3 reflectColor = vec3 (textureCube(tex0, Reflect));&lt;br /&gt;
&lt;br /&gt;
    vec3 color   = mix(refractColor, reflectColor, Ratio);&lt;br /&gt;
&lt;br /&gt;
    gl_FragColor = vec4(color, 1.0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== How to use it == &lt;br /&gt;
You must create a material in wich the shader is defined as the fresnel shader. Then, you must add the Texture unit 0 with a cube map type texture.&lt;br /&gt;
&lt;br /&gt;
== Example Result == &lt;br /&gt;
&lt;br /&gt;
http://www.horde3d.org/forums/download/file.php?id=52&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
http://img143.imageshack.us/img143/2072/fresnel3ej6.png&lt;br /&gt;
&lt;br /&gt;
== To-Do List for this Article ==&lt;br /&gt;
- Better explanation &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
|  valign=&amp;quot;top&amp;quot; | {{Extension_Summary&lt;br /&gt;
|name = Technique - Fresnel&lt;br /&gt;
|screenshot = &lt;br /&gt;
|description = Using reflection and refraction&lt;br /&gt;
|version = 1.0&lt;br /&gt;
|horde3dversion = 1.0 beta&lt;br /&gt;
|released = 2008-08-10&lt;br /&gt;
|author = [http://www.horde3d.org/forums/memberlist.php?mode=viewprofile&amp;amp;u=154 Mikmacer]|&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
[[category: Technique]]&lt;/div&gt;</summary>
		<author><name>Mikmacer</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Fresnel&amp;diff=314</id>
		<title>Shading Technique - Fresnel</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Fresnel&amp;diff=314"/>
				<updated>2008-08-10T19:25:37Z</updated>
		
		<summary type="html">&lt;p&gt;Mikmacer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|  border=&amp;quot;0&amp;quot; &lt;br /&gt;
| {{ContentBlock|width=800|color=white&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
'''What is the Fresnel shader?''' &lt;br /&gt;
This shader combine reflection and refraction that depends on the viewing angle.&lt;br /&gt;
&lt;br /&gt;
'''What is refraction?''' &lt;br /&gt;
According to the &amp;quot;OpenGL Shading Language Book&amp;quot;, refraction is the blending of light as it passes trough a boundary between surfaces with different optical densities.&lt;br /&gt;
&lt;br /&gt;
'''Requirements:'''&amp;lt;BR/&amp;gt;&lt;br /&gt;
- A cube map texture.&lt;br /&gt;
&lt;br /&gt;
== The shader ==&lt;br /&gt;
Can be put in the ATTRIBPASS or AMBIENT context to be used with the examples pipelines in the Horde3D SDK 1.0 beta.&lt;br /&gt;
&lt;br /&gt;
'''Vertex shader:'''&lt;br /&gt;
In the vertex shader, you can freely change the indices of refraction or the degree of reflectivity to change de final result.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Fresnel - Vertex Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
const float Eta = 0.67;          // Ratio of indices of refraction (air -&amp;gt; glass)&lt;br /&gt;
const float FresnelPower = 10.0; // Controls degree of reflectivity at grazing angles&lt;br /&gt;
&lt;br /&gt;
const float F  = ((1.0 - Eta) * (1.0 - Eta)) / ((1.0 + Eta) * (1.0 + Eta));&lt;br /&gt;
&lt;br /&gt;
varying vec3  Reflect;&lt;br /&gt;
varying vec3  Refract;&lt;br /&gt;
varying float Ratio;&lt;br /&gt;
&lt;br /&gt;
attribute vec3 normal;&lt;br /&gt;
&lt;br /&gt;
uniform vec3 viewer;&lt;br /&gt;
&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
    vec4 worldPosition = calcWorldPos( gl_Vertex );&lt;br /&gt;
    vec3 ecPosition3  = worldPosition.xyz - viewer;//viewer - worldPosition.xyz;&lt;br /&gt;
&lt;br /&gt;
    vec3 i = normalize(ecPosition3);&lt;br /&gt;
    vec3 n = normalize( calcWorldVec(normal) );&lt;br /&gt;
&lt;br /&gt;
    Ratio = F + (1.0 - F) * pow((1.0 - dot(-i, n)), FresnelPower);&lt;br /&gt;
    //Ratio = 1.0 - Ratio; // Add this line if your cube map is not based on the right side&lt;br /&gt;
&lt;br /&gt;
    Refract = refract(i, n, Eta);&lt;br /&gt;
    Refract = vec3(gl_TextureMatrix[0] * vec4(Refract, 1.0));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Reflect = reflect(i, n);&lt;br /&gt;
    Reflect = vec3(gl_TextureMatrix[0] * vec4(Reflect, 1.0));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    gl_Position   = gl_ModelViewProjectionMatrix * worldPosition;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
'''Fragment shader:'''&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Fresnel - Vertex Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
varying vec3  Reflect;&lt;br /&gt;
varying vec3  Refract;&lt;br /&gt;
varying float Ratio;&lt;br /&gt;
&lt;br /&gt;
uniform samplerCube tex0;&lt;br /&gt;
&lt;br /&gt;
void main(void)&lt;br /&gt;
{&lt;br /&gt;
    vec3 refractColor = vec3 (textureCube(tex0, Refract));&lt;br /&gt;
    vec3 reflectColor = vec3 (textureCube(tex0, Reflect));&lt;br /&gt;
&lt;br /&gt;
    vec3 color   = mix(refractColor, reflectColor, Ratio);&lt;br /&gt;
&lt;br /&gt;
    gl_FragColor = vec4(color, 1.0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== How to use it == &lt;br /&gt;
You must create a material in wich the shader is defined as the fresnel shader. Then, you must add the Texture unit 0 with a cube map type texture.&lt;br /&gt;
&lt;br /&gt;
== Example Result == &lt;br /&gt;
&lt;br /&gt;
http://www.horde3d.org/forums/download/file.php?id=52&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
http://img143.imageshack.us/img143/2072/fresnel3ej6.png&lt;br /&gt;
&lt;br /&gt;
== To-Do List for this Article ==&lt;br /&gt;
- Better explanation &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
|  valign=&amp;quot;top&amp;quot; | {{Extension_Summary&lt;br /&gt;
|name = Technique - Fresnel&lt;br /&gt;
|screenshot = &lt;br /&gt;
|description = Using reflection and refraction&lt;br /&gt;
|version = 1.0&lt;br /&gt;
|horde3dversion = 1.0 beta&lt;br /&gt;
|released = 2008-08-10&lt;br /&gt;
|author = [http://www.horde3d.org/forums/memberlist.php?mode=viewprofile&amp;amp;u=154 Mikmacer]|&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
[[category: Technique]]&lt;/div&gt;</summary>
		<author><name>Mikmacer</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:Community_portal&amp;diff=313</id>
		<title>Horde3D Wiki:Community portal</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:Community_portal&amp;diff=313"/>
				<updated>2008-08-10T19:17:57Z</updated>
		
		<summary type="html">&lt;p&gt;Mikmacer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__{{ContentBlock|width=800|color=orange&lt;br /&gt;
|content= '''The community portal section of the Horde3D wiki contains community contributed articles that are not part of the official documentation. Feel free to add articles to our wiki or links to external tutorials.'''}}&lt;br /&gt;
{{SpacerBlock}}&lt;br /&gt;
{{ContentBlock|width=800&lt;br /&gt;
|header=Horde3D is a cross-platform graphics engine. The currently supported platform are Windows, Linux and Mac OS X.&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
==How-To setup a Horde3D Development Environment==&lt;br /&gt;
*[[Horde3D Development Environment for Windows]]&lt;br /&gt;
*[[Horde3D Development Environment for Linux]]&lt;br /&gt;
*[[Horde3D Development Environment for Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
*[[Horde3D Development Environment from SVN]]&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
[[Category: Tutorials]]&lt;br /&gt;
&lt;br /&gt;
Fell free to write your tutorials here, for the benefit of the whole community. &lt;br /&gt;
===Beginner===&lt;br /&gt;
#[[Tutorial - Hello World]] - In this section we will create a simple application that loads a character and animates it using a walk cycle.&lt;br /&gt;
#[[Tutorial - Picking]] - In this section we will demonstrate picking the node under the mouse cursor&lt;br /&gt;
#[[Tutorial - Simple HUD]] - How to use showOverlay to create a simple HUD.&lt;br /&gt;
#[[Tutorial - Setup Horde with SDL]]   - How to Setup Horde with SDL.&lt;br /&gt;
#[[Tutorial - Setup Horde with Qt4]]   - How to Setup Horde with Qt4.&lt;br /&gt;
#[[Tutorial - Setup Horde with Gtkmm]] - How to Setup Horde with Gtkmm&lt;br /&gt;
===Intermediate===&lt;br /&gt;
&lt;br /&gt;
===Advanced===&lt;br /&gt;
&lt;br /&gt;
==Techniques==&lt;br /&gt;
[[Category: Techniques]]&lt;br /&gt;
&lt;br /&gt;
===Shading===&lt;br /&gt;
#[[Shading Technique - Dot Product Detail Texturing]] - Using the dot product of vectors and signed textures for high frequency detail&lt;br /&gt;
#[[Shading Technique - Palette Coloring]] - Quick and dirty palette recoloration of objects&lt;br /&gt;
#[[Shading Technique - Gloss Mapping]] - Mask which areas of an object have specular highlights&lt;br /&gt;
#[[Shading Technique - Glow Mapping]] - Allow areas on an object to emit a strong glowing highlight&lt;br /&gt;
#[[Shading Technique - Fresnel]] - Using reflection and refraction.&lt;br /&gt;
&lt;br /&gt;
==Content Import==&lt;br /&gt;
[[Category: Content Import]]&lt;br /&gt;
#[[Collada - 3DS Max and Maya]] - Exporting from 3D Studio Max and Maya. &lt;br /&gt;
#[[Collada - Modo]] - Exporting from Modo. &lt;br /&gt;
#[[Collada - Blender]] - Exporting from Blender.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Mikmacer</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Fresnel&amp;diff=312</id>
		<title>Shading Technique - Fresnel</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Shading_Technique_-_Fresnel&amp;diff=312"/>
				<updated>2008-08-10T19:14:40Z</updated>
		
		<summary type="html">&lt;p&gt;Mikmacer: New page: {|  border=&amp;quot;0&amp;quot;  | {{ContentBlock|width=800|color=white |content={{!!}}  == Overview == '''What is the Fresnel shader?'''  This shader combine reflection and refraction that depends on the ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|  border=&amp;quot;0&amp;quot; &lt;br /&gt;
| {{ContentBlock|width=800|color=white&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
'''What is the Fresnel shader?''' &lt;br /&gt;
This shader combine reflection and refraction that depends on the viewing angle.&lt;br /&gt;
&lt;br /&gt;
'''What is refraction?''' &lt;br /&gt;
According to the &amp;quot;OpenGL Shading Language Book&amp;quot;, refraction is the blending of light as it passes trough a boundary between surfaces with different optical densities.&lt;br /&gt;
&lt;br /&gt;
'''Requirements:'''&amp;lt;BR/&amp;gt;&lt;br /&gt;
- A cube map texture.&lt;br /&gt;
&lt;br /&gt;
== The shader ==&lt;br /&gt;
Can be put in the ATTRIBPASS or AMBIENT context to be used with the examples pipelines in the Horde3D SDK 1.0 beta.&lt;br /&gt;
&lt;br /&gt;
'''Vertex shader:'''&lt;br /&gt;
In the vertex shader, you can freely change the indices of refraction or the degree of reflectivity to change de final result.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Fresnel - Vertex Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
const float Eta = 0.67;          // Ratio of indices of refraction (air -&amp;gt; glass)&lt;br /&gt;
const float FresnelPower = 10.0; // Controls degree of reflectivity at grazing angles&lt;br /&gt;
&lt;br /&gt;
const float F  = ((1.0 - Eta) * (1.0 - Eta)) / ((1.0 + Eta) * (1.0 + Eta));&lt;br /&gt;
&lt;br /&gt;
varying vec3  Reflect;&lt;br /&gt;
varying vec3  Refract;&lt;br /&gt;
varying float Ratio;&lt;br /&gt;
&lt;br /&gt;
attribute vec3 normal;&lt;br /&gt;
&lt;br /&gt;
uniform vec3 viewer;&lt;br /&gt;
&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
    vec4 worldPosition = calcWorldPos( gl_Vertex );&lt;br /&gt;
    vec3 ecPosition3  = worldPosition.xyz - viewer;//viewer - worldPosition.xyz;&lt;br /&gt;
&lt;br /&gt;
    vec3 i = normalize(ecPosition3);&lt;br /&gt;
    vec3 n = normalize( calcWorldVec(normal) );&lt;br /&gt;
&lt;br /&gt;
    Ratio = F + (1.0 - F) * pow((1.0 - dot(-i, n)), FresnelPower);&lt;br /&gt;
    //Ratio = 1.0 - Ratio; // Add this line if your cube map is not based on the right side&lt;br /&gt;
&lt;br /&gt;
    Refract = refract(i, n, Eta);&lt;br /&gt;
    Refract = vec3(gl_TextureMatrix[0] * vec4(Refract, 1.0));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Reflect = reflect(i, n);&lt;br /&gt;
    Reflect = vec3(gl_TextureMatrix[0] * vec4(Reflect, 1.0));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    gl_Position   = gl_ModelViewProjectionMatrix * worldPosition;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
'''Fragment shader:'''&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description=  Fresnel - Vertex Shader|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
varying vec3  Reflect;&lt;br /&gt;
varying vec3  Refract;&lt;br /&gt;
varying float Ratio;&lt;br /&gt;
&lt;br /&gt;
uniform samplerCube tex0;&lt;br /&gt;
&lt;br /&gt;
void main(void)&lt;br /&gt;
{&lt;br /&gt;
    vec3 refractColor = vec3 (textureCube(tex0, Refract));&lt;br /&gt;
    vec3 reflectColor = vec3 (textureCube(tex0, Reflect));&lt;br /&gt;
&lt;br /&gt;
    vec3 color   = mix(refractColor, reflectColor, Ratio);&lt;br /&gt;
&lt;br /&gt;
    gl_FragColor = vec4(color, 1.0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== How to use it == &lt;br /&gt;
You must create a material in wich the shader is defined as the fresnel shader. Then, you must add the Texture unit 0 with a cube map type texture.&lt;br /&gt;
&lt;br /&gt;
== Example Result == &lt;br /&gt;
&lt;br /&gt;
To do.&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
http://img143.imageshack.us/img143/2072/fresnel3ej6.png&lt;br /&gt;
&lt;br /&gt;
== To-Do List for this Article ==&lt;br /&gt;
- Better explanation &amp;lt;br /&amp;gt;&lt;br /&gt;
- An example&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
|  valign=&amp;quot;top&amp;quot; | {{Extension_Summary&lt;br /&gt;
|name = Technique - Fresnel&lt;br /&gt;
|screenshot = &lt;br /&gt;
|description = Using reflection and refraction&lt;br /&gt;
|version = 1.0&lt;br /&gt;
|horde3dversion = 1.0 beta&lt;br /&gt;
|released = 2008-08-10&lt;br /&gt;
|author = [http://www.horde3d.org/forums/memberlist.php?mode=viewprofile&amp;amp;u=154 Mikmacer]|&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
[[category: Technique]]&lt;/div&gt;</summary>
		<author><name>Mikmacer</name></author>	</entry>

	</feed>