Skip to content
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

0 value Opacity not exported #2328

Open
EdwHopper opened this issue Aug 23, 2024 · 6 comments
Open

0 value Opacity not exported #2328

EdwHopper opened this issue Aug 23, 2024 · 6 comments
Labels
question Further information is requested

Comments

@EdwHopper
Copy link

EdwHopper commented Aug 23, 2024

The value for Opacity in the principled shader is not working in exported glb if the value is exactly 0.
If a full black texture is used then it's working.
This might affect other parameters too. But I could not check.

To reproduce just set the opacity to 0 in the shader and export a plane with that material.

Expected behavior
With blender 3.6.x setting Alpha=0 is working as expected on glb exports.

If applicable, add screenshots to help explain your problem.

Version

  • OS: Win10
  • Blender 4.2.1

Additional context
Add any other context about the problem here.

@EdwHopper EdwHopper changed the title Material value only for Opacity not exported 0 value only for Opacity not exported Aug 23, 2024
@EdwHopper EdwHopper changed the title 0 value only for Opacity not exported 0 value Opacity not exported Aug 23, 2024
@julienduroure
Copy link
Collaborator

Hello,

Did you mean setting the Alpha value of the Principled Shader to 0.0?
image

I can not reproduce.

The exported glb file seems to be OK : the material is exported, with a 0.0 alpha value in BaseColorFactor.

image

Please provide a test case and the exported glb or gltf file.

@julienduroure julienduroure added the question Further information is requested label Aug 26, 2024
@EdwHopper
Copy link
Author

EdwHopper commented Aug 26, 2024

@julienduroure Thanks for your time! I checked again with a few other viewers and it looks like the issue manifested only inhttps://sandbox.babylonjs.com/ so the glb from blender 3.6 is loading fine but not the one from 4.2.
https://github.khronos.org/glTF-Sample-Viewer-Release/ shows this error for both files: TypeError: model.mainFile[1].bytes is not a function.
Finally https://modelviewer.dev/editor/ and https://gltf-viewer.donmccurdy.com/ seem fine.
I understand those viewers are unrelated projects but sometimes artists are required to check the assets in specific viewers and it is difficult to check for compatibility.
I attached 2 versions of the glb containting a cube with Alpha=0 and blended opacity in the shader, exported with blender 3.6.9 and 4.2.1 just in case.
alpha_glb.zip

@julienduroure
Copy link
Collaborator

Hello,
Ok, so looks like the issue is in babylonjs.

The change between the 2 versions is the alphaMode used.

  • In 3.6.x => BLEND
  • In 4.2.x => MASK, without any cutoff, so using the default 0.5

@EdwHopper
Copy link
Author

I understand the issue now. So the Render method=Blended is ignored now if Alpha=0 and no texture used?

Screenshot 2024-08-26 163057

@julienduroure
Copy link
Collaborator

Hello,

You can read the discussion here: #2111
More info about the exporter here: #2152
Documentation here (on how to manage alpha now that Blender EEVEE-Next replaced EEVEE legacy) : https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html#alpha-modes

@lowpolycosmonaut
Copy link

lowpolycosmonaut commented Sep 12, 2024

It needs to be that setting alpha blend to 0.0 means the material is set to alpha blend in the GLB

Currently, setting to Alpha Blend 0.0 or Hashed 0.0 sets the GLB exported material to be Alpha Clip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants