Maya texture.outColor for Octane Materials

Forums: Maya texture.outColor for Octane Materials
Autodesk Maya (Plugin developed by JimStar)

Moderator: JimStar

Re: Maya texture.outColor for Octane Materials

Postby face » Fri Mar 21, 2014 3:04 pm

face Fri Mar 21, 2014 3:04 pm
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
Win10 Pro, Driver 378.78, Softimage 2015SP2 & Octane 3.05 RC1,
64GB Ram, i7-6950X, GTX1080TI 11GB
http://vimeo.com/user2509578
User avatar
face
Octane Plugin Developer
Octane Plugin Developer
 
Posts: 3204
Joined: Sat Mar 06, 2010 2:10 pm
Location: Germany

Re: Maya texture.outColor for Octane Materials

Postby dionysiusmarquis » Fri Mar 21, 2014 3:27 pm

dionysiusmarquis Fri Mar 21, 2014 3:27 pm
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?
Last edited by dionysiusmarquis on Fri Mar 21, 2014 11:28 pm, edited 1 time in total.
User avatar
dionysiusmarquis
Licensed Customer
Licensed Customer
 
Posts: 159
Joined: Mon Nov 04, 2013 9:29 pm

Re: Maya texture.outColor for Octane Materials

Postby face » Fri Mar 21, 2014 7:10 pm

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

face
Win10 Pro, Driver 378.78, Softimage 2015SP2 & Octane 3.05 RC1,
64GB Ram, i7-6950X, GTX1080TI 11GB
http://vimeo.com/user2509578
User avatar
face
Octane Plugin Developer
Octane Plugin Developer
 
Posts: 3204
Joined: Sat Mar 06, 2010 2:10 pm
Location: Germany

Re: Maya texture.outColor for Octane Materials

Postby dionysiusmarquis » Fri Mar 21, 2014 8:43 pm

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


Double Kudos for your efforts!
User avatar
dionysiusmarquis
Licensed Customer
Licensed Customer
 
Posts: 159
Joined: Mon Nov 04, 2013 9:29 pm

Re: Maya texture.outColor for Octane Materials

Postby face » Fri Mar 21, 2014 9:02 pm

face Fri Mar 21, 2014 9:02 pm
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
Win10 Pro, Driver 378.78, Softimage 2015SP2 & Octane 3.05 RC1,
64GB Ram, i7-6950X, GTX1080TI 11GB
http://vimeo.com/user2509578
User avatar
face
Octane Plugin Developer
Octane Plugin Developer
 
Posts: 3204
Joined: Sat Mar 06, 2010 2:10 pm
Location: Germany

Re: Maya texture.outColor for Octane Materials

Postby dionysiusmarquis » Fri Mar 21, 2014 11:17 pm

dionysiusmarquis Fri Mar 21, 2014 11:17 pm
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)
User avatar
dionysiusmarquis
Licensed Customer
Licensed Customer
 
Posts: 159
Joined: Mon Nov 04, 2013 9:29 pm

Re: Maya texture.outColor for Octane Materials

Postby face » Sat Mar 22, 2014 6:21 am

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

face
Win10 Pro, Driver 378.78, Softimage 2015SP2 & Octane 3.05 RC1,
64GB Ram, i7-6950X, GTX1080TI 11GB
http://vimeo.com/user2509578
User avatar
face
Octane Plugin Developer
Octane Plugin Developer
 
Posts: 3204
Joined: Sat Mar 06, 2010 2:10 pm
Location: Germany

Re: Maya texture.outColor for Octane Materials

Postby dionysiusmarquis » Sat Mar 22, 2014 11:10 am

dionysiusmarquis Sat Mar 22, 2014 11:10 am
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?
User avatar
dionysiusmarquis
Licensed Customer
Licensed Customer
 
Posts: 159
Joined: Mon Nov 04, 2013 9:29 pm

Re: Maya texture.outColor for Octane Materials

Postby face » Sat Mar 22, 2014 11:42 am

face Sat Mar 22, 2014 11:42 am
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
Win10 Pro, Driver 378.78, Softimage 2015SP2 & Octane 3.05 RC1,
64GB Ram, i7-6950X, GTX1080TI 11GB
http://vimeo.com/user2509578
User avatar
face
Octane Plugin Developer
Octane Plugin Developer
 
Posts: 3204
Joined: Sat Mar 06, 2010 2:10 pm
Location: Germany

Re: Maya texture.outColor for Octane Materials

Postby dionysiusmarquis » Sat Mar 22, 2014 11:59 am

dionysiusmarquis Sat Mar 22, 2014 11:59 am
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
User avatar
dionysiusmarquis
Licensed Customer
Licensed Customer
 
Posts: 159
Joined: Mon Nov 04, 2013 9:29 pm
PreviousNext

Return to Autodesk Maya


Who is online

Users browsing this forum: No registered users and 1 guest

Sun Oct 25, 2020 1:33 pm [ UTC ]