Material problem

materials

#1

Hello. I’m unable to showcase the correct materials in here, anyone knows why?


#2

Hi!
Any live example of code? Or a link to the project?


#3

No code in here, just a simple model with this viewer https://gltf-viewer.donmccurdy.com/. You can download the file here.
Blender:
https://drive.google.com/file/d/1-nibRxrp94VI8yz_CRNOrczYEQ92LKfR/view?usp=sharing
Gltf:
https://drive.google.com/file/d/1i1vVWOshLZvdFfLEhrWoE2p4H_LJIqY7/view?usp=sharing


#4

/cc: @donmccurdy


#5

The material in this Blender file is a complex one:

Assuming you’re using the Blender 2.8 Beta or https://github.com/KhronosGroup/glTF-Blender-IO with an older version of Blender, you’ll want to create materials with the Principled BSDF node instead. Other materials will be very hit or miss. In this case you can probably get pretty close just by copying the base color and roughness values into a Principled BSDF node.

The documentation for the glTF exporter is not finished yet, but here’s the in-progress version with a screenshot of a recommended material graph: https://developer.blender.org/D4082


#6

In general I would recommend starting with the loading 3d models • troubleshooting steps first — this will help you narrow down whether the model itself is right or not. If the model isn’t right in other viewers either, it’s probably something related to export.


#7

Thanks.
Changed it all back to principled/glass BSDF, still not showing any materials in neither loaders. let me see.


#8

You should baking texture material instead using direct material of blender :slight_smile:
That’s take more time. I met same issue with you


#9

Yeah i was going to say, if you expect a path traced image to somehow appear in the three.js built gltf loader example, it’s just not going to happen. Baking the lighting is only one part of this.


#10

The Principled BSDF node is actually pretty close to MeshStandardMaterial – the lighting doesn’t have to be baked, although baked lighting is simpler and more efficient.

For example, try importing the Damaged Helmet PBR model (https://threejs.org/examples/?q=gltf#webgl_loader_gltf) here into Blender, then exporting. It will (or should…) create a Principled BSDF node that exports to match the original, except that AO will be lost (https://github.com/KhronosGroup/glTF-Blender-IO/issues/123).


#11

Can I export normal map + bumping to gltf with same object :frowning: . Current I just choice only 1


#12

Normal maps and bump maps do the same thing (at least for the most common definition of a bump map) giving the appearance of extra detail without requiring more geometry. This is different from a displacement map, which shifts vertices in the shader but does not add detail.

if you have a normal map I would suggest just using that instead of the bump map.