-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export Diffuse BSDF materials #1488
Comments
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
|
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
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 #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. |
I'm interested in implementing and maintaining the diffuse material export. I've been using the diffuse material in Blender with roughness 0 to produce reference images with specifically a lambertian cosine distribution for my path tracer. I also use blender to export gltf/glb scenes to my path tracer and was suprised to find that diffuse materials did not export their base colour. This was counter-intuitive to me and left me rather confused. I understand wanting to focus on principled BSDF but I feel it shouldn't be a problem if I were to implement a diffuse material export as I am willing to implement and maintain it. If there are no problems with me implementing this and creating a PR I will go ahead and do it. |
Hello, See also #2390, that will export a simple version of materials |
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:
The text was updated successfully, but these errors were encountered: