Open GitGhillie opened 11 months ago
A reproducer would be great. Once you have something small working; can you check if the property is correctly set in the gltF file? There's a chance this bug is on the Blender end, not the Bevy one.
We had some discussion about the issue here. IMO we should ignore Blender for now and try to figure out the following: How does one create a solid glass material in Bevy?
For example, if you have a Suzanne made of solid glass, you'd set the IOR to 1.5, but what do you set thickness
to? Shouldn't it not be necessary to set a thickness value?
Once that is clear it should be easy to create a workaround and/or figure out if it's a Blender issue.
Thickness in gltf is defined in an extension: KHR_materials_volume
https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_volume/README.md
This is loaded by Bevy if it's available.
So you need to setup Blender to export materials with this extension. It can do it (https://github.com/KhronosGroup/glTF-Blender-IO/pull/1646) but I don't know Blender enough to know how to set it there.
Yeah just to be clear, when I ask "How does one create a solid glass material in Bevy?" I'm talking about a Bevy material, nothing gltf related
Quick googling for the Blender export settings says:
Blender 3.3 allows you to add a glTF Material Output node, which includes values for occlusion, thickness, and specular – all the data needed for outputting volumes into a glTF file. When importing a glTF file, this node and associated values are automatically added and set.
If you are creating an object from scratch and wish to output to glTF, you can enable the glTF Output Node in preferences: Preferences > Add-ons > Import-Export: glTF 2.0 format > Shader Editor Add-On
Once enabled, the glTF Material Output Node will appear in the menu under Output Nodes.
Bevy version
0.12.1
What you did
What went wrong
No refraction is seen when the scene is loaded in the Bevy app. Need to manually set the
thickness
property of the StandardMaterial to achieve a similar look to the Eevee renderer in Blender. The StandardMaterial documentation does not seem to include how to approach this exactly. But ideally it would work out of the box.Additional information
Let me know if a reproducer would help, wanted to post first in case I just missed some export setting in Blender.