Make Outline material fade/hide with distance
I'm using a simple outline material within my PostProcess Blendables to make a custom hover/non hover effects over all props I need. Sometimes, on a big distances this looks ugly because this effect scales up with distance. So I'm interested in fading/hiding this effect from a player camera over 1000 meters or more. Is it possible to achieve and how it possible if so?
asked Aug 16 '16 at 07:28 PM in Rendering
Figured it out.
Duplicate your outline script. Add a new Lerp node and plug it into emissive. Plug The original outline script into Lerp A. Plug the duplicate outline into Lerp B. Add the script in the image to the Alpha. Mess with the Divide and Power constant to determine the best fade from first person camera for your situation. Mine is 250000 Divide, .5 Power. On the Duplicate script (plugged into B) in my case, I just turned the parameters to 0 (line width, bloom, etc.) which effectively shuts the outline off, so it fades from the original outline to no outline in the distance. If you want to, you can compound this script and have it fade in layers, for example, near outlines could be blue, then they fade to yellow in the distance and then fade out completely far away. This fade script is similar to how I fade ground textures out in the distance.
answered May 04 '17 at 04:25 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here