<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - Passing variable value to shader question?]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=1025&amp;type=atom"/>
	<updated>2014-07-17T14:20:41Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=1025</id>
		<entry>
			<title type="html"><![CDATA[Re: Passing variable value to shader question?]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6998#p6998"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Skywriter]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2629</uri>
			</author>
			<updated>2014-07-17T14:20:41Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6998#p6998</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Passing variable value to shader question?]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6997#p6997"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2014-07-17T13:27:31Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6997#p6997</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Passing variable value to shader question?]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6996#p6996"/>
			<content type="html"><![CDATA[<p>Hi. Is it possible by some way to pass variable to shader by script? For examle time.</p>]]></content>
			<author>
				<name><![CDATA[Skywriter]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2629</uri>
			</author>
			<updated>2014-07-17T10:56:58Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6996#p6996</id>
		</entry>
</feed>
