Each Shadergen Level Scrolls a Different Direction - broken?
by Dave Calabrese · in Torque Game Engine Advanced · 02/18/2008 (4:54 pm) · 3 replies
I am attempting to create a planet shader, where the cloud layer would scroll a different direction from the base layer. However, it scrolls the same direction as the base layer despite what I do. But if I separate it out into its own material, it then scrolls the direction I want it to. Is this a bug or am I doing something wrong? Here's my code:
Thanks in advance!
-Dave C.
21-6 Productions
new Material(planetdiffuse_shaderGen)
{
mapTo = "planetdiffuse";
baseTex[0] = "planetdiffuse_shaderGen.png";
bumpTex[0] = "planetnormals_Shadergen.png";
diffuse[0] = "1.0 1.0 1.0 1.0";
specular[0] = "0.0470588 0.243137 0.482353 1.0";
specularPower[0] = 10.0;
pixelSpecular[0] = true;
exposure[0] = 0;
glow[0] = false;
emissive[0] = false;
castShadow[0] = false;
breakable[0] = false;
doubleSided[0] = false;
translucent[0] = false;
translucentBlendOp[0] = None;
translucentZWrite[0] = false;
dynamicCubemap[0] = false;
planarReflection[0] = false;
scrollDir[0] = "-0.2 0.0";
scrollSpeed[0] = 0.03;
animFlags[0] = $scroll;
baseTex[1] = "planetClouds_shaderGen.png";
diffuse[1] = "1.0 1.0 1.0 1.0";
specular[1] = "1.0 1.0 1.0 1.0";
specularPower[1] = 0.0;
pixelSpecular[1] = false;
exposure[1] = 0;
glow[1] = false;
emissive[1] = false;
castShadow[1] = false;
breakable[1] = false;
doubleSided[1] = false;
translucent[1] = true;
translucentBlendOp[1] = LerpAlpha;
translucentZWrite[1] = true;
dynamicCubemap[1] = false;
planarReflection[1] = false;
scrollDir[1] = "0.2 0.0";
scrollSpeed[1] = 0.4;
animFlags[1] = $scroll;
};Thanks in advance!
-Dave C.
21-6 Productions
About the author
Torque Owner Ivan Mandzhukov
Liman3D
I also think better use the Custommaterial, but it's another decision, nothing your problem about.
void MatInstance::setTextureTransforms() { U32 i=0; // may be here is the problem ... F32 waveOffset = getWaveOffset( i ); // gets only the first offset ... }