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

PBR material is being imported as standard material in THREEjs #20

Closed
Chase-Reid opened this issue May 22, 2018 · 7 comments
Closed

PBR material is being imported as standard material in THREEjs #20

Chase-Reid opened this issue May 22, 2018 · 7 comments

Comments

@Chase-Reid
Copy link

Chase-Reid commented May 22, 2018

Hello,

Sorry in advance if this is a feature request and not a bug. Currently when I import a model into THREEjs editor its material is set to MESHSTANDARDMATERIAL. I am using the PBR material provided along with the exporter. The behavior I would expect is for the material to be set as MESHPHYSICALMATERIAL upon import.

One of the big reasons we use MESHPHYSICALMATERIAL over standard is because ambient lights and hemisphere lights only affect MESHPHYSICALMATERIAL. We use these lights all the time and they play a key role in our artist toolset.

Again this could be a feature request or possibly a bug with the maya material. Thanks in advance!

@ziriax
Copy link
Contributor

ziriax commented May 22, 2018

Can you give me the url of the editor you are using? We do export a valid PBR GLTF 2.0 material, at least according to the validator

@ziriax
Copy link
Contributor

ziriax commented May 22, 2018

I just looked at the three is docs, and the standard material seems the correct material, it is a metallic roughness PBR material:

https://threejs.org/docs/#api/materials/MeshStandardMaterial

The physical material just adds support for clear coat and a reflectivity factor, for things like car paint

Is it that support you want?

@ziriax
Copy link
Contributor

ziriax commented May 22, 2018

Anyway it is best to wait for a GLTF extension that supports clear coat, it seems to be mentioned here but I am not sure what the status is

@ziriax
Copy link
Contributor

ziriax commented May 22, 2018

One of the big reasons we use MESHPHYSICALMATERIAL over standard is because ambient lights and hemisphere lights only affect MESHPHYSICALMATERIAL. We use these lights all the time and they play a key role in our artist toolset.

Are you sure about that? I know nothing about threejs besides having read book about it, but these two materials should be very similar.

Note that we are not exporting lights or environment maps, that is not part of the GLTF 2.0 spec. When using threejs, you would have to write code for that. Is it these kind of GLTF extensions you are looking for Maya2glTF to support? See the discussion here

Maybe you should ask this question in the threejs forum, to figure out what is not working, providing a scene exported with Maya2gltf.

@Chase-Reid
Copy link
Author

Chase-Reid commented May 22, 2018

To answer your first comment I am using the following editor: https://threejs.org/editor/

One of the big reasons we use MESHPHYSICALMATERIAL over standard is because ambient lights and hemisphere lights only affect MESHPHYSICALMATERIAL. We use these lights all the time and they play a key role in our artist toolset.

I just verified that the Metalness map visually affects ambient/hemisphere lights differently between MESHPHYSICALMATERIAL and MESHSTANDARDMATERIAL. I can provide screenshots if your curious but I dont think it pertains to feature I requested in this ticket.

Im not an engineer. I didnt understand that support for MESHPHYSICALMATERIAL required a different GLTF extension. Ill standby on that. Thanks for addressing this issue! Feel free to close :)

@ziriax
Copy link
Contributor

ziriax commented May 23, 2018

You could ask the threejs guys if it possible to force the creation of a physical material when loading glTF.

In this threejs example, you can see in the code that the environment map is set on each material. Also hemisphere lights are used. https://github.com/mrdoob/three.js/blob/master/examples/webgl_loader_gltf.html

I will indeed close this issue since I can't do much about this I'm afraid.

@ziriax ziriax closed this as completed May 23, 2018
@donmccurdy
Copy link

Chiming in late to say yes, feel free to file an issue against three.js for this. I think MeshStandardMaterial is the right default, but you may be able to convert at load time:

object.traverse((node) => {
  if (node.isMesh) {
    node.material = new THREE.MeshPhysicalMaterial().copy( node.material );
  }
});

^If that doesn't work, I would consider it a bug on three.js.

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

3 participants