PDA

View Full Version : Distance to Camera Gradient behavior in Nodes for surfacing



tcoursey
03-25-2015, 12:58 PM
I have used the gradient "Distance to Camera" in the layers surfacing for years....I usually use to to help with Bump maps and other things...allowing things far away to not use bumps or similar to help with AA etc.

However I'm now trying to convert things into Nodes as they are more powerful and have things the layers just don't.....but there is no Gradient type of Distance to Camera.

I know I can manually get Spot Info etc...but that doesn't help to HARD CODE in a CAMERA Info when the camera may change when I setup difference scenes....

Hope this makes sense and there is an easy way to do this....thanks for any info.

Surrealist.
03-25-2015, 03:17 PM
Have you tried using a Layer node for this parameter in your node set up? Bump Scalar and Color all have distance to Camera.

gerry_g
03-25-2015, 05:56 PM
yes I do that a lot, don't even have to make it distance to camera anyway, can use a null and select it with 'distance to object' setting that way you have independence to camera and are less restricted, plus I often find it easier to position, only thing it does not seem to work well for is displacement as it lessons mesh resolution and displacement simultaneously

tcoursey
03-25-2015, 08:09 PM
Have you tried using a Layer node for this parameter in your node set up? Bump Scalar and Color all have distance to Camera.

We'll that's what I'm trying to find...I don't see that as an option in the gradients in the node editor. Maybe I'm trying to setup the node chain in a way it shouldn't be.

How would you set this up in NODES?

In layers I would have the main layer in let's say the bump channel, then add another layer (gradient) in that channel and then making it distance to camera and blending mode of ALPHA. Set the gradient to the distances and values I want and viola!

Sensei
03-26-2015, 01:20 AM
Spot Info > World Position 1st input,
Item Info (Camera) > World Position 2nd input
to Math > Vector > Distance
then to Gradient
then to Tools > Mixer.

1st input to Mixer, Const > Vector with 0,0,0
2nd input Bump.

Sensei
03-26-2015, 01:39 AM
This Full HD video is showing how to fade away bump with distance to camera (or other item).

https://www.youtube.com/watch?v=FsMp514f4IE

RebelHill
03-26-2015, 05:48 AM
layer node...

Surrealist.
03-26-2015, 05:51 AM
We'll that's what I'm trying to find...I don't see that as an option in the gradients in the node editor. Maybe I'm trying to setup the node chain in a way it shouldn't be.

How would you set this up in NODES?

In layers I would have the main layer in let's say the bump channel, then add another layer (gradient) in that channel and then making it distance to camera and blending mode of ALPHA. Set the gradient to the distances and values I want and viola!

Go to Add Node and you'll find three Layer nodes. Color Scalar and Bump. Open those up and you have most of your layer options inside. So nested in a node you have a layer system you can use. Then plug that output where you need it to control distance to camera setting in your node tree.

(Edit to clarity you set this Layer Node to Gradient and use Distance to Camera)

tcoursey
03-26-2015, 09:38 AM
Thanks everyone....I understand the Layer Node now. Why it's there I guess. Not in love with having to use 3rd party plugins (TrueArt) although they may be great, nice to know how/what they can add.

Thanks again...

Sensei
03-26-2015, 08:45 PM
TrueArt's Node Library is free.
You only need Render Info and Extended Item Info when you have multiple cameras in scene.
But if you have just one, native Item Info will be sufficient.

The same way you can make "Camera Null" that's always at position of currently rendering camera (and switching from one to another in multi camera scene).

aquinde
05-08-2015, 02:04 PM
I have a related question. It may warrant a separate thread, but...I'm looking for a way to use a gradient to control the color of the 'apertures' of a wall of instanced lighting fixtures. I'm not looking for them to emit light...its just for eye candy.

Using an Item Info node is simple enough to get random colors from a gradient but that looks messy. Using a gradient on a Color Layer node shows the gradient on the face of the polys or a stepped color change within the poly. What I'm looking for is the color to be of one value for the instanced poly, and that color to be driven by distance from a null.

Does anybody have an idea for this?