Skip to content
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

Exported material color and emission color values are wrong #115

Open
LaBodilsen opened this issue Nov 22, 2019 · 1 comment
Open

Exported material color and emission color values are wrong #115

LaBodilsen opened this issue Nov 22, 2019 · 1 comment
Labels

Comments

@LaBodilsen
Copy link

LaBodilsen commented Nov 22, 2019

Issue
When exporting an object from blender, the diffuse color value is set from the intensity viewport display color instead of the material base color, and the emission color is set from the viewport display color instead of the material emission color.

OS/Platform
Windows 10 Pro 1909 + Blender 2.8 + Godot 3.1.1.stable.official

Problem
as seen in: https://github.com/godotengine/collada-exporter/blob/master/io_scene_dae/export_dae.py

Emission color set to diffuse:
line 295

 # TODO: More accurate coloring, if possible
 self.writel(S_FX, 6, "<color>{}</color>".format(
      numarr_alpha(material.diffuse_color, material.emit)))
 self.writel(S_FX, 5, "</emission>")

Diffuse color set to diffuse_intensity
line 311

   self.writel(S_FX, 6, "<color>{}</color>".format(numarr_alpha(
     material.diffuse_color, material.diffuse_intensity)))
 self.writel(S_FX, 5, "</diffuse>")

Steps to reproduce

  1. Open blender default scene,
  2. Click the default cube, and then click the material tab
  3. Set base color to Red, and Viewport display color to blue.
  4. Export the scene with the Better Collada exporter.
  5. Import to godot, and see the material albedo color is set to blue but with slightly lower intensity, and the emission color is set to blue .

Suggestion to fix
I think the more correct export would be to set the diffuse color to the Base color of the material, and not set emission color to diffuse color from viewport display color, but instead to the emission color from the material.

@Calinou Calinou added the bug label Feb 26, 2020
@Nnarol
Copy link

Nnarol commented Jun 7, 2022

Hi!

I experienced the emission issue as well, which is why I wanted to open an issue, but you already did.
In fact, since emission was completely white, when I used a monochrome material, at first I thought that no material was applied at all (Godot also does not show applied materials when instantiating a Collada object), so I was asking around in Godot's discord why materials are not applied.

Is there any solution to this? The default Collada exporter works fine in this regard.

EDIT: In fact, I just tried changing the viewport display color and it didn't affect the emission color later in Godot. It was simply always RGB #cccccc .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants