-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making a material unique with emission enabled will result in incorrect editor colors #60849
Comments
Bug happens here too but not only in the editor but in game also when making material unique from the code. macOS, AMD Radeon Pro 5500M, Godot 4 Beta 1. Code: scene = (PackedScene)ResourceLoader.Load("res://data/scenes/scene.tscn"); After that the emission is very bright, basically white. If I remove Duplicate() from the line marked with X it works correctly. |
anyone found a work around for the runtime example? |
This still seems to be an issue, duplicating a material from the mesh at runtime and setting it as a material override, then turning emission on just shows solid white. Setting the emission_energy_multiplier to much less than it should be (ie: use 0.3 instead of 7.5) makes it not pure white, but it isn't anywhere near as vibrant and is too muted. EDIT: it seems to happen with material overrides, geometry overrides and surface overrides, I think if the material is duplicated it breaks emissions. |
I wonder if #77326 helps this at all. It turns out we weren't properly freeing materials when geometry was duplicated |
Experiencing this same bug. |
Is this available for testing? I gave up trying to get emissions to show as non-white unless it was set to 0.03, and then it looks really weak and not emissive at all. It definitely sounds like having two of the same material simultaneously would cause something like this. |
It's not in 4.0.3, but you can build the |
Aha! I've narrowed down what causes this I think. And yup, you can reproduce the bug in the editor too by simply setting a material's emission texture and then clearing it. |
So yeah a workaround for this is to create a new material and copy all the properties into it except not the emission texture unless you have one. |
Godot version
4.0 Alpha 7
System information
Windows 10 Nvidia GTX 1060 Intel i5 4690k
Issue description
If you make a unique material on a material with emission enabled, it will glitch out in the editor
Untitled3.mp4
When making a copy of the material, pasting to another object, then making unique, the red will turn to white.
In the game, it is fine.
However, the colors are inaccurate in the editor
When you exit the editor and return, the colors will be fine again.
The editor issue only exists when you make a copy of a material, then make that material unique.
Steps to reproduce
Create 2 meshes
Create a material3d on 1 mesh
Set emission to true
Set albedo and emission color to color other than white
Copy material from mesh 1 to mesh 2
Make material on mesh 2 unique
Editor will glitch the colors out
Again, this does not affect the game. The colors are correct in game. However, the editor is inaccurate.
Minimal reproduction project
MaterialBug (2).zip
The text was updated successfully, but these errors were encountered: