I need to have a displacement maps displacement value controlled by the sampled pixels distance to the camera. I create a shading network that do this, but when I render with mental ray it dosen't work... I did this in maya7 and 8.
I created a lightinfo node, and a set range node.
I connect my cameras world matrix to the lightinfos wordmatrix.
I connect the lightinfo sample distance to the setRange inputX.
I set the Range old 0-100 to new 0-1.
To test that it works I connect the setrange outvalueX to a lambert ColorR ColorG ColorB.
I assign the lambert to a cube. And render the cube from difgferent distances to it. It should now change color from white to black in relation to the distance. And with maya software renderer it does work. With mental Ray though it dosen't.
Do you know what could be wrong here?
EDIT: Stange! It works if I write my own setRange expression. Meaning if I with expressions take the lightInfo.sampleDistance set my new range with expressions and set the color of the lambert with expressions. This indicates to me that the setrange has an issue wtih mental ray. Or what?
EDIT 2: It was 2 o clock in the night here in denmark when I had the problem, and maybe I overlooked something. Today I worked further wih the problem, and now It dows work with just connecting the nodes in the hypershade, and without expressions and mentalray. But my shading network is not the same as when I had the problem. I can still get the problem by using the old shading network, but the new one I made works.
Still. The 2 shading networks works with the Maya Software render, so there is still something to investigate. When I have an explanation I'll post it.