Extents of glTF support

I’m trying to export a ray-tracer scene file (VRay and its .vrscene, if anyone heard of it) into a format that can be read by Babylon. While OBJ was sufficient at first for simple vertices/normals/faces, my employer decided that he wants multi-channel texture (with multiple texture coordinates for each mesh) and PBR too.

As OBJ does not support any of these, I have decided to turn to glTF, the other file format that BABYLON supports. Before I get started with writing the exporter in Node.js, I just want to ask a few quick questions for confirmation.

  1. What PBR materials (and non-PBR, if anyone would kindly list them for me) do Babylon.JS supports, reading directly from the glTF files?

  2. How many texture coordinates can we define for each mesh? So far the ray-tracer supports 3 or more texture coordinates, but I think I only saw up to 2 tex coordinates in glTF specification docs.

  3. If I specify a .gltf file by its cloud URL link, will it automatically retrieve the corresponding .bin and texture files by relative URL path? Will any token suffix cause errors? Example: https://mydomain.com/assets/test.gltf?t=ds78fa90ds98-as8d6g9a0asdfa-sdfklas9-fds

For question 1:

PBR Metallic Roughness… Also most gltf parsers support KHR PBR Specular Glossiness extension. But PBR Is the only official shader/material support. But you could always write your own extension to support what ever materials you want

For question 2:

only two texture coordinates… I think… but again you could always write your own extension to support more

And question 3:

Yes loads from relative paths if you serializing relative paths. Dunno about tokens, but as long as the browser can load the url… you should be fine

1 Like

To clarify the answer to the first question, you meant that Babylon supports parsing PBRMetallicRoughness, PBRSpecularGlossiness and PBRMaterial, but for any other materials we should be writing our own Materials/shaders to support them?

Thanks for the swift response btw

Okay, I found the docs for glTF support, seems like it supports MetallicRoughness and SpecularGlossiness and some other materials too. Should work for my purposes.

https://doc.babylonjs.com/api/modules/babylon.gltf2.loader.extensions

The GLTF Spec only supports PBR Metallic Roughness. There is a extension from the Khronos Group (KHR) that supports Specular Glossiness. Babylon has MANY default extensions. Including Specular Glossiness… I dont think that Babylon has any other extensions that are NON-PBR type materials. Although one can be written.

I am the developer of the Babylon Toolkit (Unity Exporter). I have some Pro Toolkit SDK coming out soon. One of them is my Pro Shaders SDK… Where i not only support PBR Materials, Standard Materials… But you can write and use your own custom shaders. Either a Raw GLSL Shader, Simple Albedo and Diffuse Type Shaders and my new Partial Albedo And Diffuse Shaders (Like PBRCustomMaterial on steroids).

So technically anything can be done via GLTF Extensions, Even multi material type support.

But to clarify … GLTF Spec only officially supports PBR Metallic Roughness… Anything else would be by way of an extension. And Babylon JS supports many extensions including Specular PBR.

Hope that helps :slight_smile:

1 Like