Numa Posted April 13, 2017 Share Posted April 13, 2017 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? Thanks Quote Link to comment Share on other sites More sharing options...
jschwuch Posted April 13, 2017 Share Posted April 13, 2017 Hi! Can you reproduce it in the playground? I just tested it and they are not visible in my test playground http://www.babylonjs-playground.com/#600LYK#1 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. Quote Link to comment Share on other sites More sharing options...
Numa Posted April 13, 2017 Author Share Posted April 13, 2017 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. Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted April 13, 2017 Share Posted April 13, 2017 @Numa While It's hard for us to know whats going on without first seeing a PG replicating the issue, something that should work however, is setting the mesh's visibility instead. e.g. mesh.visibility = number; // ranges from 0 to 1, e.g. 0.5 = 50% visibility. jschwuch and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
jschwuch Posted April 13, 2017 Share Posted April 13, 2017 @aWeirdo That's exactly what i wanted to say but i called it opacity as that's what I call it in my project Sorry for that and thx for your correction Quote Link to comment Share on other sites More sharing options...
jellix Posted April 13, 2017 Share Posted April 13, 2017 Is there a special kind of reflectivity or glossyness or metalness on it? Quote Link to comment Share on other sites More sharing options...
Numa Posted April 13, 2017 Author Share Posted April 13, 2017 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 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted April 14, 2017 Share Posted April 14, 2017 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 jschwuch and Numa 2 Quote Link to comment Share on other sites More sharing options...
Numa Posted April 14, 2017 Author Share Posted April 14, 2017 oh right, that makes sense! that's it, beautiful thank you Quote Link to comment Share on other sites More sharing options...
jschwuch Posted April 18, 2017 Share Posted April 18, 2017 That's some new info for me too thx @Sebavan ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.