question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

G3D models mostly white because of wrong emissive color

See original GitHub issue

Issue details

Since #5077 emissive is now implemented (which is good) but there is a serious drawback. Several devs have an issue with their 3D model rendering looking brighter than before because of emissive information in their model files.

First of all, this change breaks in some way and i think it would be great to add something like this in CHANGES.MD (kind of migration guide) :

[1.9.9]
- Emissive texture and color are now implemented in the default 3D shader. 3D models files(g3d, gdb, obj)
  may have unwanted emissive information and have to be migrated in order to look as before. In Blender, any material 
  with "shadeless" option, non-zero "Emit." value or "emit texture" will look brighter or totally white. If so, you
  have to export them again without these emissive information. A workaround is to remove all emissive information
  programmatically in your game : material.remove(ColorAttribute.Emissive).

I investigated and it appears that migration guide above is not enough. I’m pretty sure this is a bug related to fbx-conv. I’m posting here to centralize information and make it easily available to libgdx users. Here is what i found :

  • Blender FBX plugin exports both Emissive color and Emissive factor. As you can see here Emissive color is just a copy of Diffuse color and Emissive factor is the “Emit.” factor from Blender.
  • FBX-CONV only use Emissive color which is wrong IMO, see here.
  • I think it should be multiplied by Emissive factor. For reference, FBX SDK provides both values.

If fbx-conv has to be fixed, it would be great to add a note about it in changes.md or another appropriate place to inform users about fbx-conv / libgdx version compatibility.

Reproduction steps/code

  • open Blender with its default template (a box with a white material)
  • add a dark diffuse texture (optional step to easily see the issue)
  • export as FBX
  • convert it with fbx-conv (json or binary)
  • render that model in libgdx
  • model will be mostly white

Version of LibGDX and/or relevant dependencies

  • libgdx 1.9.9+
  • fbx-conv 0.01.0055 x64 , FBXSDK 2014.02
  • blender 2.79b

Stacktrace

N/A

Please select the affected platforms

  • Android
  • iOS (robovm)
  • iOS (MOE)
  • HTML/GWT
  • Windows
  • Linux
  • MacOS

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

5reactions
widaviescommented, Jan 22, 2019

Can confirm - I’m having this issue as well. I downloaded sources for FBX-conv, and changed the “emissive” property to always write to [0,0,0], which fixes the issue and makes models appear as they do in LibGDX v1.9.8. I can provide this .exe and will also try to see if multiplying the “emissive” property by the “emissive” factor before writing the .g3db/.g3dj file fixes the problem as well. I will submit a pull request with the corrected version over at the FBX-CONV repo when finished.

3reactions
mgsx-devcommented, Aug 27, 2020

as discussed elsewhere, this issue require a new fbx-conv release in order to be closed, @Tom-Ski i think it’s in your hands 😃 (no pressure).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Libgdx G3D models white because of wrong emissive color ...
Quote from github issue:A workaround is to remove all emissive information programmatically in your game : material.remove(ColorAttribute.
Read more >
Why does my model upload white? - Sketchfab Help Center
Yes. Sketchfab was automatically set emission to the material, that was what made the model look white only.
Read more >
EMISSIVE MATERIALS in Blender 2.9 | Emit Light from Textures
Get my FREE Blender Beginner Course here: https://bit.ly/3ysTglL ⭐Learn how to use EMISSIVE MATERIALS in Blender to add exciting lighting ...
Read more >
Emission - Unity - Manual
You can define basic emissive Materials with a single color and emission level. To make a Material emissive, enable the Emission checkbox.
Read more >
Causes of Diesel Engine Smoke - By Color
There are many common causes for diesel engine smoke from burning oil, fuel or regeneration issues and can be diagnosed by its white,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found