williamqin Posted September 25, 2018 Share Posted September 25, 2018 HighlightLayer works with the default alpha combine blending mode, but it disappears when I set the blend mode to "add." I tried setting the neutralColor to Color4(0, 0, 0, 1), but it still doesn't work. How do I fix this? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 26, 2018 Share Posted September 26, 2018 Hi W, welcome to the forum. http://doc.babylonjs.com/how_to/highlight_layer At bottom of document... some talk of blending modes. Both highlightLayer and glowLayer have shown to be irritable with transparencies/alpha, out of design necessity. Here is the thread that introduced the highlight layer... http://www.html5gamedevs.com/topic/25503-babylon-highlight-layer/ I think, in its newer posts... there were some other complaints about using it in-conjunction-with transparencies. It has some limitations. IF, by chance, you are using a mesh glow/highlight to indicate when something has been mouse-selected... then there are some other ways. 1. Turn on mesh.showBoundingBox = true when mesh is selected 2. Animate/Color-cycle the mesh.material.diffuseColor 3. Add/increase/color-cycle the material.emissiveColor to brighten selected mesh 4. Shine a bright spotlight on a selected mesh 5. Sine/cosine-animate the selected mesh.scaling... to make it "throb", size-wise Just some ideas. Possibly, @Sebavan (and others) might want to say a few words (which will be much more-informed about this subject than my words). Stay tuned for better answers. But, I KNOW I have seen more than one "highlightLayer is not designed for transparencies/alpha blends" comments from Sebavan... around the forum. You might want to do a thorough forum search for more info. Party on. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted September 26, 2018 Share Posted September 26, 2018 This is linked to the default resolution of the texture, you could tweak the setup like this: https://www.babylonjs-playground.com/#1KUJ0A#140 Wingnut 1 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.