Hi!!
I have been playing and having fun with Babylon.js for the past month or so.
I wanted to know if I am following it right and if so, I would like to share with everyone here.
From what I understood, GLTF comes with the followings:
(1) scene.bin
(2) scene.gltf
=> basic structure of an object
=> includes meshes in an object (0 index => rootMesh, others => different sides on object)
(3) textures => includes diffuse texture and normal/bump texture
If I drop this whole GLTF folder into Babylon.js Sandbox, an object is automatically mapped with textures in it.
“scene.gltf” specifies which image to apply to which part or type of texture. For example,
"images": [
{
"uri": "textures/sampleDiffuseTexture.jpeg"
},
{
"uri": "textures/sampleNormal.jpeg"
}
],
Building a 3D object with modeling softwares like Blender isn’t really my job, but I am kinda confused.
.
.
Question [1] Do all softwares export gltf file as same structure??
If I were to build an object in Blender (or whichever software I use), depending on the extension that I export, as far as the gltf file includes the above “images” key, it would automatically apply the textures, right?
So if I wanted to modify textures, I would only have to find the node that I want to apply texture to and use
loadedMeshes[node_I_want].material.diffuseTexture = new Texture(src, scene, false, false);
or
loadedMeshes[node_I_want].material.bumpTexture = new Texture(src, scene, false, false);
.
.
Question[2]
I noticed that normal map texture images are all colored in this color.
However, when I built my own images for bumpTexture (one with white background and one with colored background), the white background one did not work and colored background one worked fine.
Is working with color #7a7df3 like a convention?
.
.
Question[3] OBJ structure
Unlike GLTF, OBJ file is written with numbers only. How does it know which images to apply then?? How are textures applied to the obj??
.
.
I hope everyone enjoys Babylon and share what we study!!
Have a great day!!