Blending textures, custom Maya node not compatible with Vray

172 views
Skip to first unread message

Enrico Losavio

unread,
Mar 21, 2015, 6:46:50 PM3/21/15
to python_in...@googlegroups.com
Hey folks,

I've been struggling to find a way to blend together many 32 bits exr displacement maps in Maya.
We decided to go with the Overlay blend mode, but Maya doesn't seem to offer any easy way to achieve it (layered texture doesn't seem to work, and is a very fragile node)
So we adapted the Overlay function (see HERE) to the (-1 , 1) range, and then we tried to recreate it with a network of nodes, but soon it turned out to be too long and tedious for all the textures (20+).

So I quickly wrote a custom Maya node to do the job.
Since my disp maps are using only one channel, the node takes an array of float as an input (the textures) , and outputs one float (my final texture):

    blendDisplacement.a_inTextures = mFnAttr.create("inTextures", "inTexs", OM.MFnNumericData.kFloat, 0.0)
    mFnAttr.setKeyable(0)
    mFnAttr.setWritable(1)
    mFnAttr.setArray(1)
    
    blendDisplacement.a_outTexture = mFnAttr.create("outTexture", "outTex", OM.MFnNumericData.kFloat, 0.0)
    mFnAttr.setReadable(1)
    mFnAttr.setWritable(0)
    mFnAttr.setKeyable(0)

Testing the node in the Hypergraph, or rendering with Maya Software I see it works perfectly.
But when I try rendering with VRay i get a // Warning: Unsupported texture blendDisplacement (which is my node).
Same story with MentalRay: i get a // Warning: (Mayatomr.Scene) : output data type "rgba_h" not directly supported by image format iff, conversion performed by mental ray // 

Now, I know VRay is a bit picky with textures, but my input is still a compatible file type... and a python float has 53 bits precision (way more than 32).

What is going wrong? And how can I make my node compatible with others render engines? 

Any ideas out there?

Thanks!

Enrico

Justin Israel

unread,
Mar 21, 2015, 10:11:13 PM3/21/15
to python_in...@googlegroups.com

Is this post relevant to your problem?
http://forums.autodesk.com/t5/shading-lighting-and-rendering/warning-mayatomr-scene-output-data-type-quot-rgba-h-quot/td-p/4290734

It suggests that half float is not supported for iff and that changing settings/format would solve it.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ad14684c-e275-4131-a52d-bc2d56f183aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Roy Nieterau

unread,
Mar 22, 2015, 4:42:49 PM3/22/15
to python_in...@googlegroups.com
If you want your node to be renderable wih Vray you'll need to implement a Vray plug-in as counterpart of the Maya node.

Instead you could also implement the algorithm of an overlay with a mixture of built-in nodes in Maya.

How Vray renders maya nodes:
Every Maya node that has a Vray plug-in implemented can be used in the rendering tree. So built-in Maya nodes that can be used with Vray also have a built-in counterpart in Vray. If you make your own node you will also have to implement its counterpart.

Enrico Losavio

unread,
Mar 23, 2015, 8:19:20 AM3/23/15
to python_in...@googlegroups.com
Hey, thanks a lot for the hints.

I tried all the Data Type options in the Mental Ray's Framebuffer menu. Some of them suppress the error message, but still the texture is not taken into account by the renderer. It's just black!

I also tried to change the data type into my node, from kFloat to kDouble, to achieve a higher precision and to see if it was making any difference, but apparently it's not.

What I don't understand is that my node has floats as input, and a float as output. So I am not 'contaminating' the value. What the hell is going wrong?

I do really need to make this work with Vray. I already tried to implemented the algorithm with a network of maya nodes, but it's very intricate. I need at least 5 nodes to blend each pair of textures, and I have about 20. I would have to lay down one hundred nodes or so!
Do I really have to write a Vray plugin in order to make my node compatible with VRay? Isn't there an easiest way? Writing a counter-plugin for Vray seems to be too much work for this task! 

Seems like this small piece of pipeline is taking longer than expected.
Maybe i shold consider a different approach to the problem!

What do you think?
Reply all
Reply to author
Forward
0 new messages