You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The team and I are encountering a bug where, after exporting, textured-objects are rendered in babylonjs as if they are transparent, i.e. without depth-testing, resulting in overlap.
After some investigation, it's found that material with image textures all have hasAlpha set to true. I experimented setting alpha to none in the material -> surface panel, without success:
We then tested changing the texture to jpeg, and indeed this fixes the problem. Digging the exporter's source code, I found that in this line:
I propose that the exporter also supports the Alpha option as shown in the above screenshot. I'm not an expert as to what these options map to babylonjs, but at the very least it seems none should mean hasAlpha: false.
For our case, bmp and jpeg are not acceptable because:
bmp is huge. The size of one of our texture goes from 20KB (png) to 6MP (bmp). While this size might be acceptable for desktop games, this is not really a good fit for games served on the internet
jpeg, despite its excellent file size, is lossy
I don't mind contributing. It'd be great if you can provide pointer as to where to grab that Alpha settings in the material -> surface panel. Then it should be a matter of switching on the enum values and set to true/false accordingly.
Received. That UI did not even exist at the time when this part was written. Think that so other people's exports are not broken, the only time it would be consulted would be to override existing logic when 'None'.
The line 135 reference is when the exporter was required to bake do to a material which will not export. This UI will not exist for this temporary texture. That is controlled by the exporter's Mesh custom properties.
The image texture node is currently read in this file . It is currently assigning alpha without using the field. Change needs to be there.
Will need to check how that interacts with Texture.py, but not for a while.
Post import, if you got the material in question, you could override with code (based on the type texture) for now:
The team and I are encountering a bug where, after exporting, textured-objects are rendered in babylonjs as if they are transparent, i.e. without depth-testing, resulting in overlap.
After some investigation, it's found that material with image textures all have
hasAlpha
set totrue
. I experimented setting alpha to none in the material -> surface panel, without success:We then tested changing the texture to jpeg, and indeed this fixes the problem. Digging the exporter's source code, I found that in this line:
BlenderExporter/src/babylon_js/materials/texture.py
Line 27 in 949d71f
and in this line:
BlenderExporter/src/babylon_js/materials/texture.py
Line 135 in 949d71f
hasAlpha
is set according only to file format.I propose that the exporter also supports the
Alpha
option as shown in the above screenshot. I'm not an expert as to what these options map to babylonjs, but at the very least it seems none should meanhasAlpha: false
.For our case, bmp and jpeg are not acceptable because:
I don't mind contributing. It'd be great if you can provide pointer as to where to grab that
Alpha
settings in the material -> surface panel. Then it should be a matter of switching on the enum values and set to true/false accordingly.Thanks!
Info:
Blender version: 3.6.5
Exporter version: 3.3.2
The text was updated successfully, but these errors were encountered: