-
-
Notifications
You must be signed in to change notification settings - Fork 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
Color management issues for .obj + .mtl #5307
Comments
Things have changed with regards to colour management in both three.js and A-Frame recently, so it might be a good idea to try and get things working on master. Also note that while obj+mtl is supported (and should ideally work out-of-the box), it's precisely colour management that can be undefined, hence also the following warning from the Three.js docs:
In any case, I believe the diffuse colour is taking the following journey:
On master both steps 5 and 6 are gone and My advice would be to consider switching to .gltf/.glb.
|
The issue not depends of I've switched to aframe-master.js but the issue at step #5 is still there. I've checked the code trace and unconditional color conversion code is unchanged. AFRAME/src/components/obj-model.js line 60 call materials.preload();
It seems the issue belongs to used super-three module example. As that code is provided as just an example may be it is good idea to import OBJLoader.js MTLLoader.js from super-three/examples to aframe itself and fix the things? Also it can be good to add an option to specify which color space to use while loading model so it will be possible to override default behavior in case of troubles. |
There are a couple of issues at play simultaneously, some of which do depend on If you're on A-Frame master and have
The issue would belong to three.js, as the super-three fork of A-Frame doesn't change anything about the loaders. However, whether this is actually a bug depends on if the colours in Here's an interesting remark from a Three.js discussion about colours in .mlt files, indicating that it might be a bug in Blender's .obj exporter: mrdoob/three.js#23283 (comment)
That could be a nice solution, just note that "a model" might use more than one colour space (e.g. sRGB diffuse textures and linear-sRGB vertex colours). So such an option should specifically apply to the Easiest solution remains to switch over to .gltf/.glb as Blender has an exporter for it built-in and there's no ambiguity about colour spaces. Otherwise the quickest route would be to either manually convert the colours back after loading or patching the
The |
i've rechecked the envMap issue and it seems it is part of color conversion thing. Sorry for misinforming. |
Thanks all for clarifying |
Should we close this? |
It seems in 'master' colors become better but something went wrong with normal maps from .MTL ( 'norm' .mtl command). Will recheck tomorrow... |
I've rechecked normal maps and they looks ok. Norm maps become about invisible in particular scene because of changed colors/lights. But issue with mandatory converting colors in AFRAME/node_modules/super-three/examples/jsm/loaders/MTLLoader.js still exists. Is it possible to move OBJLoader.js / MTLLoader.js to AFRAME tree and fix that? |
Making custom changes to three.js leads to more maintenance, and can create incompatibilities with libraries written against vanilla three.js. Given that the issue is either in Three.js or Blender (depending on how you look at it), the proper route would be opening a bug report on (one of) those projects. Three.js at least seems open to the idea of a flag on the loader, so that might be a good start. Once fixed upstream, it can eventually be exposed in A-Frame as well as a flag on Until then, I think a note/warning to the With Blender being such a common tool, it would be nice to see |
Huh. Will try both ways. |
With the way A-Frame is bundled you can't easily override dependencies the npm way. In your case I would simply grab a slightly older copy of In case your project uses ES6 modules, you can grab a recent copy of MTLLoader from |
Hard to tell without knowing your full setup, but in general you don't want to explicitly refer to AFRAME.THREE.MTLLoader = MyMTLLoader; Alternatively you could use |
Is there anything to be done here? |
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:
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>?
The text was updated successfully, but these errors were encountered: