aframevr / aframevr/aframe

Color management issues for .obj + .mtl

Open
#5,307 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
17.6k
Forks
4.4k
PR merge metrics
No merged PRs in 30d

Description

A-Frame Version: 1.4.2
Platform / Device: chrome for windows different versions, oculus quest2 browser

I'm trying to export scene from Blender to my AFrame based web page for VR. For some reasons i prefer to use obj+mtl format. I found a few issues regarding loading model to AFrame:

  1. All the materials during load assumed to have sRGB colors and converted to linear color space using convertSRGBToLinear(). BUT blender export the exact colors i wish to see in scene and i can not find a way to disable this mandatory color "correction" which ruine the model. Take a look at MTLLoader.js line 387 method createMaterial_( materialName )
  2. For models which use material more than once all material colors become black or about black. I'm not sure about reason but a think that's because that correction apply multiple times to same material.
  3. The diffuse map textures become dark (also color space "correction") until i set renderer="colorManagement: true"

Please can you help me to overcome this obj+mtl loading issues or add an option to disable unnecessary color "corrections" for <a-obj-model>?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with MTLLoader.js at line 387, in createMaterial_(materialName), and review how loads materials. Reproduce the reported behavior with a Blender-exported OBJ+MTL model, including reused materials and diffuse maps, in the listed Chrome or Oculus Quest 2 environments. Done means the model colors and textures load correctly without unwanted repeated color correction, or the requested opt-out is clearly supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.