I should mention that GUI Items can now use pixel shaders though. That is how the "wobbly" effect on the alien buy menu is done if you want to see an example. I think the shader code is compiled in the release builds though so I can post an example of that if needed.
<!--quoteo(post=1857532:date=Jul 1 2011, 01:32 PM:name=MurphyIdiot)--><div class='quotetop'>QUOTE (MurphyIdiot @ Jul 1 2011, 01:32 PM) <a href="index.php?act=findpost&pid=1857532"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I should mention that GUI Items can now use pixel shaders though. That is how the "wobbly" effect on the alien buy menu is done if you want to see an example. <u>I think the shader code is compiled in the release builds though so I can post an example of that if needed</u>.<!--QuoteEnd--></div><!--QuoteEEnd-->
An example of uncompiled shader code? Hmm something i've never dealt with before, but i'll still accept the example if it's no trouble.
That is GUIWavyNoMask.surface_shader inside the shaders directory. It is compiled in the release build but the game will compile it if it is plain text like this.
BTW, if anyone wants to improve this effect I'll be watching this thread ;)
Comments
An example of uncompiled shader code? Hmm something i've never dealt with before, but i'll still accept the example if it's no trouble.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><shader>
<inputs>
<input name="baseTexture" type="texture" address="wrap" />
</inputs>
<code>
void MaterialShader(bool textured, float2 texCoord, float4 color, inout Material material)
{
float wavyAmount = 1;
float2 resultCoord = texCoord;
resultCoord.x += ((sin((resultCoord.y + cos(time)) * wavyAmount * 10) * 0.002 + 0.002) / (1.0 + 2 * 0.002)) * resultCoord.y;
resultCoord.y += ((sin((resultCoord.x + cos(time - 0.5)) * wavyAmount * 10) * 0.002 + 0.002) / (1.0 + 2 * 0.002)) * resultCoord.x;
material.resultColor = tex2D(baseTexture, resultCoord) * color;
}
</code>
</shader><!--c2--></div><!--ec2-->
That is GUIWavyNoMask.surface_shader inside the shaders directory. It is compiled in the release build but the game will compile it if it is plain text like this.
BTW, if anyone wants to improve this effect I'll be watching this thread ;)