1

I know that one can use a Gradient texture and Texture Coordinates node to fade an object out the farther it is away it is along an axis. They can even use a Mapping or Separate XYZ node to change the direction of the fade.

However

Using a Mapping node can be tedious, especially in an animation. I was wondering if it was possible to fade an object out away from the camera direction via a straight up Vector/Input node output or a combination of Vector/Input nodes.

David
  • 49,291
  • 38
  • 159
  • 317
Shady Puck
  • 8,847
  • 6
  • 34
  • 61

2 Answers2

2

You could use camera distance instead, that way it dynamically adjusts transparency relative to camera position dynamically.

Just use the Input > Camera Data node instead. Some math nodes to adjst the factor may be needed.

Camera Data Node

Duarte Farrajota Ramos
  • 59,425
  • 39
  • 130
  • 187
  • I had seen the Camera Data node, but I couldn't get it to work. Thanks! Also, how does that Divide node affect things? What is it dividing? Lastly, I tried replacing the Ambient Occlusion node with a Diffuse BSDF, but the results weren't as good. Why would Ambient Occlusion work better? – Shady Puck May 28 '16 at 22:51
  • The math node is dividing the actual distance from the camera to the object in Blender Scene units. You'll have to adjust it according to your scene's size and desired threshold distance. Replacing the ambient occlusion with any other shader should have no effect on the setup whatsoever, I just used the ambient occlusion because it is fast to render and requires no lighting, making it simpler to post here – Duarte Farrajota Ramos May 28 '16 at 23:11
  • 1
0

The aforementioned one way that I figured out produced a result like this. By default, it aligned the vector with the center of the camera's view.

View 1:

enter image description here

View 2:

enter image description here

View 3, with later-mentioned Mapping node modifications:

enter image description here

Node setup:

enter image description here

The Fac: vector setup works by utilizing the Texture Coordinate node's Object output. I obviously selected the camera as the object. I then used a Mapping node because the Z-rotation was off. The divide can be moved up and down by adjusting the Mapping node's Location: values. I found X: to be particularly effective.

Shady Puck
  • 8,847
  • 6
  • 34
  • 61