Newland Posted September 26, 2018 Share Posted September 26, 2018 Hello, I run into three questions when I use BABYLON.HighlightLayer. The first question is:I create two planes that are very close to each other ,and I set useLogarithmicDepth=true to avoid z-fighting。But when I set HighlightLayer on the farside plane,the nearside plane looks flickering:https://www.babylonjs-playground.com/#2A2DG0.How can I avoid this flickering? Secondly,when I distance the distance between two planes,there still is a hightlighted edge on the nearside plane.How can I remove the Unwanted edge? Third,how can I adjust the thickness of the hightlighted edge? Thanks! Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 26, 2018 Share Posted September 26, 2018 Hi Newland, welcome to the forum. https://www.babylonjs-playground.com/#2A2DG0#1 1. Flickering was removed by killing line 15. 2. Unwanted highlighting was caused by not excluding plane2 from the highlighter. (line 27) 3. Thickness of blur is adjusted with lines 29 & 30. Highlighter docs... http://doc.babylonjs.com/how_to/highlight_layer Working better? I hope this helps. Report back if you have more questions/comments. Newland 1 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted September 26, 2018 Share Posted September 26, 2018 Thanks @Wingnut, indeed the effect layers do not support logarithmic depth so far, might be a nice addition to consider, but we are a bit to close from the release to do it now. Quote Link to comment Share on other sites More sharing options...
Newland Posted September 27, 2018 Author Share Posted September 27, 2018 Thank you for your help, Wingnut. Your work make things better, The Flickering and the Unwanted highlighting were removed in the scene. But the imperfect thing is,when we get close to the planes and tilt the camera,we will find the green plane and the blue highlighting cross over the red plane. For the third question,when I tried to set blurSize on lines and tube,I found that It did not perform well. The Thickness adjustment is not work for lines.For tube,it makes a lot of Light color highlightlayer and between the layers is abrupt crack. https://www.babylonjs-playground.com/#NW3VF1#2 I wonder if we can combine the highlightlayers and make it strong,just like a lightsaber? Quote Link to comment Share on other sites More sharing options...
Sebavan Posted September 27, 2018 Share Posted September 27, 2018 Hello, So About the light saber the tube with an additive higlight would be the best and to go even further I would rely on a glowLayer with emissive color ? About the line, it is almost impossible to do as blurrring the color of a single pixel would require extra passes and be slower. So as a demo I render to a pretty tiny texture to prevent losing to much intensity in the blur but unfortunately, this results in a lot of aliasing as you can see here: https://www.babylonjs-playground.com/#NW3VF1#4 Newland 1 Quote Link to comment Share on other sites More sharing options...
Newland Posted September 28, 2018 Author Share Posted September 28, 2018 Hello Sebavan, I will try to use glowLayer instead of highlightlayer to solve this question.Thanks for your help! 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.