JonVarner Posted August 15, 2018 Share Posted August 15, 2018 Hey all, I hope this question is not to random. But I am looking at updating the exporter from blender to include PBR as an option. What I don't have is an example of what a PBR meterial definition should look like for an imported file. Right now materials are exported from blender like: "materials":[{"name":"material1","id":"material1","ambient":[0.5,0.5,0.5],"diffuse":[0.4,0.4,0.4],"specular":[0.5,0.5,0.5],"emissive":[0,0,0],"specularPower":49,"alpha":1,"backFaceCulling":true,"checkReadyOnlyOnce":false,"maxSimultaneousLights":4}], This of course loads as standard materials. I was wondering if someone had an example of what this should look like to load as a PBR material? I can update the exporter on my end, I would just like to make sure its possible and how it should look. Quote Link to comment Share on other sites More sharing options...
babbleon Posted August 15, 2018 Share Posted August 15, 2018 Hi @JonVarner, This thread may help you.... but the important bit is that under each of the materials, for it to be treated as PBR the exporter needs to add: customType":"BABYLON.PBRMaterial" Quote Link to comment Share on other sites More sharing options...
JonVarner Posted August 15, 2018 Author Share Posted August 15, 2018 Ah..perfect thanks. I did a search and somehow this one did not come up. Will check it out. Quote Link to comment Share on other sites More sharing options...
babbleon Posted August 15, 2018 Share Posted August 15, 2018 PS. attached is my modified 5.6.2 material.py which exports all material as PBR, but nothing more than that, it does not include texture, colour etc. material.py Quote Link to comment Share on other sites More sharing options...
JonVarner Posted August 15, 2018 Author Share Posted August 15, 2018 Wow awesome. Thanks! This will give me a running start. Quote Link to comment Share on other sites More sharing options...
babbleon Posted August 15, 2018 Share Posted August 15, 2018 You're welcome. Hope you get on okay. Quote Link to comment Share on other sites More sharing options...
JonVarner Posted August 15, 2018 Author Share Posted August 15, 2018 I will re-post here once I add the textures and color. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 15, 2018 Share Posted August 15, 2018 SWEEEEEEET !!! Quote Link to comment Share on other sites More sharing options...
babbleon Posted August 15, 2018 Share Posted August 15, 2018 @JonVarner - just a thought.. but I wonder if when you use the Principled BSDF shader, the exporter would pick up on this and save as PBR. Would require the baking of textures to be disabled when using Cycles though. Quote Link to comment Share on other sites More sharing options...
JonVarner Posted August 15, 2018 Author Share Posted August 15, 2018 Right. I am still trying to wrap my head around how what approach I will end up taking. In our pipeline we simply pass and fbx through blender with standard materials so I have feeling for our needs we will just be passing things through with basic materials. The idea would be that we would pull the texture data from the diffuse, bump, and ambient slots. So we will probably not go so far as cycles and baking. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 15, 2018 Share Posted August 15, 2018 @JonVarner might be worth looking at the gltf blender exporter as they have to deal with the same kind of features for PBR. Quote Link to comment Share on other sites More sharing options...
JonVarner Posted August 15, 2018 Author Share Posted August 15, 2018 Thanks, was looking at that as well. Quote Link to comment Share on other sites More sharing options...
JonVarner Posted August 15, 2018 Author Share Posted August 15, 2018 (edited) So I was originally this was going to be more of a blender exercise but that's proving to be the easy part :) I added: "albedoTexture":{"name":"texture.png","level":0,"hasAlpha":1,"coordinatesMode":0,"uOffset":0,"vOffset":0,"uScale":1,"vScale":1,"uAng":0,"vAng":0,"wAng":0,"wrapU":1,"wrapV":1,"coordinatesIndex":0} But for for the life of me I cant get it to show up on the material. I am sure I am missing something obvious but can figure out what that is. Edited August 15, 2018 by JonVarner Typo Quote Link to comment Share on other sites More sharing options...
babbleon Posted August 15, 2018 Share Posted August 15, 2018 You can get the structure of the .babylon PBR setup here: https://www.babylonjs-playground.com/#73069S%232 Maybe change the above PG to match what you are expecting to see then download & compare. http://jsonviewer.stack.hu/ is a very good tool for picking thru JSON / .babylon files. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.