Page 1 of 1

Fading a texture on a model

Posted: Mon Nov 06, 2017 6:30 pm
by Skipper
We are looking at playing an animation in a loop, but at the end of the loop the animation pauses and the model fades out and simultaneously fades back in at the start point of the loop. How do we get the model to fade with transparency instead of the fizzle-fade type effect that you get when switching between LODs?

Re: Fading a texture on a model

Posted: Mon Nov 06, 2017 10:00 pm
by Duion
I don't know of any game or engine that has a method for it, most just use the pop in without any fade.

Re: Fading a texture on a model

Posted: Tue Nov 07, 2017 3:04 am
by Jason Campbell
Check out this post:

How to make a variable that affects alpha?
http://forums.torque3d.org/viewtopic.php?f=10&t=991

It involves engine changes but it appears that he added alpha as a variable, so you could literally add a little alpha, in increments, until it fades then remove alpha.

the code is in his own reply to the thread.
https://pastebin.com/xLYKEdkY

Re: Fading a texture on a model

Posted: Tue Nov 07, 2017 8:03 pm
by LukasPJ
@
User avatar
Skipper
the issue lies in the way Torque3D (and most modern engines) render models. The way it is rendered doesn't support transparent objects.

Therefore, in order to have transparent objects, we have to render those objects in another, more simple, way called Forward Rendering. So if you truly want a transparency effect, then you either have to forward render that particular object or fake it somehow.

This is why T3D employs the fizzle-fade technique, and why it isn't just a simple thing to implement.