Real time color change

Posted By: tompo

Real time color change - 04/18/07 20:25

Do possible to change colors of entity (materials) in real time.
Like my.red += 1 * time_step; The same with ambient, diffuse and specular,
F.e. to make a slider which one changes entity color.
Then with three sliders we'll be able to make all colors, like painting a car (basicly white) by player in the game (f.e. in paint-shop or something).
Maybe it's possible by .fx files or something, but that way will be more easy.
Posted By: fogman

Re: Real time color change - 04/18/07 20:45

Take a look at MatsEd 2 in my signature. It does exactly what you want.

Basically:

material test_mat
{
ambient_red = 100;
ambient_green = 100;
ambient_blue = 100;
}

action test
{
my.material = test_mat;
while(1)
{
test_mat.ambient_red+ = mickey.z*time_step;
wait(1);
}
}

Assign the action and move the mousewheel, you can change the material in realtime.
© 2023 lite-C Forums