Game Development Community

Easy way to do this?

by J Sears · in Torque Game Engine Advanced · 10/27/2008 (1:31 pm) · 2 replies

I had the idea of a player that could change the color of their clothing in game, as sort of a cloaking but instead of invisible the model texture colors changed.

I wanted a cool flowing graphic to go down the body and change the color, is there a good way to do this other then a bunch of textures at different stages of the change?

#1
10/27/2008 (1:35 pm)
You have two possible colors for each pixel: old and new, and you want to move from old->new based on time.

What I would do is have a pixel shader lerp between old and new. The interpolation factor would have to be calculated. You said it should "go down the body" so what I would do is base the interpolation factor on the z-component of the vertex position (in object space).

I realize that's a light description, but unless I actually made the effect, it'd be hard to post more information. That would be my "plan" for how to make the effect.
#2
10/28/2008 (8:54 am)
Thank you that does give me a direction to look in, I'm a long way away from trying to implement it so I wanted to start reading up on the areas I'd have to work with.