<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>KLAKOS</title>
	<atom:link href="http://klakos.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://klakos.com</link>
	<description>Faites des jeux, pas la guerre.</description>
	<lastBuildDate>Wed, 22 Feb 2012 22:23:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Scenario</title>
		<link>http://klakos.com/scenario/</link>
		<comments>http://klakos.com/scenario/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 18:59:08 +0000</pubDate>
		<dc:creator>Aniel</dc:creator>
				<category><![CDATA[Scenario]]></category>

		<guid isPermaLink="false">http://klakos.com/?p=2782</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<table border="0" cellspacing="40" cellpadding="5" width="455" align="center">
<tbody>
<tr>
<td><a href="http://www.amazon.fr/s/ref=nb_sb_noss?__mk_fr_FR=%C5M%C5Z%D5%D1&amp;url=search-alias%3Dstripbooks&amp;field-keywords=stevostin&amp;x=0&amp;y=0" target="_blank"><img class="alignleft size-medium wp-image-2786" title="Stevostin sur Amazon" src="http://klakos.com/wp-content/uploads/2012/02/stevostin-T1-lien-207x300.png" alt="" width="207" height="300" /></a></td>
<td><a href="http://www.pauljorion.com/blog/?p=15382" target="_blank"><img class="alignleft size-medium wp-image-2788" title="La survie de l'espèce prochainement chez Futuropolis" src="http://klakos.com/wp-content/uploads/2012/02/survie-de-lespèce_preview-copie-207x300.png" alt="" width="207" height="300" /></a></td>
</tr>
<tr>
<td><a href="http://www.amazon.fr/Ruppert-Car-Ton-Bien-Est/dp/2351002172/ref=sr_1_3?ie=UTF8&amp;qid=1329926190&amp;sr=8-3"><img class="alignleft size-medium wp-image-2792" title="Ruppert sur Amazon" src="http://klakos.com/wp-content/uploads/2012/02/preview_ruppert-207x300.png" alt="" width="207" height="300" /></a></td>
<td></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://klakos.com/scenario/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Etudes de personnages</title>
		<link>http://klakos.com/etudes-de-personnages/</link>
		<comments>http://klakos.com/etudes-de-personnages/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 14:11:03 +0000</pubDate>
		<dc:creator>Aniel</dc:creator>
				<category><![CDATA[Personnages]]></category>

		<guid isPermaLink="false">http://klakos.com/?p=2751</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<table border="0" cellspacing="25" cellpadding="15" width="450" align="center">
<tbody>
<tr>
<td style="text-align: center;"><a href="http://klakos.com/wp-content/uploads/2012/02/etude_mercenaire.jpg" rel="shadowbox[post-2751];player=img;"><img class="aligncenter size-full wp-image-2752" title="Modèle 1" src="http://klakos.com/wp-content/uploads/2012/02/cadre-site_characterdesign_3-copie2.png" alt="" width="200" height="200" /></a></td>
<td><a href="http://klakos.com/wp-content/uploads/2012/02/etude_pistoleroina.jpg" rel="shadowbox[post-2751];player=img;"><img class="aligncenter size-full wp-image-2753" title="Modèle 2" src="http://klakos.com/wp-content/uploads/2012/02/pistoleroina_preview-copie.png" alt="" width="200" height="200" /></a></td>
</tr>
<tr>
<td><a href="http://klakos.com/wp-content/uploads/2012/02/destroyerman_mini.jpg" rel="shadowbox[post-2751];player=img;"><img class="aligncenter size-full wp-image-2754" title="Modèle 3" src="http://klakos.com/wp-content/uploads/2012/02/preview_destroyer-copie.png" alt="" width="200" height="200" /></a></td>
<td><a href="http://klakos.com/wp-content/uploads/2012/02/TheDoctor_etude.png" rel="shadowbox[post-2751];player=img;"><img class="aligncenter size-full wp-image-2755" title="Modèle 4" src="http://klakos.com/wp-content/uploads/2012/02/preview_charlatan-copie.png" alt="" width="200" height="200" /></a></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://klakos.com/etudes-de-personnages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shaders double face</title>
		<link>http://klakos.com/2552/</link>
		<comments>http://klakos.com/2552/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 14:36:54 +0000</pubDate>
		<dc:creator>Aniel</dc:creator>
				<category><![CDATA[Shader]]></category>

		<guid isPermaLink="false">http://klakos.com/?p=2552</guid>
		<description><![CDATA[Shader double face (transparent shadow caster) (prise en compte de la transparence pour la projection des ombres) 6000+ view sur unify community (MàJ janv. 2012) Etude complète, mise à disposition du code sous licence LGPL Shader double face (transparent shadow receiver) (prise en compte de la transparence pour la projection des ombres avec les Spot/Point [...]]]></description>
			<content:encoded><![CDATA[<h1 style="text-align: center;">Shader double face (transparent shadow caster)</h1>
<p style="text-align: center;">(prise en compte de la transparence pour la projection des ombres)</p>
<table border="0" cellspacing="5" cellpadding="5" width="450" align="center">
<tbody>
<tr style="text-align: center;">
<td>
<h4><a title="Shader sur unify community" href="http://www.unifycommunity.com/wiki/index.php?title=TransparentShadowCaster" target="_blank">6000+ view sur unify community (MàJ janv. 2012)</a></h4>
</td>
<td>
<h4><a href="http://klakos.com/drapeau-ondulant-shader-pour-unity-double-sided-alpha-shadow-support/" target="_blank">Etude complète, mise à disposition du code sous licence LGPL</a></h4>
</td>
</tr>
<tr>
<td><a title="unify community" href="http://www.unifycommunity.com/wiki/index.php?title=TransparentShadowCaster" target="_blank"><img class="aligncenter size-full wp-image-2726" title="Shader sur unify community" src="http://klakos.com/wp-content/uploads/2012/02/unifycommunity-copie.png" alt="" width="200" height="200" /></a></td>
<td><a href="http://klakos.com/drapeau-ondulant-shader-pour-unity-double-sided-alpha-shadow-support/" target="_blank"><img class="aligncenter size-full wp-image-2727" title="Etude complète sur klakos.com" src="http://klakos.com/wp-content/uploads/2012/02/lien-blog-shader1-copie.png" alt="" width="200" height="200" /></a></td>
</tr>
</tbody>
</table>
<h1 style="text-align: center;">Shader double face (transparent shadow receiver)</h1>
<p style="text-align: center;">(prise en compte de la transparence pour la projection des ombres avec les Spot/Point lights et les Directional lights)</p>
<table border="0" cellspacing="5" cellpadding="5" width="450" align="center">
<tbody>
<tr style="text-align: center;">
<td>
<h4><a href="http://www.unifycommunity.com/wiki/index.php?title=TransparentShadowReceiver" target="_blank">2500 + view sur unify community (MàJ janv. 2012)</a></h4>
</td>
<td>
<h4><a href="http://klakos.com/en/fully-shadowed-transparent-shader-for-unity-shadows-receiving-support-from-spotpoint-and-directional-lights/">Etude complète, mise à disposition du code sous licence LGPL</a></h4>
</td>
</tr>
<tr>
<td><a title="unify community" href="http://www.unifycommunity.com/wiki/index.php?title=TransparentShadowReceiver" target="_blank"><img class="aligncenter size-full wp-image-2726" title="Lien sur unify community" src="http://klakos.com/wp-content/uploads/2012/02/unifycommunity-copie.png" alt="" width="200" height="200" /></a></td>
<td><a href="http://klakos.com/en/fully-shadowed-transparent-shader-for-unity-shadows-receiving-support-from-spotpoint-and-directional-lights/" target="_blank"><img class="aligncenter size-full wp-image-2727" title="Etude complète sur klakos.com" src="http://klakos.com/wp-content/uploads/2012/02/lien-blog-shader1-copie.png" alt="" width="200" height="200" /></a></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://klakos.com/2552/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Catalogue des Prestations</title>
		<link>http://klakos.com/2381/</link>
		<comments>http://klakos.com/2381/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 10:35:16 +0000</pubDate>
		<dc:creator>Aniel</dc:creator>
				<category><![CDATA[Service]]></category>

		<guid isPermaLink="false">http://klakos.com/?p=2381</guid>
		<description><![CDATA[Shader Programing Character Design Scenario Illustration Asset 2D 3D Character C# Programing Scripting Python]]></description>
			<content:encoded><![CDATA[<table style="text-align: center;" border="0" cellspacing="5" cellpadding="5" width="455">
<tbody>
<tr>
<td width="220">
<h3><a href="http://klakos.com/site/blog/accueil_blog/services/shader-services/" target="_blank"><strong><img class="aligncenter size-full wp-image-2712" title="Accès à la présentation de shaders sur unify community" src="http://klakos.com/wp-content/uploads/2012/02/cadre-site_shader-copie.png" alt="" width="200" height="200" />Shader Programing</strong></a></h3>
</td>
<td width="220">
<h3><a href="http://klakos.com/site/blog/accueil_blog/services/personnages/" target="_blank"><img class="aligncenter size-full wp-image-2714" title="Accès à la présentation d'études de personnages" src="http://klakos.com/wp-content/uploads/2012/02/cadre-site_characterdesign_3-copie1.png" alt="" width="200" height="200" /><strong>Character Design</strong></a></h3>
</td>
</tr>
<tr>
<td width="220"></td>
<td width="220"></td>
</tr>
<tr>
<td width="220">
<h3><strong><img class="aligncenter size-full wp-image-2715" title="cadre site_scenario copie" src="http://klakos.com/wp-content/uploads/2012/02/cadre-site_scenario-copie1.png" alt="" width="200" height="200" />Scenario</strong></h3>
</td>
<td width="220">
<h3><img class="aligncenter size-full wp-image-2716" title="cadre site_illustration copie" src="http://klakos.com/wp-content/uploads/2012/02/cadre-site_illustration-copie1.png" alt="" width="200" height="200" />Illustration</h3>
</td>
</tr>
<tr>
<td width="220">
<h3><strong><img class="aligncenter size-full wp-image-2717" title="cadre site_assets2D copie" src="http://klakos.com/wp-content/uploads/2012/02/cadre-site_assets2D-copie1.png" alt="" width="200" height="200" />Asset 2D</strong></h3>
</td>
<td width="220">
<h3><strong><img class="aligncenter size-full wp-image-2718" title="cadre site_charlatan copie" src="http://klakos.com/wp-content/uploads/2012/02/cadre-site_charlatan-copie1.png" alt="" width="200" height="200" />3D Character</strong></h3>
</td>
</tr>
<tr>
<td width="220"></td>
<td width="220"></td>
</tr>
<tr>
<td width="220">
<h3><strong><img class="aligncenter size-full wp-image-2720" title="cadre site_awesomium copie" src="http://klakos.com/wp-content/uploads/2012/02/cadre-site_awesomium-copie2.png" alt="" width="200" height="200" />C# Programing</strong></h3>
</td>
<td width="220">
<h3><strong><img class="aligncenter size-full wp-image-2721" title="cadre site_template copie" src="http://klakos.com/wp-content/uploads/2012/02/cadre-site_template-copie1.png" alt="" width="200" height="200" />Scripting Python</strong></h3>
</td>
</tr>
<tr>
<td width="220"></td>
<td width="220"></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://klakos.com/2381/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CG, Video Game, Multimedia</title>
		<link>http://klakos.com/cg-et-multimedia/</link>
		<comments>http://klakos.com/cg-et-multimedia/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 13:51:50 +0000</pubDate>
		<dc:creator>Aniel</dc:creator>
				<category><![CDATA[Activités-encart]]></category>

		<guid isPermaLink="false">http://klakos.com/?p=2438</guid>
		<description><![CDATA[3D : Blender, 3DS Max, sculptris 2D : Photoshop, Illustrator, High Logic Font Creator Game and Multimedia Engine : Unity 3D, Flash Shading : Crazy bump, RenderMonkey Server-side technology : easyPHP, PHP, ASP.Net (Photon, SmartFox, RakNet, Darkstar, aka Redwarf) Methods : Project planification &#38; SCRUM]]></description>
			<content:encoded><![CDATA[<ul>
<li>3D : Blender, 3DS Max, sculptris</li>
<p><br/></p>
<li>2D : Photoshop, Illustrator, High Logic Font Creator</li>
<p><br/></p>
<li>Game and Multimedia Engine : Unity 3D, Flash</li>
<p><br/></p>
<li>Shading : Crazy bump, RenderMonkey</li>
<p><br/></p>
<li>Server-side technology : easyPHP, PHP, ASP.Net (Photon, SmartFox, RakNet, Darkstar, aka Redwarf)</li>
<p><br/></p>
<li>Methods : Project planification &amp; SCRUM</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://klakos.com/cg-et-multimedia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software development</title>
		<link>http://klakos.com/software-development/</link>
		<comments>http://klakos.com/software-development/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 12:38:07 +0000</pubDate>
		<dc:creator>Aniel</dc:creator>
				<category><![CDATA[Activités-encart]]></category>

		<guid isPermaLink="false">http://klakos.com/?p=2428</guid>
		<description><![CDATA[Languages : C#, Python, Java, Action Script, C/C++ Analysis methods : UML, Merise IDE : Visual Studio, Eclipse, Flash develop, Notepad ++ Building tools : Ant, Maven Source control : Mercurial, SVN, Perforce, Visual source safe Unit testing : NUnit, JUnit Automatic Documentation : Doxygen]]></description>
			<content:encoded><![CDATA[<ul>
<li>Languages : C#, Python, Java, Action Script, C/C++</li>
<p><br/></p>
<li>Analysis methods : UML, Merise</li>
<p><br/></p>
<li>IDE : Visual Studio, Eclipse, Flash develop, Notepad ++</li>
<p><br/></p>
<li>Building tools : Ant, Maven</li>
<p><br/></p>
<li>Source control : Mercurial, SVN, Perforce, Visual source safe</li>
<p><br/></p>
<li>Unit testing : NUnit, JUnit</li>
<p><br/></p>
<li>Automatic Documentation : Doxygen</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://klakos.com/software-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bibliothèques</title>
		<link>http://klakos.com/bibliotheques/</link>
		<comments>http://klakos.com/bibliotheques/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 11:44:29 +0000</pubDate>
		<dc:creator>Aniel</dc:creator>
				<category><![CDATA[Activités-encart]]></category>

		<guid isPermaLink="false">http://klakos.com/?p=2420</guid>
		<description><![CDATA[EZ GUI Behave iTween Pool manager]]></description>
			<content:encoded><![CDATA[<ul>
<li>EZ GUI</li>
<li>Behave</li>
<li>iTween</li>
<li>Pool manager</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://klakos.com/bibliotheques/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gestion Complète des Ombres pour un Shader Transparent (Unity)</title>
		<link>http://klakos.com/gestion-complete-des-ombres-pour-un-shader-transparent-unity/</link>
		<comments>http://klakos.com/gestion-complete-des-ombres-pour-un-shader-transparent-unity/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 09:52:31 +0000</pubDate>
		<dc:creator>golgauth</dc:creator>
				<category><![CDATA[Le blog]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[alpha shadow]]></category>
		<category><![CDATA[directional]]></category>
		<category><![CDATA[directional light]]></category>
		<category><![CDATA[forwardbase]]></category>
		<category><![CDATA[point]]></category>
		<category><![CDATA[point light]]></category>
		<category><![CDATA[rendering path]]></category>
		<category><![CDATA[shadow]]></category>
		<category><![CDATA[spot]]></category>
		<category><![CDATA[spot light]]></category>
		<category><![CDATA[transparency]]></category>
		<category><![CDATA[transparent shader]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://klakos.com/?p=2166</guid>
		<description><![CDATA[<ul>
	<li>* Gestion avancée des ombres pour un "surface shader" ShaderLab Transparent</li>
	<li>* Travailler en rendering path “Forward” et le Lightmode “ForwardBase”</li>
	<li>* Activer les ombres depuis n'importe quel type de Light (Méthodes 1 et 2)</li>
	<li>* Composer une scène à partir de vues en mode “Forward” et “Deferred Lighting”</li>
</ul>]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #cccccc;">&gt;&gt;&gt; Sommaire</p>
<ul>
<li>* Gestion avancée des ombres pour un &laquo;&nbsp;surface shader&nbsp;&raquo; ShaderLab Transparent</li>
<li>* Travailler en rendering path “Forward” et le Lightmode “ForwardBase”</li>
<li>* Activer les ombres depuis n&#8217;importe quel type de Light (Méthodes 1 et 2)</li>
<li>* Composer une scène à partir de vues en mode “Forward” et “Deferred Lighting”</li>
</ul>
<p style="text-align: center;"><a href="http://klakos.com/gestion-complete-des-ombres-pour-un-shader-transparent-unity/image1/" rel="attachment wp-att-2167"><img src="http://klakos.com/wp-content/uploads/2011/09/image1.png" alt="" title="image1" width="250" height="190" class="aligncenter size-full wp-image-2167" /></a></p>
<p><br/><br/><span id="more-2166"></span><br />
Cet article n&#8217;est, pour l&#8217;instant, disponible qu&#8217;en version anglaise.</p>
]]></content:encoded>
			<wfw:commentRss>http://klakos.com/gestion-complete-des-ombres-pour-un-shader-transparent-unity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Klakos le SDK en pré-réservation</title>
		<link>http://klakos.com/release-dune-integration-client-serveur-klakos-le-sdk-en-pre-reservation/</link>
		<comments>http://klakos.com/release-dune-integration-client-serveur-klakos-le-sdk-en-pre-reservation/#comments</comments>
		<pubDate>Thu, 19 May 2011 08:49:56 +0000</pubDate>
		<dc:creator>Aniel</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Photon server]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[Subsonic]]></category>
		<category><![CDATA[Unity 3D]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://klakos.com/?p=2111</guid>
		<description><![CDATA[Nous avons le plaisir de vous annoncer que nous allons commercialiser une intégration client-serveur complète sous la forme d'un SDK.]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Dans le cadre de nos projets en cours, nous avons mis en place une intégration complète permettant de soutenir un système client serveur 3D temps réel complet codé en C#.</p>
<p><br/><br />
<br/></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2130" title="realtime3D_integration" src="http://klakos.com/wp-content/uploads/2011/05/realtime3D_integration.png" alt="" width="450" height="315" /><br />
<br/><br />
<br/>
</p>
<p style="text-align: center;">
<p style="text-align: justify;">Il comprend</p>
<p><br/></p>
<ul style="text-align: justify;">
<li>coté client : un 	moteur de jeu connecté à un système de base de donnée via un 	outil de gestion de base de donnée automatisé.</li>
</ul>
<ul style="text-align: justify;">
<li>coté serveur : un 	serveur connecté à un système de base de donnée via un outil de 	gestion de base de donnée automatisé. La gestion des listes 	d&#8217;utilisateurs se fait via le BackEnd WordPress. La récupération de données de jeu automatique (par exemple pour la publication de classements de joueurs) est également assurée par des modules WordPress.</li>
</ul>
<p><br/></p>
<p style="text-align: justify;">Nous avons le plaisir de vous annoncer que nous allons commercialiser cette intégration sous la forme d&#8217;un <strong>SDK</strong> incluant le <strong>code source complet</strong>. Tous les éléments de l&#8217;intégration sont soit sous licence libre soit disposent d&#8217;une licence d&#8217;utilisation (limitée ou non) gratuite. Seuls vos impératifs de production ou l&#8217;exploitation commerciale à large échelle de votre application vous imposera l&#8217;achat de licence(s) tierce(s).</p>
<p><br/></p>
<p style="text-align: justify;"><strong>Klakos le SDK sera disponible pour essai sous la forme d&#8217;une DLL</strong> et d&#8217;un jeu de données d&#8217;essai dans 15 jours. <strong>10</strong> licences d&#8217;utilisation commerciale seront concédées au prix de 5000€ HT (<strong>monde entier, nombre d&#8217;application illimité, pas de royalties</strong>).</p>
<p><br/></p>
<p style="text-align: justify;">Pour plus de renseignement, contactez Jean Christophe sur <script type="text/javascript">
/* <![CDATA[ */
function wp_enkoder(){var kode=
"kode=\")\\\'\\\'(nioj.)(esrever.)\\\'\\\'(tilps.edok=edok;\\\"kode=\\\"\\"+
"\\)\\\\\\\\\\\'\\\\\\\\\\\\\\\'\\\\(nioj.)(esrever.)\\\\\\\\\\\'\\\\\\\\\\"+
"\\\\\'\\\\(tilps.edok=edok;\\\\\\\\\\\"\\\\kode=\\\\\\\\\\\"\\\\\\\\\\\\\\"+
"\\\\\\;)\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\>a"+
"/<moc.sokalk@tcatnoc>\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\"+
"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"+
"\\moc.sokalk@tcatnoc:otliam\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\"+
"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"+
"\\\\\\\\=ferh a<\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\"+
"\\\\\\(etirw.tnemucod\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\;kode=kode.split(\\\\"+
"\\\\\\\'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\\\\\\\\\\\\\\\\\\\\).reverse().jo"+
"in(\\\\\\\\\\\'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\\\\\\\\\\\\\\\\\\\\)\\\\\\"+
"\\\\\"\\\\=edok\\\"\\\\;kode=kode.split(\\\'\\\\\\\'\\\\).reverse().join("+
"\\\'\\\\\\\'\\\\)\\\"=edok\";kode=kode.split(\'\').reverse().join(\'\')"
;var i,c,x;while(eval(kode));}wp_enkoder();
/* ]]&gt; */
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://klakos.com/release-dune-integration-client-serveur-klakos-le-sdk-en-pre-reservation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drapeau ondulant, Shader pour Unity (Double sided, Alpha shadow support)</title>
		<link>http://klakos.com/drapeau-ondulant-shader-pour-unity-double-sided-alpha-shadow-support/</link>
		<comments>http://klakos.com/drapeau-ondulant-shader-pour-unity-double-sided-alpha-shadow-support/#comments</comments>
		<pubDate>Sun, 08 May 2011 00:00:54 +0000</pubDate>
		<dc:creator>golgauth</dc:creator>
				<category><![CDATA[Le blog]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[alpha shadow]]></category>
		<category><![CDATA[blowing flag]]></category>
		<category><![CDATA[bumped]]></category>
		<category><![CDATA[double sided]]></category>
		<category><![CDATA[parallax]]></category>
		<category><![CDATA[shader]]></category>
		<category><![CDATA[specular]]></category>
		<category><![CDATA[Unity]]></category>
		<category><![CDATA[unity 3.3.0f4 compatible]]></category>
		<category><![CDATA[Unity 3D]]></category>
		<category><![CDATA[waving flag]]></category>

		<guid isPermaLink="false">http://klakos.com/?p=1902</guid>
		<description><![CDATA[<ul>
	<li>* Animation des vertex d'un drapeau via un shader (trigonométrie)</li>
	<li>* Usage avancé des "Surface Shaders" (ShaderLab) pour gérer la transparence</li>
	<li>* Ajout d'une passe de "Shadow" (supporte l'Alpha)</li>
	<li>* Méthodes de rendu double-faces (Double-sided) (méthodes 1, 2 et 3)</li>
	<li>* Assistant de configuration des "Materials" double-faces (pour la méthode 3)</li>
</ul>]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #cccccc;">&gt;&gt;&gt; Sommaire</p>
<ul>
<li>* Animation des vertex d&#8217;un drapeau via un shader (trigonométrie)</li>
<li>* Usage avancé des &laquo;&nbsp;Surface Shaders&nbsp;&raquo; (ShaderLab) pour gérer la transparence</li>
<li>* Ajout d&#8217;une passe de &laquo;&nbsp;Shadow&nbsp;&raquo; (supporte l&#8217;Alpha)</li>
<li>* Méthodes de rendu double-faces (Double-sided) (méthodes 1, 2 et 3)</li>
<li>* Assistant de configuration des &laquo;&nbsp;Materials&nbsp;&raquo; double-faces (pour la méthode 3)</li>
</ul>
<p><br/></p>
<div style="text-align: center;"></div>
<p><span id="more-1902"></span><br />
<br/></p>
<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #cccccc;">&gt;&gt;&gt; Téléchargements</p>
<ul>
<li>- Version PDF de cet article : <a href="http://www.klakos.com/downloads/WavingFlag/WavingFlag.pdf">WavingFlag.pdf</a></li>
<li>- Assistant de configuration : <a href="http://www.klakos.com/downloads/WavingFlag/BackwardMaterialBuilder.cs">BackwardMaterialBuilder.cs</a></li>
<li>- Package Unity 3.3.0f4 : <a href="http://www.klakos.com/downloads/WavingFlag/WavingFlagDemo.unitypackage">WavingFlagDemo.unitypackage</a> | <a href="http://www.klakos.com/downloads/WavingFlag/WavingFlagDemo.rar">WavingFlagDemo.rar</a></li>
</ul>
<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #cccccc;">&gt;&gt;&gt; Animation des vertex d&#8217;un drapeau via un shader ShaderLab (Unity 3)</p>
<p><br/></p>
<p style="margin-bottom: 0cm;">Ref : <a href="http://forum.unity3d.com/threads/19575-waving-flag-shader-feedback-please">http://forum.unity3d.com/threads/19575-waving-flag-shader-feedback-please</a>!</p>
<p><br/></p>
<p style="margin-bottom: 0cm;">Partant de ce post, j&#8217;ai développé l&#8217;idée. Voici quelques informations sur l&#8217;animation des vertex d&#8217;un &laquo;&nbsp;Mesh&nbsp;&raquo; directement dans un shader.</p>
<p><br/><br />
[CODE]<br />
<code></p>
<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #ffff99;">void computeWave (inout appdata_full v, inout v2f o)<br />
{<br />
float sinOff=(v.vertex.x+v.vertex.y+v.vertex.z) * _WaveStrength;<br />
float t=-_Time*_WaveSpeed;<br />
float fx=v.texcoord.x;<br />
float fy=v.texcoord.x*v.texcoord.y;<br />
v.vertex.x+=sin(t*1.45+sinOff)*fx*0.5;<br />
v.vertex.y=(sin(t*3.12+sinOff)*fx*0.5-fy*0.9);<br />
v.vertex.z-=(sin(t*2.2+sinOff)*fx*0.2);<br />
o.pos = mul( UNITY_MATRIX_MVP, v.vertex );<br />
o.uv = v.texcoord;<br />
}</code></p>
<p><br/></p>
<p style="margin-bottom: 0cm;">Ceci est l&#8217;algorithme original tel que conçu par &laquo;&nbsp;cboe&nbsp;&raquo; et &laquo;&nbsp;Seon&nbsp;&raquo; &#8211; voir le lien ci-dessus.</p>
<p style="margin-bottom: 0cm;">J&#8217;y ai simplement ajouté un paramètre “_WaveStrength”, permettant d&#8217;obtenir un drapeau plus réactif, pour les jours de tempête.</p>
<p><br/></p>
<p style="margin-bottom: 0cm;">[FIG 1]</p>
<p><br/></p>
<p style="text-align: center;"><a href="http://klakos.com/?attachment_id=1919"><img class="size-full wp-image-1919  aligncenter" title="fig1" src="http://klakos.com/wp-content/uploads/2011/05/fig1.png" alt="" width="358" height="402" /></a></p>
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm; background: none repeat scroll 0% 0% #cccccc;">&gt;&gt;&gt; Usage avancé des &laquo;&nbsp;Surface Shaders&nbsp;&raquo; (ShaderLab) pour gérer la transparence</p>
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">Les “Surface” shaders, disponibles sous Unity 3 sont simples et puissants (à l&#8217;exception du fait qu&#8217;ils n&#8217;autorisent pas le &laquo;&nbsp;multi-passes&nbsp;&raquo; – voir plus loin dans ce doc.)</p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">Quoi qu&#8217;il en soit, ce sont eux que j&#8217;ai choisi pour accomplir cette étude.</p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p><br/><br />
[CODE]</p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm; background: none repeat scroll 0% 0% #ffff99;"><code><br />
Tags {<br />
"Queue"="Geometry"<br />
"IgnoreProjector"="True"<br />
"RenderType"="Transparent"<br />
}<br />
LOD 300<br />
CGPROGRAM<br />
#pragma surface surf BlinnPhong alpha vertex:vert fullforwardshadows approxview<br />
#include "FlagWaveCG.cginc"<br />
half _Shininess;<br />
sampler2D _BumpMap;<br />
float _Parallax;<br />
struct Input {<br />
float2 uv_MainTex;<br />
float2 uv_BumpMap;<br />
};<br />
v2f vert (inout appdata_full v) {<br />
v2f o;<br />
computeWave(v, o);<br />
return o;<br />
}<br />
void surf (Input IN, inout SurfaceOutput o) {<br />
fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);<br />
o.Albedo = tex.rgb * _Color.rgb;<br />
o.Gloss = tex.a;<br />
o.Alpha = tex.a * _Color.a;<br />
o.Specular = _Shininess;<br />
o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));<br />
}<br />
ENDCG<br />
</code></p>
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">Détails concernant le code ci-dessus :</p>
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">&gt; <span style="text-decoration: underline;">Les Tags</span> :</p>
<ul>
<li>
<p style="margin-bottom: 0cm;">- Il est important d&#8217;utiliser le paramètre “Geometry”, pour la file de rendu, afin de conserver une position correcte en terme de profondeur dans le flux de rendu (habituellement “Transparent” est utilisé pour les objets transparents, mais, dans notre cas, nous souhaitons avoir un drapeau qui soit bien agencé dans notre &laquo;&nbsp;scene graph&nbsp;&raquo; &#8211; les objets qui sont devant lui doivent le cacher, et il doit cacher ceux qui sont derrière lui).</p>
</li>
<p><br/></p>
<li>
<p style="margin-bottom: 0cm;">- Le type de rendu “Transparent”, a également sont importance : c&#8217;est lui qui permet d&#8217;obtenir les trous dans la surface de l&#8217;objet (en utilisant la couche Alpha de la texture principale).</p>
</li>
</ul>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">&gt; <span style="text-decoration: underline;">“#pragma surface surf BlinnPhong alpha vertex:vert fullforwardshadows approxview”</span> :</p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">Cette ligne est assez complexe, mais les éléments à en retenir sont :</p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<ul>
<li>
<p style="margin-bottom: 0cm;">- L&#8217;option “alpha” : permet un &laquo;&nbsp;beau&nbsp;&raquo; rendu des pixels semi-transparents (ceci diffère du simple “Cutoff”, qui, lui, affiche ou non les pixels sans demie-mesure.</p>
</li>
</ul>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">Cette option nécessite d&#8217;être accompagnée de l&#8217;instruction “o.Alpha = tex.a * _Color.a;” (dans la fonction &#8216;surf&#8217;).</p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">[FIG 2.1]</p>
<p><br/></p>
<p style="text-align: center;"><a href="http://klakos.com/?attachment_id=1920"><img class="aligncenter size-full wp-image-1920" title="fig2.1" src="http://klakos.com/wp-content/uploads/2011/05/fig2.1.png" alt="" width="327" height="331" /></a></p>
<p><br/><br />
[FIG 2.2]<br />
<br/></p>
<p style="text-align: center;"><a href="http://klakos.com/?attachment_id=1921"><img class="size-full wp-image-1921  aligncenter" title="fig2.2" src="http://klakos.com/wp-content/uploads/2011/05/fig2.2.png" alt="" width="327" height="331" /></a></p>
<p><br/><br />
Dans la figure [FIG 2.1], nous voyons ostensiblement l&#8217;aliasing autour des zones transparentes; là où la fusion avec le fond devrait être douce (puisqu&#8217;elle l&#8217;est dans ma texture principale).<br />
<br/><br />
Dans la figure [FIG 2.2] : le résultat en activant l&#8217;option “alpha”.<br />
<br/><br />
<span style="text-decoration: underline;">Attention</span> : Cette manière de faire peut entraîner des soucis en cas d&#8217;utilisation des &laquo;&nbsp;Skybox&nbsp;&raquo; toutes faites de Unity&#8230; Donc, il convient d&#8217;être vigilant en ce qui concerne la gestion de la file de rendu (Render Queue).</p>
<ul>
<li>- La déclaration “vertex:vert” : où &#8216;vert&#8217; est la fonction utilisée pour opérer sur les vertex. Comme vu précédemment, c&#8217;est elle qui est sollicitée pour animer la position des vertex (fonction &#8216;computeWave&#8217;).</li>
<p>	<br/></p>
<li>- L&#8217;option “fullforwardshadows” : permet de forcer notre drapeau à recevoir les ombres, bien qu&#8217;en “alpha” :</li>
</ul>
<p><br/><br />
[FIG 3]<br />
<br/></p>
<p style="text-align: center;"><a href="http://klakos.com/?attachment_id=1922"><img class="size-full wp-image-1922  aligncenter" title="fig3" src="http://klakos.com/wp-content/uploads/2011/05/fig3.png" alt="" width="372" height="402" /></a></p>
<p><br/><br />
Ici, les drapeaux reçoivent les ombres projetées par l&#8217;objet solide, en haut à gauche.</p>
<p>Note : Ces ombres projetées ne gênent en rien au niveau des zones de transparence (voir zone entourée de rouge).<br />
<br/><br />
Ils projettent aussi des ombres sur eux-même :<br />
<br/><br />
[FIG 4]<br />
<br/></p>
<p style="text-align: center;"><a href="http://klakos.com/?attachment_id=1923"><img class="aligncenter size-full wp-image-1923" title="fig4" src="http://klakos.com/wp-content/uploads/2011/05/fig4.png" alt="" width="358" height="402" /></a></p>
<ul>
<li>- L&#8217;option “approxview” : sert, ici, à économiser des instructions de calcul (néanmoins : perte quand la caméra est très proche du sujet).</li>
</ul>
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm; background: none repeat scroll 0% 0% #cccccc;">&gt;&gt;&gt; Ajout d&#8217;une passe de &laquo;&nbsp;Shadow&nbsp;&raquo; (supporte l&#8217;Alpha)</p>
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">Pour rendre tout cela plus réaliste, le drapeau devrait aussi projeter des ombres sur son environnement; et ces ombres doivent être en concordance avec ses déformations.</p>
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">Dans ce cadre, nous devons ajouter une passe de rendu supplémentaire au shader :</p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p><br/><br />
[CODE]</p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm; background: none repeat scroll 0% 0% #ffff99;"><code><br />
Pass<br />
{<br />
Name "ShadowCaster"<br />
Tags { "LightMode" = "ShadowCaster" }<br />
Fog {Mode Off}<br />
ZWrite On ZTest Less Cull Off<br />
Offset 1, 1<br />
CGPROGRAM<br />
#pragma exclude_renderers gles<br />
#pragma vertex vert<br />
#pragma fragment frag<br />
#pragma fragmentoption ARB_precision_hint_fastest<br />
#pragma multi_compile_shadowcaster<br />
#include "FlagWaveCG.cginc"<br />
v2f vert( appdata_full v )<br />
{<br />
v2f o;<br />
computeWave(v, o);<br />
TRANSFER_SHADOW_CASTER(o)<br />
return o;<br />
}<br />
float4 frag( v2f i ) : COLOR<br />
{<br />
fixed4 texcol = tex2D( _MainTex, i.uv );<br />
clip( texcol.a - _Cutoff );<br />
SHADOW_CASTER_FRAGMENT(i)<br />
}<br />
ENDCG<br />
}<br />
</code></p>
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">Dans cette passe, nous appliquons, d&#8217;abord, (fonction &#8216;vert&#8217;) une transformation ondulatoire d&#8217;UV, avec la même fonction que celle utilisée précédemment dans la passe de type &laquo;&nbsp;Surface&nbsp;&raquo; (fonction &#8216;computeWave&#8217;), puis, nous sommons le moteur de rendu de projeter l&#8217;ombre du drapeau en fonction de sa nouvelle géométrie, en temps réel (instruction &#8216;TRANSFER_SHADOW_CASTER&#8217;).</p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">Pour finir, nous voulons que l&#8217;ombre reflète les trous dans le drapeau &#8211; les zones transparentes de la texture principale : ceci sera effectué dans la fonction &#8216;frag&#8217;, où l&#8217;ombre est découpée par rapport à un seuil donné par la couche Alpha de cette texture (instruction &#8216;SHADOW_CASTER_FRAGMENT&#8217;).</p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;"><span style="text-decoration: underline;">Note</span> : Le seuil peut être personnalisé en modulant le paramètre  “_Cutoff”, dynamiquement, ou directement depuis le fenêtre &#8216;Inspector&#8217; de Unity.</p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm; background: none repeat scroll 0% 0% #cccccc;">&gt;&gt;&gt; Conclusion Intermédiaire :</p>
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">Bien, nous en avons terminé avec la première partie : concevoir un très très joli drapeau aux mouvement ondulatoires d&#8217;un réalisme complètement fou. Vous en avez donc également terminé, si votre objectif était de n&#8217;afficher qu&#8217;un drapeau qui ne serait regardé que de face. La suite de ce document consiste à obtenir une surface à double-faces (double-sided) &#8211; qu&#8217;on puisse au moins tourner autour du drapeau dans un FPS ! Pour cela, différentes méthodes peuvent être envisagées (qui possèdent, bien entendu, toutes, des avantages et des inconvénients).</p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;"><span style="text-decoration: underline;">Le code source complet pour le shader dont nous avons parlé jusqu&#8217;ici</span> : </p>
<p><br/></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p>[CODE] / Le fichier &#8216;.cginc&#8217; partagé inclus : FlagWaveCG.cginc [<a href="http://www.klakos.com/downloads/WavingFlag/FlagWaveCG.cginc">télécharger le fichier</a>]</p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm; background: none repeat scroll 0% 0% #ffff99;"><code><br />
#include "UnityCG.cginc"<br />
float4 _Color;<br />
sampler2D _MainTex;<br />
fixed _Cutoff;<br />
float _WaveSpeed;<br />
float _WaveStrength;<br />
struct v2f {<br />
V2F_SHADOW_CASTER;<br />
float2 uv : TEXCOORD1;<br />
};<br />
void computeWave (inout appdata_full v, inout v2f o)<br />
{<br />
float sinOff=(v.vertex.x+v.vertex.y+v.vertex.z) * _WaveStrength;<br />
float t=-_Time*_WaveSpeed;<br />
float fx=v.texcoord.x;<br />
float fy=v.texcoord.x*v.texcoord.y;<br />
v.vertex.x+=sin(t*1.45+sinOff)*fx*0.5;<br />
v.vertex.y=(sin(t*3.12+sinOff)*fx*0.5-fy*0.9);<br />
v.vertex.z-=(sin(t*2.2+sinOff)*fx*0.2);<br />
o.pos = mul( UNITY_MATRIX_MVP, v.vertex );<br />
o.uv = v.texcoord;<br />
}<br />
</code></p>
<p style="text-indent: 0.03cm; margin-bottom: 0cm;">
<p><br/><br />
[CODE] / Le fichier principal du &laquo;&nbsp;Surface Shader&nbsp;&raquo; : FlagWave-Advanced.shader [<a href="http://www.klakos.com/downloads/WavingFlag/FlagWave-Advanced.shader">télécharger le fichier</a>]</p>
<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #ffff99;"><code><br />
// Original shader by cboe - Mar, 23, 2009<br />
// Enhanced to 3 axis movement by Seon - Jan, 21, 2010<br />
// Added _WaveSpeed by Eric5h5 - Jan, 26, 2010<br />
// CHANGE LOG - Gauthier BOAGLIO (golgauth) / Klakos - May, 07, 2011 :<br />
// 		- Added Transparency support<br />
// 		- Added Spec and Normal mapping support<br />
// 		- Added Shadow casting support (+ Shadow Alpha and Shadow Alpha cutoff support)<br />
//				[Done in the "ShadowCaster" additional Pass]<br />
//		- Added advanced double-sided rendering support<br />
// 		- Added _WaveStrength param<br />
//<br />
// Requirements: assumes you are using a subdivided plane created with X (width) * Z (height) where Y is flat.<br />
// Requirements: assumes UV as: left X (U0) is attatched to pole, and Top Z (V1) is at top of pole.<br />
//<br />
// See [ http://klakos.com/en/advanced-waving-flag-shader-for-unity-double-sided-alpha-shadow-support-2/ ] for<br />
// visuals and more informations<br />
Shader "Selfmade/for-2sided/FlagWave Advanced Regular"<br />
{<br />
Properties<br />
{<br />
// Ususal stuffs<br />
_Color ("Main Color", Color) = (1,1,1,1)<br />
_SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0)<br />
_Shininess ("Shininess", Range (0.01, 1)) = 0.078125<br />
_MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {}<br />
// Bump stuffs<br />
//_Parallax ("Height", Range (0.005, 0.08)) = 0.02<br />
_BumpMap ("Normalmap", 2D) = "bump" {}<br />
//_ParallaxMap ("Heightmap (A)", 2D) = "black" {}<br />
// Shadow Stuff<br />
_Cutoff ("Shadow Alpha cutoff", Range(0.25,0.9)) = 1.0<br />
// Flag Stuffs<br />
_WaveSpeed ("Wave Speed", Range(0.0, 300.0)) = 50.0<br />
_WaveStrength ("Wave Strength", Range(0.0, 5.0)) = 1.0<br />
}<br />
SubShader<br />
{<br />
Tags {<br />
"Queue"="Geometry"<br />
"IgnoreProjector"="True"<br />
"RenderType"="Transparent"}<br />
LOD 300<br />
Pass<br />
{<br />
Name "ShadowCaster"<br />
Tags { "LightMode" = "ShadowCaster" }<br />
Fog {Mode Off}<br />
ZWrite On ZTest Less Cull Off<br />
Offset 1, 1<br />
CGPROGRAM<br />
#pragma exclude_renderers gles<br />
#pragma vertex vert<br />
#pragma fragment frag<br />
#pragma fragmentoption ARB_precision_hint_fastest<br />
#pragma multi_compile_shadowcaster<br />
#include "FlagWaveCG.cginc"<br />
v2f vert( appdata_full v )<br />
{<br />
v2f o;<br />
computeWave(v, o);<br />
TRANSFER_SHADOW_CASTER(o)<br />
return o;<br />
}<br />
float4 frag( v2f i ) : COLOR<br />
{<br />
fixed4 texcol = tex2D( _MainTex, i.uv );<br />
clip( texcol.a - _Cutoff );<br />
SHADOW_CASTER_FRAGMENT(i)<br />
}<br />
ENDCG<br />
}<br />
CGPROGRAM<br />
#pragma surface surf BlinnPhong alpha vertex:vert fullforwardshadows approxview<br />
#include "FlagWaveCG.cginc"<br />
half _Shininess;<br />
sampler2D _BumpMap;<br />
//sampler2D _ParallaxMap;<br />
float _Parallax;<br />
struct Input {<br />
float2 uv_MainTex;<br />
float2 uv_BumpMap;<br />
//float3 viewDir;<br />
};<br />
v2f vert (inout appdata_full v) {<br />
v2f o;<br />
computeWave(v, o);<br />
return o;<br />
}<br />
void surf (Input IN, inout SurfaceOutput o) {<br />
// Comment the next 4 following lines to get a standard bumped rendering<br />
// [Without Parallax usage, which can cause strange result on the back side of the plane]<br />
/*half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w;<br />
float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir);<br />
IN.uv_MainTex += offset;<br />
IN.uv_BumpMap += offset;*/<br />
fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);<br />
o.Albedo = tex.rgb * _Color.rgb;<br />
o.Gloss = tex.a;<br />
o.Alpha = tex.a * _Color.a;<br />
//clip(o.Alpha - _Cutoff);<br />
o.Specular = _Shininess;<br />
o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));<br />
}<br />
ENDCG<br />
}<br />
Fallback "Transparent/VertexLit"<br />
}<br />
</code></p>
<p><br/></p>
<p style="margin-bottom: 0cm;">
<p style="margin-bottom: 0cm;">
<p style="margin-bottom: 0cm;"><span style="text-decoration: underline;">Note</span> : Si vous souhaitez utiliser ce shader tel-quel et voulez activer le &laquo;&nbsp;parallax&nbsp;&raquo;, vous aurez à jongler avec le nombre d&#8217;instructions autorisées dans la fonction &#8216;surf&#8217; (limité à 64 &#8211; Voir aussi “#pragma target 3.0”, pour augmenter ce nombre). Ajouter des instructions va immanquablement vous pousser à en supprimer d&#8217;autres (ce shader étant déjà relativement chargé &#8211; ex : “fullforwardshadows” est un peu lourd, c&#8217;est la raison  pour laquelle j&#8217;ai dû y adjoindre “approxview”).</p>
<p style="margin-bottom: 0cm;">
<p style="margin-bottom: 0cm;">
<p style="margin-bottom: 0cm;">
<p><br/></p>
<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #cccccc;">&gt;&gt;&gt; Méthodes de rendu double-faces (Double-sided) (méthodes 1, 2 and 3)</p>
<p><br/></p>
<p style="margin-bottom: 0cm;">
<p style="margin-bottom: 0cm;"><strong>&gt;&gt; <span style="text-decoration: underline;">La Méthode du “Mesh Doublé”</span> :</strong></p>
<p><br/></p>
<p style="margin-bottom: 0cm;">Cette méthode est fréquemment utilisée pour sa simplicité et son efficacité, suivant l&#8217;objectif visé.</p>
<p style="margin-bottom: 0cm;">Il s&#8217;agit de dupliquer le mesh du plan, en gardant le même &laquo;&nbsp;Material&nbsp;&raquo; que pour le mesh originel; mais en en inversant les normales des faces via votre outil de modélisation 3D préféré (c&#8217;est-à-dire Blender <img src='http://klakos.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ).</p>
<p style="margin-bottom: 0cm;">
<p><br/></p>
<p style="margin-bottom: 0cm;"><span style="text-decoration: underline;">Avantages</span> : Facile</p>
<p><br/></p>
<p style="margin-bottom: 0cm;"><span style="text-decoration: underline;">inconvénients</span> : A chaque fois que le mesh doit être modifié, le second aussi : cette opération peut s&#8217;avérer compliquée et chronophage.</p>
<p style="margin-bottom: 0cm;">
<p><br/></p>
<p style="margin-bottom: 0cm;"><strong>&gt;&gt; <span style="text-decoration: underline;">La Méthode “CULL Off”</span> :</strong></p>
<p><br/></p>
<p style="margin-bottom: 0cm;">Celle-ci est également simple à mettre en œuvre :</p>
<p style="margin-bottom: 0cm;">Il nous suffit d&#8217;éditer notre précédent shader et d&#8217;y ajouter l&#8217;instruction “CULL Off”, juste avant de débuter le corps du  “CGPROGRAM”, comme suit :</p>
<p style="margin-bottom: 0cm;">
<p><br/><br />
[CODE]</p>
<p style="margin-bottom: 0cm;">
<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #ffff99;"><code><br />
CULL Off<br />
CGPROGRAM<br />
#pragma surface surf BlinnPhong alpha vertex:vert fullforwardshadows approxview<br />
#include "FlagWaveCG.cginc"<br />
.<br />
.<br />
.<br />
</code></p>
<p><br/><br />
La commande “CULL” peut prendre 3 valeurs :</p>
<ul>
<li>- “Back” (la valeur par défaut) : cache les faces arrières</li>
<li>- “Front” : ne montre que les faces arrières</li>
<li>- “Off” : fait le rendu de toutes les faces</li>
</ul>
<p><br/><br />
[FIG 5]<br />
<br/></p>
<p style="text-align: center;"><a href="http://klakos.com/?attachment_id=1924"><img class="aligncenter size-full wp-image-1924" title="fig5" src="http://klakos.com/wp-content/uploads/2011/05/fig5.png" alt="" width="568" height="576" /></a></p>
<ul>Bien, ça marche, mais il semblerait que j&#8217;aie perdu mon Bump, ma Spec, et bien d&#8217;autres choses&#8230;</ul>
<p><br/><br />
<span style="text-decoration: underline;">Avantages</span> : Simple, inclus au shader (donc le mesh peut être modifié à volonté, sans affecter le rendu).<br />
<br/><br />
<a name="result_box"></a><span style="text-decoration: underline;">inconvénients</span> : Les faces arrière sont bien affichées, mais elles héritent de l&#8217;éclairage des faces avant (dans la figure [FIG 5], il apparaît que le drapeau est plongé dans la noirceur X-). Exception faite de certains cas bien précis, ça n&#8217;est pas du tout satisfaisant.<br />
<br/><br />
<strong>&gt;&gt; <span style="text-decoration: underline;">La Méthode “Flip Normals Via Shader”</span> :</strong><br />
<br/><br />
Celle que je préfère !<br />
<br/><br />
Ref : <a href="http://forum.unity3d.com/threads/61882-U3-Add-2-sided-to-AlphaTest-Bumped.shader">http://forum.unity3d.com/threads/61882-U3-Add-2-sided-to-AlphaTest-Bumped.shader</a></p>
<p>[Big thanks to Daniel Brauer]<br />
<br/><br />
L&#8217;objet de cette méthode est de traiter séparément les faces avant et arrière du Mesh du plan. Pour faire ceci, et du fait que nous travaillons avec des &laquo;&nbsp;Surface Shaders&nbsp;&raquo; (souvenez-vous que ces derniers ne supportent pas le &laquo;&nbsp;multi-passes&nbsp;&raquo;*), nous sommes dans l&#8217;obligation de créer deux Shaders/Materials pour chaque type de faces.<br />
<br/><br />
*Note : Si c&#8217;était le cas, nous aurions pu utiliser un Shader/Material unique constitué de deux passes (une pour les faces avant et une autre pour les faces arrière), au lieu de deux&#8230;<br />
<br/><br />
<span style="text-decoration: underline;">Etape 1</span> :<br />
<br/><br />
Choisir un shader (parmi ceux intégrés à Unity<br />
[ <a href="http://unity3d.com/support/resources/assets/built-in-shaders">http://unity3d.com/support/resources/assets/built-in-shaders</a> ], ou un de votre cru).<br />
<br/><br />
Note : La valeur de “CULL” doit être : “Back” (ou, encore, pas d&#8217;instruction “CULL” du tout). Ce Material / Shader doit, en effet, n&#8217;affecter que les faces avant !<br />
<br/><br />
<span style="text-decoration: underline;">Etape 2</span> :<br />
<br/><br />
L&#8217;affecter à un un Material fraîchement créé sous Unity, et configurer selon les besoins.<br />
<br/><br />
<span style="text-decoration: underline;">Etape 3</span> :<br />
<br/><br />
Ajouter ce Material à la liste des Materials du composant Renderer de l&#8217;objet plan du drapeau.<br />
<br/><br />
<span style="text-decoration: underline;">Etape 4</span> :<br />
<br/><br />
Créer le Shader pour les faces arrière.</p>
<p>Pour ce faire, simplement éditer le shader précédent [appelons le : “Regular” shader] et le sauvegarder sous un autre nom [appelons ce dernier : le “Backward” shader].<br />
<br/><br />
Puis, quelques modiques modifications :</p>
<p>Nous n&#8217;avons, ici, pas besoin de changer le comportement général (Bump, &#8230;) du shader : les faces arrière doivent avoir, à priori, les mêmes réactions à la lumière que les faces avant. Tout ce que nous voulons, c&#8217;est avoir des faces arrière correctement orientées lorsqu&#8217;elles sont affichées (c&#8217;est-à-dire, face à l&#8217;objectif) : Le jeu étant d&#8217;inverser la direction des normales directement via le shader :<br />
<br/><br />
1- Ajouter une directive “CULL Front” (comme exposé précédemment dans le doc. pour “CULL Off”)</p>
<p>2- Inverser les normales au moment de les déployer/unpacking, comme suit (un “moins” devant la commande “UnpackNormal”) :<br />
<br/><br />
[CODE] &#8211; [<a href="http://www.klakos.com/downloads/WavingFlag/FlagWave-Advanced-2sided.shader">télécharger le fichier</a>]</p>
<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #ffff99;"><code><br />
CULL Front<br />
CGPROGRAM<br />
#pragma surface surf BlinnPhong alpha vertex:vert fullforwardshadows approxview<br />
.<br />
.<br />
.<br />
void surf (Input IN, inout SurfaceOutput o) {<br />
o.Gloss = tex.a;<br />
o.Alpha = tex.a * _Color.a;<br />
.<br />
.<br />
.<br />
o.Specular = _Shininess;<br />
o.Normal = -UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));<br />
}<br />
ENDCG<br />
</code></p>
<p><br/><br />
<span style="text-decoration: underline;">Etape 5</span> :<br />
<br/><br />
Affecter le “Backward” shader à un Material nouvellement créé, et le configurer comme le “Regular” shader.<br />
<br/><br />
<span style="text-decoration: underline;">Etape 6</span> :<br />
<br/><br />
Ajouter ce second Material à la liste des Materials du Renderer de l&#8217;objet plan du drapeau.<br />
<br/><br />
<span style="text-decoration: underline;">Etape 7</span> :<br />
<br/><br />
Voilà !</p>
<p>Vous pouvez tourner l&#8217;objet dans n&#8217;importe quel sens, déplacer ou ajouter des Lights, modifier le Mesh. Tout devrait bien se passer&#8230;<br />
<br/><br />
[FIG 6]<br />
<br/></p>
<p style="text-align: center;"><a href="http://klakos.com/?attachment_id=1925"><img class="aligncenter size-full wp-image-1925" title="fig6" src="http://klakos.com/wp-content/uploads/2011/05/fig6.png" alt="" width="473" height="803" /></a></p>
<p><br/><br />
<strong>Ces tous derniers paramétrages donnent :</strong><br />
<br/></p>
<div style="text-align: center;"></div>
<p><br/><br />
<span style="text-decoration: underline;">Avantages</span> : Principalement, le fait qu&#8217;on ne travaille que sur un seul Mesh et que les deux côtés de l&#8217;objet sont rendus correctement, sans pour autant perdre en qualité (transparency, shadowing, &#8230;), implémentée au fil de ce document.<br />
<br/><br />
<span style="text-decoration: underline;">inconvénients</span> : Nécessite 2 Materials (qui ont le même paramétrage) [voir “Assistant de Configuration”, pour plus de facilité à configurer et synchroniser les “Regular” =&gt; “Backward” materials]<br />
<br/></p>
<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #cccccc;">&gt;&gt;&gt; Assitant de Configuration des &laquo;&nbsp;Materials&nbsp;&raquo; Double-Faces (pour la méthode 3)</p>
<p><br/></p>
<p style="margin-bottom: 0cm;">
<p><strong>&gt; <span style="text-decoration: underline;">Description</span> :</strong></p>
<p>Cet outil est destiné à faciliter l&#8217;exécution des étapes énoncées précédemment. En particulier, la nécessité de synchroniser les Materials des faces avant et arrière.<br />
<br/><br />
<strong>&gt; <span style="text-decoration: underline;">Prérequis</span> :</strong></p>
<ul>1- Conventions de nommage pour les shaders.</ul>
<p>En premier lieu, bien garder en tête que, pour des raisons de simplicité, cet outil est partiellement basé sur des conventions de noms :</p>
<ul>
<li>- Les noms des Shaders de type Front/Forward doivent se terminer par le suffixe “Regular”</li>
<li>- Les noms des Shaders de type Back/Backward doivent se terminer par le suffixe “Backward”</li>
</ul>
<p>Ces conventions se rapportent exclusivement aux noms donnés aux Shaders (voir en-tête &laquo;&nbsp;Shader&nbsp;&raquo; des shaders), et non aux noms des Materials.<br />
<br/><br />
[CODE]</p>
<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #ffff99;"><code><br />
Shader "Selfmade/for-2sided/FlagWave Advanced Regular"<br />
{<br />
Properties<br />
{<br />
// Usual stuffs<br />
_Color ("Main Color", Color) = (1,1,1,1)<br />
_SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0)<br />
.<br />
.<br />
.<br />
</code></p>
<ul>2- Les Materials (au sens d&#8217;assets Unity) doivent être créés manuellement, et cet outil n&#8217;est destiné qu&#8217;à faciliter leur configuration.</ul>
<ul>3- Les différents Shaders utilisés doivent avoir été créés au préalable.</ul>
<p><br/><br />
<strong>&gt; <span style="text-decoration: underline;">Installation</span> :</strong></p>
<p>Juste faire glisser le script “<a title="BackwardMaterialBuilder.cs" href="http://www.klakos.com/downloads/BackwardMaterialBuilder.cs">BackwardMaterialBuilder.cs</a>” (ScriptableWizard) dans le répertoire “Assets/Editor” du projet Unity.<br />
<br/><br />
<strong>&gt; <span style="text-decoration: underline;">Usage</span> :</strong></p>
<p>Pour accéder à l&#8217;assistant, sélectionner un objet (depuis l&#8217;onglet &laquo;&nbsp;Hierarchy&nbsp;&raquo; ou &laquo;&nbsp;Project&nbsp;&raquo;). Puis, click-droit sur l&#8217;icône du menu contextuel du Renderer (valable aussi bien pour les MeshRenderers que pour les SkinnedMeshRenderers), et choisir “Set 2-sided Materials” :<br />
<br/><br />
[FIG 7]<br />
<br/></p>
<p style="text-align: center;"><a href="http://klakos.com/?attachment_id=1926"><img class="size-full wp-image-1926  aligncenter" title="fig7" src="http://klakos.com/wp-content/uploads/2011/05/fig7.png" alt="" width="471" height="263" /></a></p>
<p><br/></p>
<p style="text-align: left;">La fenêtre correspondante liste tous les materials ayant un “Regular” shader de la liste de Materials du Renderer :</p>
<p><br/><br />
[FIG 8]<br />
<br/></p>
<p style="text-align: center;"><a href="http://klakos.com/?attachment_id=1927"><img class="size-full wp-image-1927  aligncenter" title="fig8" src="http://klakos.com/wp-content/uploads/2011/05/fig8.png" alt="" width="540" height="527" /></a></p>
<p style="text-align: center;">
<p><br/><br />
Ensuite, sélectionner un des Materials et cliquer sur “Proceed”.<br />
<br/><br />
Si le “Backward” Shader correspondant existe dans le projet, 3 opportunités peuvent se présenter :</p>
<ul>
<li>- La synchronisation des propriétés des Materials de type “Regular” vers “Backward”, si ces Materials existent déjà</li>
<li>- La création de la version “Backward” du Material celle-ci n&#8217;existe pas (sans toucher au shader)</li>
<li>- Ecraser ou non le Shader actuel de l&#8217;actuel “Target Backup Material”</li>
</ul>
<p>Puis, faire glisser un Material de votre choix depuis le dossier “Assets” vers le champ “Target Backup Material”.<br />
<br/><br />
L&#8217;option “Force Shader” est destinée à remplacer sciemment, le “Backward” Shader approprié vers le Material ciblé.</p>
<p>Si cette option est décochée, le Shader d&#8217;origine du Material demeure inchangé.</p>
<p>Dans la plupart des cas, cette option doit être activée (mais elle comporte le risque d&#8217;écraser toute la configuration courante du Material ciblé &#8211; Ctrl-Z is your friend, anyway&#8230;).<br />
<br/><br />
[FIG 9]<br />
<br/></p>
<p style="text-align: center;"><a href="http://klakos.com/?attachment_id=1928"><img class="aligncenter size-full wp-image-1928" title="fig9" src="http://klakos.com/wp-content/uploads/2011/05/fig9.png" alt="" width="527" height="270" /></a></p>
<p><br/><br />
<br/></p>
<p style="background: none repeat scroll 0% 0% #ff950e;"><br/><span style="font-family: Verdana,sans-serif;"><span style="font-size: medium;"><strong>Big Conclusion</strong></span></span><br/></p>
<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #cccccc;"><br/></p>
<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #cccccc;">Ben&#8230; Pas plus, en fait&#8230;</p>
<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #cccccc;">Hope this will help,</p>
<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #cccccc;">et n&#8217;hésitez pas à poster des retours (j&#8217;ai besoin de vous pour m&#8217;aider à améliorer ce doc.)</p>
<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #cccccc;">Thanks &#038; Enjoy!</p>
<p style="margin-bottom: 0cm; background: none repeat scroll 0% 0% #cccccc;"><br/></p>
<p style="margin-bottom: 0cm;">
<p style="margin-bottom: 0cm;">
<p style="text-align: left;">
<p><br/></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 14249px; width: 1px; height: 1px; overflow: hidden;">
<p><span style="font-family: Verdana,sans-serif;"><span style="font-size: medium;"><strong>&gt;&gt;&gt; Flag vertices animation via ShaderLab shader (Unity 3)</strong></span></span>
</div>
]]></content:encoded>
			<wfw:commentRss>http://klakos.com/drapeau-ondulant-shader-pour-unity-double-sided-alpha-shadow-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

