• Welcome to the new Community Forums at HiveWire 3D! Please note that for security purposes our store and forum are on two separate servers so you will require a separate login for each. The store will ask you for your Real Name (WILL NOT BE displayed to the public) and the forum will ask you for a User Name (WILL BE displayed to the public). You may use the same email address and password for both.
  • We are having some issues with our customized styles. The forum will be open with the default style until we can correct the issues. Thank you for your patience.
  • Welcome, Guest! The results are in for the "Spin to Win" Render Challenge! Come check out the final gallery!

More Realistic Distance Falloff For Poser Atmosphere Depth Cue

Indeed, and it's (unsurprisingly) one of bagginsbill's - one that he left tantalisingly unfinished! It was part of an underwater environment that he did with Helgard over on Renderosity but never finished. I chased it up a few months ago and he helped me put this little bit of it together.

It's not like most other shaders - you have to manually enter the X, Y, Z coordinates of the camera you're rendering from into a node in the shader. Bagginsbill did a Python script using a callback fuction that automatically keeps this node updated, but I haven't got round to doing that part of it - manually entering the value is okay for me so far.

Here's a screenshot (explanation to follow in later posts):

falloff.jpg

The 'Camera_X_Y_Z' node is simply a 'User_Defined' (New Node > Math > user_defined) which is normally used to specify a user defined colour be specifying RGB values in the range 0.0 to 1.0. Bagginsbill pointed out that the internals of the Poser material treat vectors and colours as the same thing !?! Get your head around that concept

Camera X,Y,Z coordinates are in inches, regardless of your display units (mine are inches)
The Half_Distance defines how 'dense' the atmosphere is - the smaller the value, the thicker the fog. 500" is a good start (the 5,000" I have here was for a subtle atmospheric effect).

For more background, here's my post on the Renderosity "Underwater Submarine" thread where I found the tantalisingly unfinished idea...
I also started a "Distance From Camera To Point Being Rendered?" thread at RDNA, but bagginsbill had already abandoned ship there, although I managed to work out part of the solution on that thread.
Luckily bagginsbill saw the Renderosity post and said he'd moved to CGbytes, so I started a "Distance From Camera To Point Being Rendered" thread there, and he guided me to the solution above (any errors in that are mine!).

To avoid the need to keep thread-hopping I'll try and pull the most important bits from all those threads together here
 
For bagginsbill's explanation of how Poser's Atmospheric Depth Cue works, and why it's wrong, start at this post on page 3 of the Underwater Submarine thread at Renderosity and continue reading bagginsbill's posts, past two of kawecki's posts, until bagginsbill's

b = x / (1 - .5 ^ (x / h))

Wow - Yay!

That's what the node staircase descending down and right from the Atmosphere node to the 'Half_Distance_In_Inches' node (which is just a renamed Math_Function node) is doing. 'h' is the half-distance-in-inches', 'b' is the DepthCue_EndDist that it plugs into, and 'x' is the two pinky-purple lines coming from the node group in the upper right.

That node group in the upper right is calculating the distance from the camera ('Camera_X_Y_Z' node) to the point being rendered ('P' node), which was the missing bit that bagginsbill guided me to.
 
Top