Page 2 of 3

Re: Maya texture.outColor for Octane Materials

PostPosted: Fri Mar 21, 2014 3:04 pm
by face
Let´s speak over the "Fractal" shader as example.
Each renderer will have a version with which he can work. Also one version for the Maya renderer, one for MentalRay.
To use this shader in Octane, we need also a new version which runs with Octane.

To explain it a little bit better.
Each shader is a little program which has some input ports, some outputs ports which are filled with color information.
This information is calculated from the renderer.
As example without to be correct, the Maya renderer reads in the color information from an image with position x and y.
MentalRay will also read the color information, but with y, x. You see, this doesn´t match.
As a sidenote, it isn´t possible to share data between different render engines. You can use either this renderer or that, but not this and that.

Ok, back how to create the "Fractal" shader in Octane.
The big problem is to know, how the shader calculate the fractal.
We can go different ways of calculation, but the result wouldn´t match the result from Maya or MentalRay.
And remember, the result we get is only an image with an x/y resolution which must be mapped to the surface.
It´s the same when you create a fractal in Photoshop and use it as texture in Octane.
Over the API we have only the possibility to fill in a texture with some colors.


face

Re: Maya texture.outColor for Octane Materials

PostPosted: Fri Mar 21, 2014 3:27 pm
by dionysiusmarquis
Yay I really appreciate your explanations. Thank you for that. I thought that it's always possible to get the color Informations using the software Renderer as it's always possible to use it via the Hypershade to convert textures to files completely independent from the selected render engine and even while you'r rendering.

I think I will write a script which uses convertSolidTx to write switching temp files for the Octane file texture Node as a workaround.

I'll ask at Autodesks Maya Forums if its somehow possible to use the software render to get the Pixeldata renderer independent. Would this help?

Re: Maya texture.outColor for Octane Materials

PostPosted: Fri Mar 21, 2014 7:10 pm
by face
I don´t know that, im not a Maya boy ;)
But it can´t ever be wrong to ask.

face

Re: Maya texture.outColor for Octane Materials

PostPosted: Fri Mar 21, 2014 8:43 pm
by dionysiusmarquis
face wrote:I don´t know that, im not a Maya boy ;)


Double Kudos for your efforts!

Re: Maya texture.outColor for Octane Materials

PostPosted: Fri Mar 21, 2014 9:02 pm
by face
MentalRay is MentalRay if in Maya or in Softimage. The same is with Arnold or 3Delight.
They all use her own shaders and use/convert the standard ones more or less...

And if a question is interesting, then i can also answer ;)

face

Re: Maya texture.outColor for Octane Materials

PostPosted: Fri Mar 21, 2014 11:17 pm
by dionysiusmarquis
Yay I found something:
http://download.autodesk.com/us/maya/20 ... 0c015ddf20

As far as I understand its possible to sample any Texture color (2D/3D) with any Renderer.

http://mayastation.typepad.com/maya-sta ... xture.html

I'll start testing how fast it is. It would be really nice to be able to set the buffer of a rgb or float node just like in lua.

Code: Select all
 texturenode:setAttribute(octane.A_BUFFER, buffer)

Re: Maya texture.outColor for Octane Materials

PostPosted: Sat Mar 22, 2014 6:21 am
by face
Looks like a baking feauture.
But i don´t know how you will transfer the storage of the resulting colors to Octane.

face

Re: Maya texture.outColor for Octane Materials

PostPosted: Sat Mar 22, 2014 11:10 am
by dionysiusmarquis
Code: Select all
for i in range(resultColors.length()):

    resultVector = om.MFloatVector(resultColors[i])

    rgb = [resultVector.x, resultVector.y, resultVector.z]

    sampledColorsArray.append(rgb)


Now we have sampled color data per pixel in rgb (I didn't try so far but my guess)
Code: Select all
sampledColorsArray = [r, g, b, r, g, b ...] = [125, 125, 125, 255, 255, 255 ...]


And Octane NT_TEX_IMAGE takes A_BUFFER input as AT_BYTE Array (In Lua terms). Isn't that a match?

Re: Maya texture.outColor for Octane Materials

PostPosted: Sat Mar 22, 2014 11:42 am
by face
That should match but how you got the array to Octane?

I think you will get the data from the renderer which is current selected.
To work with Octane, you have to switch the renderer to Octane, how should this work?

face

Re: Maya texture.outColor for Octane Materials

PostPosted: Sat Mar 22, 2014 11:59 am
by dionysiusmarquis
No i think you can get the Pixel data at any time. The MRenderUtil commands aren't related to the selected render engine i think.

Edit: I'll test it. And report back