Skip to content

Keying the initial value of a shader parameter inserts Variant::Nil and the animation does not work as expected #87040

Open
@nezvers

Description

@nezvers

Tested versions

  • Reproduceable in: 4.3.dev, 4.2.1.stable, 4.2.stable (either totally doesn't animate or as discrete keyframe values),
  • Reproducible??? in 4.1.1.stable (something not correct with one of uniforms in reproduction)
  • Not reproducible in 4.1.stable

System information

Godot v4.3.dev1 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2070 SUPER (NVIDIA; 31.0.15.3734) - Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz (8 Threads)

Issue description

In production game we noticed that shader parameters are not animated inside a game but looked OK in editor. Instead of interpolating values are set to values saved in a material resource.

As I was creating a reproduction project it was totally off in editor where it acted as discrete values on a float uniform.

4.2 I noticed a warning about shader float value
scene/animation/animation_mixer.cpp:879 - AnimationMixer: 'test', Value Track: '.:material:shader_parameter/red' uses a non-numeric type as key value with UpdateMode.UPDATE_CONTINUOUS. This will not be blended correctly, so it is forced to UpdateMode.UPDATE_DISCRETE. (User)

4.1.1 it looked correct for uniform float alpha until I introduced uniform float red and its value wasn't animated.

Steps to reproduce

  • new project
  • add Sprite2D with AnimationPlayer
  • create a float uniform in shader (didn't think about colors and vectors)
  • animate those parameters with animation player
  • in 4.2.1 production project animated in editor but not in the game. But in reproduction project keyframes acted as Discrete.

Minimal reproduction project (MRP)

Animate Shader Parameters 4.1.zip
Animate Shader Parameters 4.1.1.zip
Animate Shader Param 4.2.zip
Animate SHader Bug 4.2.1.zip
Animate Shader Bug 4.3dev.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions