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

[Solved issue] Black objects and/or material when using aframe box or 3D files #494

Closed
commentatorboy opened this issue Mar 29, 2019 · 5 comments

Comments

@commentatorboy
Copy link
Contributor

commentatorboy commented Mar 29, 2019

A related issue is here:
#325

The problem
Multiple problems. When adding an a-frame object (like a-box) or using gltf, obj, or similar 3D filetypes the objects become black.

This occurs only on some smartphones like my moto e5.

In depth about the problem
Kind of hard to reproduce the problem since it only occurs on some smartphones.
The problem is related to rendering and how three.js handles it.
More about the issue here: mrdoob/three.js#14137
A demonstration for the problem:
mrdoob/three.js#14137 (comment)

People have also this issue with it in aframe.
Here is a related issue: aframevr/aframe#3523

The solution
The solution is using another precision renderer as described below:
https://aframe.io/docs/0.9.0/components/renderer.html#precision
Go to this website to see it working:
https://www.internet-guiden.dk/nomarker
Here is the source code:
https://jsfiddle.net/gwo2y4dn/

Notice
Make sure that when using a-box set the following property: material='color: green';. (green is just an example).
Make sure that you color 3D object in blender or similar software. If you just created a 3d cube object in blender and then export it, the 3D object will not show colors.

Results/Examples
These are some examples of when it does not work and when you apply the precision to lowp or mediump. Please refer to the images below.

Any feedback and/or question is appreciated.

55478644_1095317373987784_7322158777065537536_n(1)
55517404_2234166103502458_881576354292695040_n(1)

@andreyrd
Copy link
Contributor

If this is solved, we should probably close the issue.

But perhaps let's first add to FAQ/README about this issue?

@commentatorboy
Copy link
Contributor Author

@andreyrd Yeah. I can create a FAQ about this issue.
I think it would be more appropiate to have it in the WIKI.

@kalwalt
Copy link
Contributor

kalwalt commented May 21, 2019

@commentatorboy @andreyrd I also encountered this issue with a Wiko View device, can't see the colours of simple meshes, adding renderer='precision: medium' in the a-scene tag solved it. I think this should be added in a FAQ list. Note also that is not related to AR.js but exclusively to aframe.

@commentatorboy
Copy link
Contributor Author

commentatorboy commented May 22, 2019

@kalwalt Yeah. Unfortunately I do not have time right now to do it. I am trying to find a job.
But will update it here when I do.
In the mean time, if there is something people want to add, please say it here.

@kalwalt
Copy link
Contributor

kalwalt commented May 22, 2019

@commentatorboy Good luck for the job research! i will look if i have time for this FAQ....

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

No branches or pull requests

4 participants