Skip to content

Particle scale gets rounded to a very weird floating point number #112342

@mgiuca

Description

@mgiuca

Tested versions

  • Reproducible in: 4.6-dev2.
  • Not reproducible in: 4.5.1-stable.

System information

Godot v4.6.dev2 - Windows 11 (build 26100) - Multi-window, 2 monitors - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 4080 (NVIDIA; 32.0.15.8157) - AMD Ryzen 7 5700X 8-Core Processor (16 threads) - 15.92 GiB memory

Issue description

The "min / max" widget in the Godot editor for editing particle properties stores floating point numbers for the min/max values by rounding them really weirdly. It is not normal floating point rounding errors; it can't even store small integers.

For example, the default value of 1.0 gets changed to 0.99999997764826. 0.5 becomes 0.49999998882413. 37 becomes 36.9999991729855. They seem to get stored as slightly reduced values, but I noticed when I edit turbulence influence to 0.5, it gets set to 0.50000002374872, so sometimes it can get increased, and it seems to behave differently for different properties.

This affects all of the "min / max" widgets found in the ParticleProcessMaterial editor and possibly other editors, such as scale, animation speed, turbulence influence, etc. When saved, it saves it at the proper value I entered, so it's just an editor issue.

Steps to reproduce

  • Create a GPUParticles2D, and set it up with a texture and ParticleProcessMaterial.
  • Open Display > Scale.
  • Even the default values show as 0.99999997764826 but try changing them to other simple values like integers and halves.

Minimal reproduction project (MRP)

particle-scale.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Unassessed

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions