alpha = 0 not fully transparent

Recommended Posts

Hi there, 

I'm fading out meshes by setting material.alpha = 0;

However they still appear in the scene. I checked and their alpha is definitely set to 0.



Bug? Feature? :)



Share this post

Link to post
Share on other sites


Can you reproduce it in the playground? I just tested it and they are not visible in my test playground

If you can't reproduce it and need a workaround. You can set the meshes opacity visibility instead of the materials alpha, maybe that works as expected, ultimately you could set the meshs layermask to zero if it's materials alpha is zero. But those are of course options on a per mesh basis and not per material which may be a problem in your project :(

I'll try my best to find the problem if you can reproduce it in the playground. ;)

Share this post

Link to post
Share on other sites

Thanks, I'll try to reproduce it in a playground. It might have to do with animations (I don't set alpha to 0, I animate it). For now my workaround is to call material.disableLighting = true.

Share this post

Link to post
Share on other sites

reflectivity yes:

var baseMaterial = new BABYLON.PBRMaterial("baseMaterial", scene);

    baseMaterial.reflectionTexture = hdrTexture;
    baseMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.CUBIC_MODE;
    baseMaterial.directIntensity = 1.8;
    baseMaterial.specularIntensity = 1;
    baseMaterial.environmentIntensity = 0.2;
    baseMaterial.cameraExposure = 1.4;
    baseMaterial.cameraContrast = 0.95;
    baseMaterial.microSurface = 0.27;
    baseMaterial.reflectivityColor = new BABYLON.Color3(0.2, 0.2, 0.2);
    baseMaterial.emissiveColor = new BABYLON.Color3(0.1, 0.1, 0.1);
    baseMaterial.useRadianceOverAlpha = false;

I'll use visibility instead of alpha then :)

Share this post

Link to post
Share on other sites

Basically, in real life, highlights can be seen on top of transparent surface preventing to see through like your computer screen reflected on your window shield by night or car shield reflecting sun...

Trying to emulate that, we by default in the material force displaying highlighted part of transparent surfaces (automatically increasing opacity in front of the luminance of the highlights either radiance from environment or specular from scene lights). 

You can disable this by setting those both parameters in the material (they are true by default):

useRadianceOverAlpha = false  and 
useSpecularOverAlpha = false

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.