Hello! everyone!
I want to make a affect like cesium ground line/surface, like this
how to do it? Is there any idea or document
Hello! everyone!
I want to make a affect like cesium ground line/surface, like this
how to do it? Is there any idea or document
i had see this link Add Stencil Parameter to Materials by gkjohnson · Pull Request #15611 · mrdoob/three.js · GitHub
and i have write code like it ,but it not work.
code: stencil test (codepen.io)
stencil
is disabled by default since r163 (you seem to be using r168) - related. You have to enable it manually in WebGLRenderer constructor new WebGLRenderer({ stencil: true, /* ... */ })
.
material:
depthFunc : THREE.GreaterDepth
side: THREE.BackSide
on a blue cube gets you most of the way to your screenshot.
No stencil required.
Greater depth means it will render only when its obscured by/behind the terrain…
BackSide, means you’ll only see the back faces of the cube when it renders behind the scenery, which prevents the issue of the camera clipping through the blue box and making it disappear.
i’ll have a try
i have try it, and it see normal behind the terrain, but it will been saw in other direction
it will not meet my require, because i want it stick ground only, and geometry not be saw in other direction. But i have admit it , its very instresting!
Wow ! it’s amazing!
How does it work? when i remove code ‘scene.add(firstPass)’ , i think it will display here too, but it is not.
and i have a question, it’s shadow color depend on plane color, right? it means that threre only one shadow color even two different curve.
i have done it , here is demo result
stencil test (codepen.io)
main reference: Add Stencil Parameter to Materials by gkjohnson · Pull Request #15611 · mrdoob/three.js · GitHub