godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.99k stars 21.16k forks source link

PointLight2D don't animate AnimatedTexture #67706

Closed BurningBeard24 closed 5 months ago

BurningBeard24 commented 2 years ago

Godot version

Godot Engine v4.0.beta3.official.01ae26d31

System information

Xubuntu 22.04, Vulkan API 1.2.0 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 1060 6GB

Issue description

If I use a AnimatedTexture resource for a PointLight2D it only shows the first frame of the animation. The same AnimatedTexture on a Sprite2D works.

Steps to reproduce

  1. create a AnimatedTexture
  2. set this AnimatedTexture as texture of a PointLight2D

Minimal reproduction project

No response

Calinou commented 2 years ago

Related to https://github.com/godotengine/godot/issues/54506.

clayjohn commented 2 years ago

I'm not sure supporting animated textures in PointLight2Ds is a good idea. In 4.0 2D lighting is done in a single pass which means that all light textures have to be copied to an atlas. Supporting animated textures would require either:

  1. updating the atlas every single frame by blitting the animated texture to it or,
  2. copying every frame of the animated texture into the atlas and then animating the rect of the PointLight2D.

Both options will be harmful for performance. I think number 2 may not be terrible, but I guess it depends on how big the AnimatedTexture is and how many frames it contains.

AThousandShips commented 5 months ago

Closing in favor of:

Thank you for reporting