<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - Passing variable value to shader question?]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=1025</link>
		<description><![CDATA[The most recent posts in Passing variable value to shader question?.]]></description>
		<lastBuildDate>Thu, 17 Jul 2014 14:20:41 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Passing variable value to shader question?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6998#p6998</link>
			<description><![CDATA[<p>So as far as i understand i have to create a &quot;Game.ll&quot; and create a behaviour? <br />One more question-how do you get &quot;mesh&quot; and &quot;render&quot;?</p>]]></description>
			<author><![CDATA[dummy@example.com (Skywriter)]]></author>
			<pubDate>Thu, 17 Jul 2014 14:20:41 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6998#p6998</guid>
		</item>
		<item>
			<title><![CDATA[Re: Passing variable value to shader question?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6997#p6997</link>
			<description><![CDATA[<p>Not right now, but it can be done in c++ :</p><div class="codebox"><pre><code>    float time = 0.0f;

    MMaterial * material = mesh-&gt;getMaterial(0);
    if(material)
    {
        MFXRef * FXRef = material-&gt;getFXRef();
        if(FXRef)
        {
            unsigned int fxId = FXRef-&gt;getFXId();
            render-&gt;bindFX(fxId);

            // send uniform variable
            render-&gt;sendUniformFloat(fxId, &quot;time&quot;, &amp;time);

            render-&gt;bindFX(0);
        }
    }</code></pre></div><p>Or you can use a trick :<br />- in Blender, animate a material variable you don&#039;t use in your shader : &quot;MaterialShininess&quot; for example<br />- use &quot;uniform float MaterialShininess;&quot; as your time variable</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Thu, 17 Jul 2014 13:27:31 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6997#p6997</guid>
		</item>
		<item>
			<title><![CDATA[Passing variable value to shader question?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6996#p6996</link>
			<description><![CDATA[<p>Hi. Is it possible by some way to pass variable to shader by script? For examle time.</p>]]></description>
			<author><![CDATA[dummy@example.com (Skywriter)]]></author>
			<pubDate>Thu, 17 Jul 2014 10:56:58 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6996#p6996</guid>
		</item>
	</channel>
</rss>
