OSL Volume Displacement helper node, download free.

madsd
Advisor

OSL Volume Displacement helper node, download free.

madsd
Advisor
Advisor

Hi,
A user asked about how to make decent clouds out of the box with Arnold in Max on the Arnold facebook group yesterday.

 

So I wrote a small helper node to make it very easy to get going, based on Zap's OSL 3D Noise.

 

Download and put the file into the plugins/OSL folder and restart app, then the Volumedisplacment node is visible in the main category of OSL.

 

https://github.com/gkmotu/OSL-Shaders/blob/master/VolumeDisplacement.osl

NOTE! you need to disabled "stepping" in the OSL 3D noise node, else the scattering will drift, and wont be normalized correctly.

 

Used Arnold to visualize, but you could I guess use any engine that works with OSL.
Have fun!

 

qwe.jpgqweqwe.png

qweqwe.jpg

 

VolumeDisplacement_tut.gif

Reply
2,075 Views
10 Replies
Replies (10)

sdeters
Advocate
Advocate

Would be able to share your cloud scene in Max 2020?  Or have a video on the setup?  My Cylinder is not behaving nicely.

0 Likes

madsd
Advisor
Advisor

Attached a 2020 scene of the torus.

Here is another one, internal ray scatter at 10 rays.
Up this value to get richer and more realistic internal illumination.
I colored the direct lights shadows dark blue, it triggers a nice color towards thickness in clouds.


Notice I use an Arnold Direct light and a skydome, no need for the physical environment.

 

 

eee.png

0 Likes

madsd
Advisor
Advisor

Ideally yes, should make a video.

There are things that needs to be done in order to get it working.

 

 

  • add the OSL node between the OSL 3D noise and displacement slot.
  • DISABLE "stepping" in the OSL 3D noise.
  • Never touch the "amplitude" in the OSL 3D noise.
  • Increase volume padding on the Arnold properties modifier to 60-70 ( so displacement isnt cut off )
  • Increase the "scatter" amount on this shader to scatter the displacement uniformly across the surfaces.

 

Wont work on the GPU here at the moment, the padding is broken, but I have noted the developers and we have chatted about it.

sdeters
Advocate
Advocate

Thanks for the scene, and feedback.  I have a cool thought for my mechanical videos I am working on.  Well in my mind it is a cool thought, see if I can make this work.  Thanks again.

 

Edit

Now I see why my scene was blowing up on me.  Duh.  Thanks again

 

0 Likes

Anonymous
Not applicable

Thanks for your input. I am attaching an error showing me 3ds Max 2019 when I start the application (after adding the OSL file in the OSL directory). How can I solve this problem? (Volumedisplacement doesn`t exist on OSL list)
Thanks again, Fabian

0 Likes

madsd
Advisor
Advisor

This is a weird issue Fabian.
The code only relies on simple math, so it puzzle me why it wont work in 2019.
I have asked someone with a 2019 copy to give the shader a spin to help me debug it, I dont have 2019 installed.


Will return at a point, no ETA.

0 Likes

madsd
Advisor
Advisor

I asked a user with 2019 installed, and he gets no errors.
The node works fine in his copy.

He grabbed the code and recompiled it in a node, swapping out the code in some random OSL shader.
You downloaded the actual .osl file and installed it in the plugins/OSL folder.

So we have to figure out, where you introduced a glitch in the procedure.

Try to just grab code, and open code editor in a math "add" node, and press f7. If that works, save out the OSL node fromwithin the OSL code editor to Plugins/OSL and name it like you want. then it should work.

image.png

0 Likes

madsd
Advisor
Advisor

I see my 2 posts were directed to myself, here is a post that should trigger in your email system.

0 Likes

Anonymous
Not applicable
Thanks for your quick answer !!!... well i`ll try to fix this issue and let
you know which case works for the best
Regards. Fabian
0 Likes

madsd
Advisor
Advisor

We found out a couple of days it does work on the Arnold GPU.
I only checked it in the Arnold IPR render ( ARV in realtime mode ) and here, it's currently broken.
It works perfect in production mode ( hit the good old render button )

0 Likes