Setting Material to Transparent makes it Black #5021
Unanswered
cyborgsince90s
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Good Day,
I am trying to follow a similar thread to change the opacity of the mesh.
But when I use the following code, My model becomes black and not transparent.
The console log shows the materials is already set to "Blend"
I have tried all RGBA patters, 0,0,0,0...0,0,0,-1 etc.
This is my code.
`var colorString = "0,0,0,0";
function SetMaterialsToTransparent(){
const material = modelViewer.model.materials[0]; // Access the first material
material.alphaMode = "BLEND";
material.pbrMetallicRoughness.setBaseColorFactor([colorString]); // Set opacity to 0.1
}`
FYI, My model has all the common textures.
Beta Was this translation helpful? Give feedback.
All reactions