Hi. I'm working on a scene that involves several types of laser beams. They are modeled as cones and I was hoping to render them with the Standard Volume shader, but when a beam gets more focused (smaller radius) it becomes less visible instead of more visible.
So is there a way to 2D map the density so a small radius will light up more than a large radius?
Solved! Go to Solution.
Not entirely sure I understand, but intuition says Float ramp on a single axis, like v or u and then pipe it up and scale it.
Thanks for replying so quick! This screenshot might help. The diagonal part of the laser focuses on a small point and that's where I want the beam to be the most bright.
Thanks for the effort! Still when I render the ramp seems to be aligned to the screen rather than to the object when viewed at an angle. I can't open your file because my workplace is still using Max 2019 (Arnold 3.0.77.0). Also my Ramp Float node has an extra input slot ("type").screenshot-2.jpg
Attached 2019 file.
Now I see your cone looks very different than mine, so I am not sure my setup is working for your item, but the gradient translates, so just adjust it so it works in your case.
Have you tried viewing it at an angle? Because your file has the same result (horizontal cutoff instead of object-aligned). You'll see it better with interpolation set to constant.
Btw, you can also achieve this with a spotlight using a high Lens Radius and atmosphere volume enabled.
That is because float ramp is screenspace pr default, you can map fix it in several ways.
I set up a camera projection here as an example:
@Mads Drøschler could you please teach me how to adjust the Ramp from screenspace to object space? I still can't seem to make it work and I want to avoid using lights.
Try use a camera projection node, put the ramp into input and send out the info to the volume material from the camera projection shader, remember to pick actual scene camera ( you have to click a button in the shader UI and then pick the camera in the viewport ) - and adjust its position so it covers the item, now you can make a float ramp on a specific axis on the item.
If you need to animate the beams with rotation or soemthing simular, remember to move the camera projection camera with it, interconnect them.
Mads, thanks for your insights here. I'm having a hard time getting the camera projection to work the way I want- just a simple gradient or ramp on a box, where the bottom has a density of 1 and the top has a density of 0 and a clean blend in between. I'm trying to make an atmosphere box that I could stick in a valley to simulate an atmosphere that's thick down below and thinner higher up. You mentioned being able to fix the mapping of the float ramp in several ways- can you list some other options? Thanks so much!
Can't find what you're looking for? Ask the community or share your knowledge.