I am doing some NPR experiments and now I was wondering if there an elegant way to get the distance of an object (point to be shaded) to a light/camera/null in the RenderTree? I guess I can solve this using one of the Proximity Map generators out on the web, but I would like to know if this could be done with on-board/non-ICE/RenderTree tools only...
"distance to" in RenderTree???
- Hirazi Blue
- Administrator
- Posts: 5107
- Joined: 04 Jun 2009, 12:15
"distance to" in RenderTree???
Stay safe, sane & healthy!
Re: "distance to" in RenderTree???
It's possible directly (for point objects):
(Ingredients)
Vector_State node (set to "Intersection Point" - this outputs the position of the rendered point)
Vector_Save_state node (set expressions for X,Y,Z to the null's X,Y,Z respectively - outputs the nulls position)
(Plug into vector_input1 and 2 of)
Vector-Vector node, set to "Vector Input 1-Vector Input 2" (outputs difference vector)
(Plug into V1 of)
Vector-Scalar node, set to "Length of V1"
(Plug into)
Scalar to color
(Plug into)
Surface of Material
For this example the colors get black when you move the null close to the shaded surface
(Ingredients)
Vector_State node (set to "Intersection Point" - this outputs the position of the rendered point)
Vector_Save_state node (set expressions for X,Y,Z to the null's X,Y,Z respectively - outputs the nulls position)
(Plug into vector_input1 and 2 of)
Vector-Vector node, set to "Vector Input 1-Vector Input 2" (outputs difference vector)
(Plug into V1 of)
Vector-Scalar node, set to "Length of V1"
(Plug into)
Scalar to color
(Plug into)
Surface of Material
For this example the colors get black when you move the null close to the shaded surface
softimage resources section updated Jan 5th 2024
- Hirazi Blue
- Administrator
- Posts: 5107
- Joined: 04 Jun 2009, 12:15
Re: "distance to" in RenderTree???
Ah, I knew something must be possible in good old-fashioned RenderTree style.
Thanks for the info... ;)
Thanks for the info... ;)
Stay safe, sane & healthy!
Re: "distance to" in RenderTree???
Hi, I found this thread when searching for an answer on how to change a material's attributes based on distance to an object or camera. For instance, changing color the closer to the camera, or fading into full transparency etc.
I followed the explanation above and this works - it gets me a black dot when the null is close to the surface of my object. The dot is always the same size though, and always black. How do I use this to create a gradient on color/transparency etc etc with controllable falloff?
Or is there another method altogether for that type of effect?
I followed the explanation above and this works - it gets me a black dot when the null is close to the surface of my object. The dot is always the same size though, and always black. How do I use this to create a gradient on color/transparency etc etc with controllable falloff?
Or is there another method altogether for that type of effect?
Re: "distance to" in RenderTree???
Hi, in that case you can use a mixer->gradient node instead of the "scalar to color" node. By modifying the gradient you have full control over radius/colors.
Be sure to use mixer->gradient node, not the texture->gradient node.
Be sure to use mixer->gradient node, not the texture->gradient node.
softimage resources section updated Jan 5th 2024
Who is online
Users browsing this forum: No registered users and 25 guests