Page 1 of 1

[1.1.42] energy_glow_animation flickers badly

Posted: Thu Oct 14, 2021 4:40 am
by bolderbrush10
This has been ongoing for at least several versions, but I finally made a demo to showcase what I'm experiencing.

Animations associated with a turret's energy_glow_animation flicker very badly.
It's visible on the default laser-turret, but modded turrets show the flicker as well and make it very obvious.
Changing the cooldown / duration on the laser attack seems to have no effect.
I've also tried experimenting with many different flags & draw_as___ options to no effect.

It seems possible that the energy glow animation is z-fighting when being redrawn every frame, like in these issues:
viewtopic.php?p=421477
viewtopic.php?f=7&t=91764
viewtopic.php?p=522051

I've attached a brief clip, a mod using my intended graphics, and a save demoing the laser turret, several draw_as____ versions.
(It looks worse in game than the 30fps clip can show)
energyGlowFlicker.mp4
(437.81 KiB) Downloaded 151 times

Re: [1.1.42] energy_glow_animation flickers badly

Posted: Thu Oct 14, 2021 8:22 am
by boskid
energy_glow_animation when being rendered uses a dynamically computed tint in form of Color(a, a, a, a) where the value of "a" changes from 0.8 to 1.0. Exact value changes from tick to tick because it is based on certain hash function that uses turret position and entity tick.

If you want i can add a turret prototype value, something like "energy_glow_animation_flicker_strength" with a default value of 0.2 (equal to the current value). Would that be useful for your use case?

Other than that it does not look like a bug because it is intentionally implemented in a way that it flickers heavily (usage of hash function and explicitly given formula for the tint). I may move this to modding interface requests

Re: [1.1.42] energy_glow_animation flickers badly

Posted: Thu Oct 14, 2021 8:44 am
by boskid
Ok i am just considering this a modding interface request (moving out of Bug reports).

It is now implemented for 1.1.43:
Changelog for 1.1.43 wrote:Added TurretPrototype::energy_glow_animation_flicker_strength.

Re: [1.1.42] energy_glow_animation flickers badly

Posted: Thu Oct 14, 2021 12:40 pm
by bolderbrush10
Oh that's awesome, thank you!