Good afternoon community.
I have some problem to create an occlusion cone going from the camera to infinity with a fading on it’s edge.
Let’s me explain that with a picture ^^:
This cone have a mesh collider, and if those red ball are inside they’re hidden ( GetComponent().enabled=false) than to a script. There is also a green sphere that have to be seen at all time (on the previous image it’s inside the cone).
So the actual rendering look like that :
As my sphere are oscillating along the the z-axis, I have a glitter effect.
Of course my sphere leave the cone so appear, and then few millisecond later it’s back inside it and then hide.
I order to solve this I tried to use a black sphere in front of my camera (cf picture below).
The rendering is quite great as the sphere do not glitter anymore (they’re just hidden by the sphere), but my green sphere is at the same time hidden.
— Problem –
My problems are the following ones : Basically found something that merge the two image ^^
-
- Is it possible to make this black sphere “invisible/clear” in order to let the light from the green sphere to come through.
A shader will probably do the job but I do not how to code and use them.
- Is it possible to make this black sphere “invisible/clear” in order to let the light from the green sphere to come through.
-
- Is it possible to had a fading rather than a straight cut (in the second image) between the occulted area (dark area) and the other one.
-
- Is there is a way to make this cone goes to infinity ?
Than a lot for your help
kosen