Hello everyone,
I am a beginner in shader graph and I’m working on a shader to highlight a zone using a cylinder, and I’ve run into several issues that I can’t solve despite my efforts. I’d greatly appreciate your help to move forward.
My goal is to show players a zone where specific rules apply, whether they are inside or outside the cylinder. I’m using a flame effect on the terrain and objects to draw the zone boundaries, along with a repeating icon above the effect, around the cylinder.
I’ve been stuck on a few points for more than a week. Here are the main issues I’m facing, they are from differents version of the shader at the time I found the issue and moved up to another topic and found more issues…
-
Displaying the flame effect at a specific height above the intersection:
The idea is to have the effect visible above the intersection point with the terrain topology, regardless of its shape. I found a solution using the depth buffer, but I don’t think it’s the best method because it has the following issues:-
If the depth buffer value is too high, the effect doesn’t render properly, as shown in the screenshot where the cube intersects the cylinder: the flame effect almost disappears above the cube.
I want to have something close to that, with a lerp & adapted better to the cube geometry.
I tried another method by checking the intersection at a position under the point
it does the trick for the cube but it doesn’t for complicated meshes like the player : it duplicate the flame effect around the arm -
With my current method, the effect abruptly stops when it reaches the maximum height, but I’d like it to transition more naturally, like actual flames.
-
-
Displaying icons around the cylinder:
I managed to make the icons repeat around the cylinder after some struggles, but:- I haven’t figured out how to position them at a specific height above the intersection.
- The icons aren’t displayed properly, as shown in the attached screenshot. The red squares indicate where the icons should be draw.
- I also can’t prevent the icons from repeating on the Y axis, at the top and bottom of the cylinder. I believe solving the positioning issue will also help with this problem.
-
Excluding certain meshes:
Currently, the effect appears even on the leaves of trees, which isn’t very aesthetic, as you can see in the screenshot.
I’d like the effect to ignore certain objects like the player, AI, or trees. This is a minor issue, but I’m curious to know how to handle it.
Thanks in advance for your help and guidance! If you need more informations or the shader graph I can provide it.