Closed eugeneko closed 2 years ago
I'm also not getting textures on BSDF materials (other than Pricipaled). So I am unable to use transparent or metallic. There is a very bad workaround of exporting a gtlf and manually editing the material in the json
add
"baseColorTexture" : { "index" : 0 }
inside
"pbrMetallicRoughness" : {}
I'm also not getting textures on BSDF materials (other than Pricipaled). So I am unable to use transparent or metallic.
I'm not sure that I follow you here – the Principled BSDF supports metallic factors and textures, and several different types of transparency. Alpha Blending and Transmission transparencies can be exported to glTF. See: https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html
Is there any reason why Diffuse BSDF should not be supported in this way?
From the Principled BSDF documentation, the Principled BSDF material has an "emphasis on compatibility with other software" that Blender's other materials do not, and it's (thankfully) a very good match for the PBR materials in glTF 2.0. We could try to approximate other shading models, but there the materials would not look the same and we'd receive bugs regularly about that, all of which takes time to debug and to answer.
My own preference would be to continue to focus on the Principled BSDF material – there's still plenty of work to do on that (like https://github.com/KhronosGroup/glTF-Blender-IO/issues/1454) and rarely enough time to do it. But I'd be curious what others prefer, and open to the idea if someone is interested in adding and maintaining that addition.
Thank you, I was finally able to get adequate results on my object using the Principled BSDF
So, seems there is no more issue here. Closing this ticket. Don't hesitate to comment if needed
Is your feature request related to a problem? Please describe. I am not an artist, I am only exporting existing models into the engine. And I find it mildly frustrating that Diffuse BSDF materials used by certain artist are always exported as gray into glTF.
Describe the solution you'd like I don't see any fundamental issues that prevent Blender from exporting Diffuse BSDF material as PBR material with roughness=1. Yes, we kind of lose Diffuse BSDF roughness, but it's still 100 times better than losing everything.
Moreover, I can hack the desired behavior with only a couple of lines of code:
bpy.types.ShaderNodeBsdfPrincipled
withbpy.types.ShaderNodeBsdfDiffuse
ingltf2_blender_get.get_socket
gltf2_blender_gather_materials_pbr_metallic_roughness.__gather_base_color_factor
roughness_factor
to 1.0 in the same placeI am not qualified enough to make proper fix and send it as PR, but I don't think it would be too hard.
Is there any reason why Diffuse BSDF should not be supported in this way?
Additional context How it works after my hack: