Enabling multiple animated material layers in TGEA 1.8.1
by Daniel Hopkins · 06/05/2009 (4:20 pm) · 5 comments
Ok, I guess this really isn't what you might call a "resource"--it is more like a helpful tidbit. What does it do? As most have probably already found out, stock TGEA 1.8.1 does not allow you to animate separate layers. The animation properties of the first layer will be applied to the rest--the only per layer option being the ability to enable/disable the animation.
I stumbled across this problem while developing my soon-to-be released realtime material editor (www.garagegames.com/community/blogs/view/17259/1#comment-124581). Not wanting to just let it be, I figured I'd dive into the vast world of source code and try to fix it. The results? A ridiculously easy mod of the source to enable an incredibly useful functionality!
Ready?
1) Open the "processedShaderMaterial.cpp" file found in "engine/source/materials"
2) Scroll down or find this function (line 532 if you haven't made any changes to this file yet):
3) Change this:
4) Recompile
5) You're done!!
Now was that easy or what?
Well, that's it for now!
I stumbled across this problem while developing my soon-to-be released realtime material editor (www.garagegames.com/community/blogs/view/17259/1#comment-124581). Not wanting to just let it be, I figured I'd dive into the vast world of source code and try to fix it. The results? A ridiculously easy mod of the source to enable an incredibly useful functionality!
Ready?
1) Open the "processedShaderMaterial.cpp" file found in "engine/source/materials"
2) Scroll down or find this function (line 532 if you haven't made any changes to this file yet):
void ProcessedShaderMaterial::_setTextureTransforms(const U32 pass)
3) Change this:
U32 i=0;to this:
U32 i=pass;
4) Recompile
5) You're done!!
Now was that easy or what?
Well, that's it for now!
#2
06/06/2009 (1:20 am)
Thank you. What a simple answer to a complicated question! :)
#3
06/06/2009 (7:11 am)
If anyone come across side-effects with this, please post here.
#4
06/06/2009 (2:20 pm)
Well this certainly sounds cool. I can't wait to try it.
#5
07/02/2009 (10:02 am)
Ehy Daniel, what about doing the same in T3D ? :-)
Torque Owner TheGasMan
G.A.S. [+others]
http://www.garagegames.com/community/forums/viewthread/66632
Thanks for the information Daniel.
It was on my "might need this" list. So much appreciated!