JonVarner Posted October 27, 2018 Share Posted October 27, 2018 Hey all, I am trying to get hide a material (PBR) using alpha=0. However, a problem arises with the reflections on the material still being present. I can of course set reflectivity to 0, but it seemed that there might be a better way to simply show/change visibility of a material/submesh? Quote Link to comment Share on other sites More sharing options...
Nodragem Posted October 27, 2018 Share Posted October 27, 2018 If the material is attached to a submesh, maybe you can turn submesh.isVisible to false ? Quote Link to comment Share on other sites More sharing options...
JonVarner Posted October 27, 2018 Author Share Posted October 27, 2018 Thanks yeah, I was hoping it was going to be that easy as well. But I tried it to no effect and I don't see it as a property when I query the submesh. Quote Link to comment Share on other sites More sharing options...
Nodragem Posted October 27, 2018 Share Posted October 27, 2018 is not the submesh of type BABYLON.Mesh? However, I do think that alpha=0 should be hiding the reflections too ideally; that makes sense to me; should we consider that as a bug? Quote Link to comment Share on other sites More sharing options...
JonVarner Posted October 27, 2018 Author Share Posted October 27, 2018 I am actually beginning to think that too. For the most part setting alpha to 0 seems to be removing most of the reflections. Here is a screen shot of what I am looking at. You have to look closely at the top of the image and you can see what looks like a "ghost" of the original material. I am looping through all of the materials and setting: shader.alpha = 0 Quote Link to comment Share on other sites More sharing options...
JonVarner Posted October 27, 2018 Author Share Posted October 27, 2018 Ok so it does seem to be a bug of some sort. By setting alpha to 0 it seems that all of the properties are no longer present except environmentIntensity which remains present even if alpha is set to 0. In the end I just used: shader.alpha = 0 shader.environmentIntensity = 0 Quote Link to comment Share on other sites More sharing options...
Guest Posted October 29, 2018 Share Posted October 29, 2018 Adding @Sebavan Quote Link to comment Share on other sites More sharing options...
Guest Posted October 29, 2018 Share Posted October 29, 2018 what you can do is just remove the submesh from the mesh.submeshes array Quote Link to comment Share on other sites More sharing options...
Sebavan Posted October 29, 2018 Share Posted October 29, 2018 It is actually a feature ? This is meant to simulate the reflection of the light on a windshield for instance or the tv by night on a window. To disable it you can set useSpecularOverAlpha to false as well as useRadianceOverAlpha to false. Else as you noticed, you could drop the environment intensity with the alpha if you need to fade smoothly. 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.