Archive 17/01/2023.

Animate lights?

rogerdv

Is there some way to animate lights, to simulate fire lighting?

codingmonkey

that do you mean then talk about light anim ?

if it not about animated textures, you may do something like this:

for example for my boom fx i’m animate brightness of light

	//light
	light_ = GetNode()->GetComponent<Light>();
	
	lightAnim_ =  SharedPtr<ValueAnimation>(new ValueAnimation(context_));
	
	lightAnim_->SetKeyFrame(0.0f, 0.0f); // 0 sec
	lightAnim_->SetKeyFrame(0.5f, 10.0f); 
	lightAnim_->SetKeyFrame(1.0f, 0.0f); // 1 sec

	light_->SetAttributeAnimation("Brightness Multiplier", lightAnim_);

mb also may animate - “range” from low->max->low…

i don’t know color of the light also animated or not.

rogerdv

Cant remember if was in Torque3D or Unity3D editor, but there was a parameter that allowed to animate a light, specifically the one I used was Fire. The resulting light behaved like fire, randomly chaging intensity, I think that also the casted shadows shifted position, like the real fire light does.

codingmonkey

mb you need particles + light range/bright animation + customize texures of particles for flame like textures.

rogerdv

Yes, but particles cant be saved yet, unless I missed some commmit that enbales serialization for it.

Azalrion

You could write an ValueAnimation that sets it to varying intensities at varying timeframes. Not that easy to randomize values though, you’d have to either have a suitable long time frame and loop or recreate after its finished.

rogerdv

Damn, Ill have to postpone that until I know more Urho3D and graphics programming.

JTippetts

It’s in the documentation. In fact, the entry on attribute animation specifically includes an example for animating the position and color of a light using object animation.