Depth Fade

Node-based Shader Editor
Post Reply
Takamba
Posts: 5
Joined: Tue Dec 04, 2018 10:23 am

Depth Fade

Post by Takamba »

Hi all

How does the Depth Fade Node calculate the distance to geometrie behind the surface it is attached to?

Perpendicular to the camera plane, or along the normals of the surface it is attached to?

An explanation is much appreciated.

Regards,
Phil
User avatar
Amplify_Borba
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Depth Fade

Post by Amplify_Borba »

Hello! Internally, the node calculates the distance value by subtracting the Surface Depth by the value fetched on the Depth buffer.

You can also check all specific operations done by each node by examining its code, in this case you can find the script in the following path: AmplifyShaderEditor\Plugins\Editor\Nodes\HelperFuncs\DepthFade.cs
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Takamba
Posts: 5
Joined: Tue Dec 04, 2018 10:23 am

Re: Depth Fade

Post by Takamba »

Well, I dont understand what this code is doing at all.

Where can I find more informations about the depth buffer?
User avatar
Amplify_Borba
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Depth Fade

Post by Amplify_Borba »

There are many good sources of information including the Shaders and Effects Cookbook, Nvidia's GPU Gems, LearnOpenGL, Z-Buffering and Unity's documentation.

Since shader knowledge is interchangeable, all sources of information, even from other engines, can be useful to learn more about its intricacies.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Post Reply