Depth fade doesn't care about fade distance input at large scale?

I am trying to make highlighting orbs that indicate when something is passing in and out of them using the DepthFade(with 1-x to its output) material node, as many tutorials online say it can be used. However, no matter what I put into the DepthFade material blueprint node, it builds up from the bottom when I move the camera up into outer space so that the intersection highlighting area becomes to big and eventually overtakes the entire highlighting orb. :

This is essentially what I am working with:


^And no matter what I put into the depth fade params (camera to material distance variations, negatives, large numbers, small numbers, vertex normals) …The depth fade does this same thing with only tiny delays to the unwanted behavior achieved:


^besides the spot developing in the back, this is almost exactly the behavior I want to keep.

Camera a little higher, and you can start to see the unwanted depth-fade distance moving up with the camera and overtaking the highlighting orb:

and this is the most common use case in my game, with the camera looking down from outerspace. The depth-fade distance from the earth has completely overtaken the highlighting orb. Its completely useless to me like this. I need to be able to see through most of it…

If it didn’t have this growing highlight-area behavior, it would be absolutely perfect for I need it for. This is my 2nd multi-hour attempt and trying to get it to do what I want(I am not a design/material guy) and I just can’t stop it from doing this?

If you can answer any one of the following questions for me it should help:
Is there another way? Could I emulate it with more low-level math nodes and tweak it from there? How would I get to the DepthFade source code so I could see if I am smart enough to copy and tweak it? Is there a known fix I can’t find on the internet?

1 Like

What is the scale of the cone?

1 Like

Sorry, I didn’t mean ā€œscale.ā€ It’s actually really large actors(in Unreal cm). That is the default Unreal cone at about 100,000 scale, and the ocean below it is the Earth in real meters. The section you are looking at in the pictures is the Pacific Ocean between California and Hawaii.

I put ā€˜scale’ in the title when I think I meant ā€˜large actors.’ The problem happens no matter if it is small actors scaled up or really large actors.

1 Like

Is it supposed to be a line around the intersection?

I used this material at 50000 scale, and it seems ok

DepthFade

Even though the depth of 100 doesn’t make any sense… :rofl: But you will get all sorts of problems with huge scales. You might be better off scaling the whole thing down. I can’t tell this is 50000 scale even while I’m using it ( apart from distance fields and depth fade doing strange things ).

If someone is flying around in a spaceship ( or whatever ), they can’t tell what the scale is.

1 Like

I think the problem is more of the scale of the 2nd sphere, the Earth, on which the highlighter orb is sitting. And what breaks it is moving the camera away from the highlighter orb or the earth (away or up). That’s what I am asking for help with.

1 Like