Hello everybody !
I manage to make an effect to visualize to sight of the units in my RTS game.
I use a sphere and a material that use distance field.
In order to avoid that the sphere detect its own distance field, I uncheck the “affect distance field” box for the sphere.
But when I select several of my units, there respective spheres are drawing the visualization inside other spheres…
I which to merge all these sphere into one big zone that show the total sight of the group, not several circles.
How can I make my material to detect that it is inside another volume ?
I can’t use distance field here because I already did and I have deactived it for the spheres.
I can add a spheric collision volume easily but I don’t know if nor how I can use it in my material.
Is it possible ?
If it is, can you give me a lead that I can follow ?
It will be awesome if I can found a way to also detect the intersection between 2 sphere to draw something at it as I do with the world and the distance field…
You can say I’m a dreamer… But I’m not the only one
EDIT : I’ve thinking at using depth fade on my material (it’s a transluscent mat ^^) and didn’t use the distance field in the sphere’s mat anymore.
This way, I can reactivate the distance field on the spheres and the “no distance field solution” constraint is over
The depth fade detect the world and I multiply all the mat with the distance field part that detect if the mat is inside a mesh or not.
I have a lot of tweaking to do and some aesthetic stuff to work on but on the principle, it’s the way I use this
Edit : As I see your sample image, I’ve been thinking at push the fresnel a bit on my material
the blend function seems very cool to me too and I have to read a bit about dithering ! Will do ^^
Thank a lot, wickerman
EDIT 2 : I have seen in my mail box that you have give me another solution with sphere masks but removed it… It’s a bad solution or just less efficient than the one one I pick ?
Ah ok… I understand the sphere mask option and I will need a sphere mask in my mat per other spheres in my world… It will be very complex to put that in place because i don’t know how many unit my player will have in the game…