Opacity change with distance?
-
Hello,
I made a distance from the camera setup in RS material to control the object's opacity with respect to distance from the camera.
The setup is state node (raylength) connected to change range (controlling the depth) node and ramp node is at the end.
My setup works with color, but does not affect opacity, objects alpha is full white throughout depth.
The simplified scene is attached.What am I doing wrong?
Thank you.Best regards,
ZG
-
Hi ZG,
Thank you for your file.
I assume you do not do anything wrong. I have the impression, after a few hours trying any combination, that it is not working as it should. It was set to “World”, but Camera as distance mode doesn’t solve the problem
I have filed a report .
Here is a workaround, while I'm not sure it is working for you, as you mentioned that the file is a simplified version.
CV4_2026_drs_26_RStd_02.c4dLet me know if that works
Cheers
All the best
-
Hi Dr.Sassi,
Thank you for the suggested solution. This could work as a temp solution.
I managed to solve my problem by rendering the Z-depth pass and using it as additional alpha. -
Thank you, ZG, for your patience.
Yes, Z-Depth might be even better, but I understand that this creates an extra step.
I hope the State Node is in working condition in no time.
My best wishes.
-
Usually, when I'm on a project with a tight deadline, it's time-consuming to troubleshoot the problem.

Yes, Z-Depth was an extra step, but it was a fast solution since I could not find a fast and intuitive one to control alpha.
Actually, it was very useful for adjustments in post.
I also hope the State Node bugs are fixed soon.BTW, while working on this project, I really missed the "bypass node" feature in the material node editor. Most node-based apps have this feature.
Having a "bypass node" or "pass-through" switch on nodes would be a great feature, and I requested it long time ago but still no sign that it could happen.
Can you have some influence on dev team regarding that
Thank you.