Displaying transparent sphere inside a opaque sphere

Hi,
https://playground.babylonjs.com/#GH4NPZ

In the above sample, I am displaying a sphere and transparent sphere.
Here, the transparent sphere is inside the opaque sphere.
I need both sphere to be displayed on screen.
In WebGL, we can draw transparent sphere by setting gl.depthFunc to gl.always.
How can it be done in babylonjs?

Thanks
Gopinath Vellingiri

You have indeed created a transparent sphere inside an opaque one https://playground.babylonjs.com/#GH4NPZ#1

I do not understand what you mean by

When the outer sphere is opaque by definition you cannot see through it and so though both are 'displayed` (ie rendered) as can be seen by using the inspector in your PG

image

you cannot view the inner transparent sphere.

Please explain further what you are trying to achieve.

EDIT Unless you mean the camera to be inside the outer sphere???
https://playground.babylonjs.com/#GH4NPZ#2

1 Like