0
$\begingroup$

enter image description here

It's supposed to be here.

what I actually need to do is make a shader that mixes between shaders not colors dependent on camera distance, mixing between colors works, but using as a factor on the shader mix node doesn't, so I thought maybe I could use the squeeze value on the camera data node as mentioned here:

http://blenderartists.org/forum/showthread.php?82183-Camera-Data-Node

$\endgroup$
2
  • 4
    $\begingroup$ That forum thread is from 2006, way before Cycles existed. Cycles never had a 'squeeze' node, but someone might be able to tell you the equivalent. $\endgroup$ Feb 26 '16 at 11:37
  • 1
    $\begingroup$ I agree with @RayMairlot, never saw that node in Cycles (while for Blender Render is still available). I would suggest to better explain what's your goal, so a workaround to "fake" it could be found. $\endgroup$
    – Carlo
    Feb 26 '16 at 11:41
3
$\begingroup$

Thanks for all the help everyone, i found the solution, it wasn't working because i had the camera in orthographic mode, here i'll post a picture of the node setup that works.

Note the title of the question is now misleading, so the answer to that question was that cycles does not have a squeeze node, but the answer to how to blend between two shaders based on distance from the camera is here. enter image description here

$\endgroup$
0
$\begingroup$

I just did some tests and it seems you can kind of simulate the Squeeze node using a combination of Multiply and a Color Ramp on the Camera Data node's View Distance or View Z Depth properties to control the shader mix factor. It takes a bit of fiddling to get right but it definitely works. I have never used the Squeeze node, so I cannot compare ease of use but I assume it would be a little easier.

In my example I scaled the default cube along the Y-axis so it was 50 BUs long and then positioned the camera at one end, pointing at the other. I then had to multiply the output by 0.02 (so that 50 would become 1) before passing it into a color ramp which I then adjusted to line up with the location of my cube, i.e. in order to have the nearest point of the cube be 100% material 1 I need to move the black slider to the position value that corresponds to the distance between the camera and that nearest point (multiplied by 0.02), then do the same for the farthest point and the white slider.

$\endgroup$
2
  • 2
    $\begingroup$ can you add images of your node setup? $\endgroup$
    – user1853
    Feb 26 '16 at 14:31
  • $\begingroup$ I already closed the project again after looking at forferdeilig's answer which is actually less fiddly than what I did and gives better results, too. $\endgroup$ Feb 26 '16 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.