Skip to content

When no emission_texture is set on a BaseMaterial3D, it defaults to white instead of black after duplicating it #84139

Closed
@Sekuta82

Description

Godot version

4.1.2.stable

System information

Windows 10, any rendering backend

Issue description

Not a new issue. Happens in earlier versions.

Enabling emission on a material3D works initially, when no texture is set, meaning it will use the emission color.
As the available blend modes are add and multiply, the unset texture will default to black. At least it appears to be that way.

This is fine, unless I duplicate the material in code. In that case, if I don't set a emission_texture, it will default to white, meaning any additive emission color will be just white.

This also happens in the preview when assigning and removing an emission texture from the material.
However, it will fix itself in play mode, just not when duplicated through code.

Steps to reproduce

Project attached.
There are 3 objects in the scene:

  1. material without emission texture
  2. material with emission texture assigned through script
  3. material without emission texture assigned through script

All 3 should look identical.

Minimal reproduction project

emission_texture.zip

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions