Page 1 of 1

Area of influence shader

PostPosted: Tue Mar 20, 2018 11:41 am
by jedberyll
Hi!
I'm trying to create a shader for a Unity game which would show an area of influence / territory around solar systems much like in Endless Space. Problem is I don't even know where to start. Should I use a surface or post processing shader? How would I set it up? Any help or info would be greatly appreciated!

Re: Area of influence shader

PostPosted: Tue Mar 20, 2018 3:55 pm
by Amplify_Borba
Hey there, thank you for getting in touch and for your support!

Could you please provide a screenshot of the exact intended effect, so that we may best help you? Thanks!

Re: Area of influence shader

PostPosted: Tue Mar 20, 2018 7:57 pm
by jedberyll
Sure thing, here's a shot from Endless space. See the circles around the solar systems, same colors are combined into one territory where they make contact. For starters I would be happy with just 1 color for the player without distorting the circular areas where one player's border meets another's. Thanks for taking the time to help!

Image

Re: Area of influence shader

PostPosted: Fri Mar 23, 2018 7:20 pm
by Amplify_Borba
Unfortunately, I'm not quite sure on what to recommend, as even the technique used in the screenshot provided seems to have its limitations.

I could suggest attempting to use stencil or transparency with blending modes, as two means of achieving this effect, although additional scripting outside of the shader would always be required in order to deal with occurrences such as detecting when different areas collide and what to do or how to behave in each possible situation.

Here's an interesting reference: https://mispy.me/unity-alpha-blending-overlap/

Re: Area of influence shader

PostPosted: Fri Mar 23, 2018 8:11 pm
by jedberyll
That's exactly what i was looking for! Now that I have a place to start, maybe I can get it working. Thanks a lot!

Re: Area of influence shader

PostPosted: Mon Mar 26, 2018 10:08 am
by Amplify_Borba
I'm glad you found the above information useful, looking forward to see what you create!

Please let me know if you have any further questions, thanks!