Gltf-blender-io: GLTF and Texture export

Created on 2 Apr 2019  路  11Comments  路  Source: KhronosGroup/glTF-Blender-IO

Hi guys,

I have been testing the exporter a bit and it works great for most of my textures, except for this one case: I would like to render my planet as show in the first picture, using the GLTF Metallic Rougness node to export the textures as well as my meshes. Although when I plug it in (see the second picture) like I do with my other textures, it does not properly render, what am I doing wrong ? :)

The working one :
Screenshot 2019-04-02 at 20 50 32

The failing one :
Screenshot 2019-04-02 at 20 50 48

Most helpful comment

Well I just switched to Blender 2.8 and opened my scene, exported it, works fine.

All 11 comments

You should remove the "Diffuse BSDF" node from the 2nd image. Note the output of the glTF node is green (shader) not yellow (color), so can plug in directly into Material Output.

Also, you do have the option of removing both Diffuse and the custom glTF nodes, and just use a Principled BSDF node between your image texture and the material output, if you would like.

Also for a planet you probably want to set MetallicFactor to zero.

It works ! Thank you very much @emackey ! I went with the second option, working perfectly fine !

@emackey, I did not want to open a new issue for this, but for some reason, I now have this error showing up :

{
"code": "MESH_PRIMITIVE_TOO_FEW_TEXCOORDS",
"message": "Material is incompatible with mesh primitive: Texture binding '/materials/0/pbrMetallicRoughness/baseColorTexture' needs 'TEXCOORD_0' attribute.",
"severity": 0,
"pointer": "/meshes/0/primitives/0/material"
}

I have no idea where I screwed as it was working properly until I changed the planet size. Do you have any pointers regarding this error ? The texture is listed in the babylonJS sandbox, although the planet appears purple, exactly as it does in Blender when the "Texture" option is selected in blender. Although the "rendered" option works great.

Any idea ?

Well I just switched to Blender 2.8 and opened my scene, exported it, works fine.

Also, you do have the option of removing both Diffuse and the custom glTF nodes, and just use a Principled BSDF node between your image texture and the material output, if you would like.

@emackey Principled BSDF is supported? Wow! What else cycles node support export to gltf? Or where I can read about this?
Hue Saturation for example? Or Wave Texture?

@Dok11 Documentation is in progress in the Blender Manual:

https://docs.blender.org/manual/en/dev/addons/io_gltf2.html

Thanks! Are there any plans do support all possible nodes for export to gltf?

@emackey ^

Thanks! Are there any plans do support all possible nodes for export to gltf?

There is no simple answer to what "all possible nodes" would mean. For a number of reasons we would strongly encourage using the Principled BSDF node, and the Blender team is encouraging import/export tools to focus on this too. Most of Blender's material features simply don't translate into other formats or tools, and Principled BSDF is a very good representation of the most 'portable' possible subset.

Agreed with Don. Also keep in mind that Blender's Cycles engine has a "Bake" panel that can bake complex node graphs to an image, given a good UV atlas. This is helpful to glTF for the reasons Don mentions, allowing low-power and mobile clients to render the glTF in real-time, without CPU-intensive node calculations.

Was this page helpful?
0 / 5 - 0 ratings