In Babylon I’m using the PBRmaterial.metallic and PBRmaterial.roughness values to set the strength of the PBRmaterial.metallicTexture.
It would be nice to be able to set the same strength in a glb document, after exporting from 3DS Max.
The manual says: “Remember that in 3DS MAX, when a map is assigned to a parameter, the basic parameter value is ignored. This behaviour is kept when exporting.”
Is there another way to export those settings along with the glb document? Maybe with a custom attribute?
Reading the glTF 2.0 reference, I’m seeing “metallicFactor” and “roughnessFactor”, but I can’t figure out how to export those values using a custom attribute.
It would be great to mimic the Babylon.js look as much as possible!
Sorry for the delay, i’m off for a week and had limited Net access.
MettalicFactor is coming from
the Metalness input into the PhysicalMaterial properties.
This value is take in account if NO Metalness map are set. If metalness map is set, then the value is set to 1.0. Note that this value can generate artifact if you’re using JPG texture for the the ORM map. Use PNG in all case for a better result.
Hope this help.
Hi @Guillaume_Pelletier , thank you for the info. But in the glb document, I would like to set the intensity of the metallic and roughness textures, and not set it to 100%. Can this somehow be achieved with a custom attribute during export?
Not has it. This is the Metalness value OR the map (which is the behavior of Max). We must add a specific option into the material attribute but we have to be sure about how to introduce this into the flow for Babylon, then GLTF. I will discuss with the team on the topic. This is related to issue #923 to add others specific parameters.
Okay @Guillaume_Pelletier , so the GLTF/GLB format can do this, but the exporter still has to be adapted to this. That would be too late for my current project. Can you refer me to a tool (e.g. DOS/command line) that I can use to convert my 3D models and textures into a glb file, a tool that has the option to set the strength of the texture? Thank you so much for your help!
@FernandoConti I’m not aware of such tool. If you have an FBX as source file you can try FBX2GLTF, but do not know about how this tool process the “xxxxfactor”.
What is your project timeline?
@Guillaume_Pelletier , ideally I would need the possibility the set the strength/intensity of the the metalness and roughness texture by Monday 15th. So that is fairly quick unfortunately. Do you maybe see a way for a quick fix?
A quick & (probably very ) dirty way could be to use material naming.
const mtl = mesh.material;
mtl.metallicTexture.level = parseFloat(mtl.name.split("_").split("-").split("m")); // give 0.75
mtl.roughnessTexture.level = parseFloat(mtl.name.split("_").split("-").split("r")); // give 0.125
@FernandoConti Ok, i will add a temporary “use Babylon Factors” under the specific babylon properties of the Material, and then lets the user to choose between Max Behavior (MAP OR SCALAR) or Babylon/GLTF (MAP*SCALAR OR SCALAR) way. I will work on this tomorrow morning (my time which is CET+1). Keep u posted.
@FernandoConti just published a PR. Wait for the team to review and merge. Hope it will save your project
Thanks a million @Guillaume_Pelletier !! Super excited about this !!
using Physical material, you set the metalness and roughness under the basic parameters
And at the bottom check the box “Use Scalar Factors” to force the exporter to export also the basic parameter even in presence of map.
Note : the new Full PBR xxx are specific to babylon format, and use only when “Use Full PBR” is checked in main exporter panel. Nothing to deal with GLTF here.
@Guillaume_Pelletier, just to be clear, this also works for the GLB output (which would be my project output)?
Also, do I need to keep an eye on “GitHub - BabylonJS/Exporters: Exporters for Babylon.js and gltf file formats” for the new update, or am I looking at the wrong page?
You may wait for release 242. This is work for Babylon, Gltf AND glb.
Hi @Drigax and @Guillaume_Pelletier , I saw your discussion over at Github (Add material specific attributes by pandaGaume · Pull Request #930 · BabylonJS/Exporters · GitHub).
I just wanted to ask if you think this new feature will be added to the exporter.
I feel very bad asking you this since you all do such great work and I really don’t to press anything at all.
It’s just that my entire project hinges on this texture strength setting which would allow me to mimic Babylon’s live-scripted look inside the glb format.
Thank you for your consideration!
The change is in now