Ramp depending on object space


Hey guys,

I have a situation where I just can’t find a solution and hope to find a hint. I am not asking you for doing the work for me, just point me in the right direction so I have a chance to get the information I need to solve my problem. After hours of trying and “googling” I am just :cry:

The setup and target:
I have a sphere with a VRay Material on it and a VRay Environment Fog. The material is fully transparent, so only the fog gets render. So far it works great. The surface and the volume shader are applied to a sphere. I need to control the color and the density of the fog dependent on the distance from the sphere center point. So basically I need a controlable ramp from the center to the surface of the sphere.

The problem:
In 3DS Max the solution would be very easy: Take a gradient ramp and set it to “object space” and have fun. But I can’t find something like this in Maya. There is only a regular ramp (2D). I thought about taking object x, y, z from samplerInfo Node but can’t figure out a way how to apply those. The reason why I need the ramp is so the color and density can be fine controlled on the outer parts. I need several layers without using multiple spheres with multiple environment fogs.

Thank you very much in advance!


not sure it’s wat you mean but wouldn’t it be the classic samplerInfo.facingratio to a Vrampcoord of the ramp? so samplerInfo.facingRatio -> ramp.vcoord

try that and tell us if that it’s what you’re looking for.


Thank you for your reply! But the facingRatio is not what I am looking for. The facingRatio is there to mimic fresnel-like shading.

I try to make a better understandable explanation:
What I need is the possiblity to change values from the center (the middle of the inside of the sphere) of a sphere to the surface – not from the center of the surface to the side of the surface.

This is not the effect I try to achieve, this image just should explain the kind of ramp that I need. I need this kind of ramp on a volume because I want change properties of a environment fog throughout it’s spread. So let’s say it begins with a red color in the center, goes through white and fades to blue on the surface. And also the density.

I hope this was a bit better to follow what I am talking about. Otherwise I will look for some more pictures, which make it more obvious.

Thanks again!


Hi, did you ever find an answer to your question? I’m looking for a solution to the same problem… I’m following the Mastering V-Ray course, and I need to be able to control environment fog’s density (contained in a mesh) using a ramp. In the course the tutor shows how to do it using the Object XYZ in 3D Max (as you described), but I can’t seem to find a way to do it in Maya!

Any help would be greatly appreciated!


why don’t you simply show us how you do it in 3dsmax? It would be much easier and clearer to understand rather than guessing.


I’m afraid I don’t have a copy of 3DSMax to be able to show you…

The closest I can get in Maya is by using a Ramp (Projection) node instead of a Ramp (Texture) node, this then creates a 3D texture node for the ramp. Although when I try to join up a noise texture node to the ramp’s colours, the results are really different to what is achieved in 3DMax.