<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - Outline via glsl?]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=56</link>
		<description><![CDATA[The most recent posts in Outline via glsl?.]]></description>
		<lastBuildDate>Thu, 17 Mar 2011 18:08:22 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Outline via glsl?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=240#p240</link>
			<description><![CDATA[<p>Yep - that made it.</p><p>Nice. Thumb up.<br />Thanx for all your help and work!</p>]]></description>
			<author><![CDATA[dummy@example.com (Kralle)]]></author>
			<pubDate>Thu, 17 Mar 2011 18:08:22 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=240#p240</guid>
		</item>
		<item>
			<title><![CDATA[Re: Outline via glsl?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=230#p230</link>
			<description><![CDATA[<p>I will watch to correct the full example, but for now you can try this :</p><p>vec3 N = normalize(normal);</p><p>float ink = dot(normalize(-position), N);<br />ink = clamp(pow(ink*3.0, 20.0), 0.0, 1.0);</p><p>gl_FragColor = vec4(ink, ink, ink, 1.0);</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Wed, 16 Mar 2011 12:05:22 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=230#p230</guid>
		</item>
		<item>
			<title><![CDATA[Re: Outline via glsl?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=229#p229</link>
			<description><![CDATA[<p>how, strange... thank you for the reply.<br />There is maybe a clamp computation or a negative value working differently on your 3d card,<br />it&#039;s probably a small thing to check. I will have a look, if you can also try to modify the shader<br />on your machine tell us.</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Wed, 16 Mar 2011 11:34:36 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=229#p229</guid>
		</item>
		<item>
			<title><![CDATA[Re: Outline via glsl?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=226#p226</link>
			<description><![CDATA[<p>As it looks for me...<br /><a href="http://img855.imageshack.us/i/inkshade.jpg/">http://img855.imageshack.us/i/inkshade.jpg/</a></p>]]></description>
			<author><![CDATA[dummy@example.com (Kralle)]]></author>
			<pubDate>Tue, 15 Mar 2011 18:41:22 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=226#p226</guid>
		</item>
		<item>
			<title><![CDATA[Re: Outline via glsl?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=224#p224</link>
			<description><![CDATA[<p>Nice - i will take a look at it.<br />---<br />mmmh - the ink shader looks strange.<br />it seems to be 45 degree rotated (on my system). <br />I can see half white and half black on the teacup.<br />Will post a screen later (after work).</p>]]></description>
			<author><![CDATA[dummy@example.com (Kralle)]]></author>
			<pubDate>Mon, 14 Mar 2011 10:23:44 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=224#p224</guid>
		</item>
		<item>
			<title><![CDATA[Re: Outline via glsl?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=223#p223</link>
			<description><![CDATA[<p>It&#039;s not exactly what you need but I made a simple ink shader example there :<br /><a href="http://www.maratis3d.org/?p=548">http://www.maratis3d.org/?p=548</a></p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Mon, 14 Mar 2011 10:19:10 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=223#p223</guid>
		</item>
		<item>
			<title><![CDATA[Re: Outline via glsl?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=178#p178</link>
			<description><![CDATA[<p>Yes, i agree for the environment, it&#039;s globally not a pretty technique. Stay in touch with the website news, I will publish more example and post process will be one.</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Fri, 04 Mar 2011 09:08:46 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=178#p178</guid>
		</item>
		<item>
			<title><![CDATA[Re: Outline via glsl?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=177#p177</link>
			<description><![CDATA[<p>Thanx for the fast answer.</p><p>Yeah - i know the &quot;cheap&quot; trick. <br />It works very well on playermodels and static props (boxes, barrels, crates, furniture, etc.)<br />but it&#039;s insane if you want outline in the enviroment, you can&#039;t duplicate and scale the whole level itself.</p>]]></description>
			<author><![CDATA[dummy@example.com (Kralle)]]></author>
			<pubDate>Thu, 03 Mar 2011 11:18:04 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=177#p177</guid>
		</item>
		<item>
			<title><![CDATA[Re: Outline via glsl?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=176#p176</link>
			<description><![CDATA[<p>Hi,<br />for cell shading, you can do it using a glsl shader that you link using blender and custom material,<br />like example named &quot;cartoon t-pot&quot;. Look in &quot;Example/Demos/shaders/&quot; for glsl simple cartoon example.</p><p>For outlines, it depend on the technique you want to use,<br />but it will generally be a post process effect comparing pixels depth and/or normals.</p><p>Post process is not implemented as a one clic feature yet,<br />it can only be done manually using c++ and game plugin,<br />I&#039;m working on a example for this, I hope to finish it soon.</p><p>If you are not programming, there is a &quot;cheap&quot; technique to do outlines,<br />it&#039;s not very evolved but it can give good results and doesn&#039;t need shaders.<br />Using blender, you duplicate your mesh, scale it a little bit and reverse the normals,<br />you then apply to this copy a black material. The copy will create an outilne thanks to z-buffer,<br />it is not a pretty technique, but it has been used in lots of commercial games.<br />(in blender, make sure to disable &quot;double sided&quot; for both meshs)</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Thu, 03 Mar 2011 11:02:21 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=176#p176</guid>
		</item>
		<item>
			<title><![CDATA[Outline via glsl?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=174#p174</link>
			<description><![CDATA[<p>Hi - Just to get it right (inside my brain..)</p><p>If i want normal rendering and also a black outline (like in toon shading but without the toon shading)...<br />Then i need to write a glsl shader and add them in the blender export panel under materials/maritas/customshader in the vertex/fragment shader slots?</p><p>Found goggling the following code, haven&#039;t been able to test it yet, but could it work?</p><p>for Vertex: <br />varying vec3 normal, lightDir; <br />varying vec2 texCoord; <br />void main() <br />{&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; vec4 ecPos; <br />&nbsp; &nbsp; &nbsp; &nbsp; ecPos = vec4(gl_ModelViewMatrix * gl_Vertex); <br />&nbsp; &nbsp; &nbsp; &nbsp; lightDir = normalize(vec3(gl_LightSource[0].position) - ecPos.xyz); <br />&nbsp; &nbsp; &nbsp; &nbsp; normal = normalize(gl_NormalMatrix * gl_Normal); <br />&nbsp; &nbsp; &nbsp; &nbsp; texCoord = vec2(gl_MultiTexCoord0); <br />&nbsp; &nbsp; &nbsp; &nbsp; gl_Position = ftransform(); <br />} </p><p>for Fragment: <br />varying vec3 normal, lightDir; <br />varying vec2 texCoord; <br />uniform sampler2D texture; <br />void main() <br />{ <br />&nbsp; &nbsp; &nbsp; &nbsp; float intensity; <br />&nbsp; &nbsp; &nbsp; &nbsp; vec3 n; <br />&nbsp; &nbsp; &nbsp; &nbsp; vec4 _color; <br />&nbsp; &nbsp; &nbsp; &nbsp; n = normalize(normal); <br />&nbsp; &nbsp; &nbsp; &nbsp; intensity = dot(lightDir, n); <br />&nbsp; &nbsp; &nbsp; &nbsp; if (intensity &gt; 0.98) <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _color = vec4(1.0,1.0,1.0,1.0); <br />&nbsp; &nbsp; &nbsp; &nbsp; else if (intensity &gt; 0.5) <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _color = vec4(0.8,0.8,0.8,1.0); <br />&nbsp; &nbsp; &nbsp; &nbsp; else if (intensity &gt; 0.35) <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _color = vec4(0.4,0.4,0.4,1.0); <br />&nbsp; &nbsp; &nbsp; &nbsp; else <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _color = vec4(0.0,0.0,0.0,1.0);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; gl_FragColor = _color * texture2D(texture, texCoord);&nbsp; &nbsp;<br />}</p>]]></description>
			<author><![CDATA[dummy@example.com (Kralle)]]></author>
			<pubDate>Wed, 02 Mar 2011 15:54:44 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=174#p174</guid>
		</item>
	</channel>
</rss>
