Hi, anyone using the new mia shader for mentalray?

I made a mia_wrapper that makes it possible to splitt the result innto diffrent passes.
Pleas check it out

I havnt tested it on any other computer but mine so i can`t garante it works on your computer.

This shader only makes it possible to output the passes, you will need a shader like ctrl_buffer or mentalray standalone to write the files to disk.


great job Raymond !! :bounce::thumbsup:
it works a treat!



anyone willing to write a small ‘how-to’ on using this wrapper with ctrl_buffers ?
i don’t know it yet but great job anyway :wink:


This is the simple workflow for using ctrl_buffer to output passes with the mia_wrapper

Make sure you connect all your mia materials trough a mia_wrapper

  1. create a polyCube (This will be our placeholder)

  2. open the attribute editor and select the cubes transform node (pcube1)

  3. Expand “mental ray” and under mentalray expand “Geometry shader”, check “Enable Geometry Shader”.

  4. hock up a buffer_api to “Geometry_shader”.

  5. Change min.buffer and max.buffer to 20 and 27 inn the buffer_api.

  6. Open attribute editor and select your cameras Shape.

  7. Expand “mental ray”, expand “Output Passes”.

  8. hock up a buffer_write to “Output Shader”

  9. Change filepath inn the buffer_write node to where you want your images to be stored.

  10. Expand user.framebuffers, set min.buffer and max.buffer to 20 and 27

Render :wink:

mia_wrapper curently support this passes.

Diffuse, Specular, Translucence, Reflection, Refraction, Incandescence, AO, Indirect,
Diffuse level, Reflection level, Refraction level, Translucence level

If the buffer is set to 0 in the mia_wrapper it means it disabled. All the level passes is set to 0 by default.

Tonemapping doesn’t effect userframme buffers so the result will be difrent frome the rgba pass if you use som kind of tonemapper.

MR Zap
what is alll the xxxxx.level passes for?
is there a way to tonemappe userframebuffers?


Thats great news Osaires!!
Would be totally helpful for our production … any chance of posting a 64bit version or even the source ?! :slight_smile:
Thanks a lot


hmmm, has the link been removed?


ops, sorry about that Visor66 i was just updating my post

i dont have a 64 bit system so i cant compile it for you, but i i included the source code now so you can compile it.


Thank you Osaires! I will have a look now!


Tonemapping doesn’t effect userframme buffers so the result will be difrent frome the rgba pass if you use som kind of tonemapper.
you mean the tonemapping from the buffer.api ? You can still use those that come with the buffer.write to have all framebuffers tmped, if you have not great hdr ranges. I will add the options to directly tmp all the buffer also via the buffer.api.



Just what I’ve been hoping for :thumbsup:

but still, no shadow pass, the most elusive of them all :sad:
I was looking at this in the mia_material documentation and saw no mention of shadow passes in the example, do you know if it even supports outputting a shadow pass?


max: i havn`t tested the tonemapper in ctrl_buffer yet but its greate news that the tonemappers inn the buffer_write works, it would be even better if the one inn buffer_api works (thats the one i use the most). please lett us know when you get it working :slight_smile:
i was talking about the tonemapper thats part of the architectural.dll

rygoody: no the mia_wrapper doesnt support shadow pass im afraid, you will need somthing like the pmegaTK shader.

I have a working OrenNayar shader that can replace the diffuse component of the mia shader (and a shadow shader).
it will output

color pass
diffuse with shadow
diffuse without shadow
shadow pass
ambient pass

so if we hock that upp with the mia_wrapper we get all the passes we need + all the strange level passes :slight_smile:

I have to test it a bit more befor i post it here, and i don’t have to much time to do that right now so it may be some time befor i post it here.


Osaires, could you please send the project file , too ? Would be very helpful :slight_smile: (a *.sln or *.vcproj file …)
Still couldnt check it out …

would be awesome if Autodesk would finally integrate a working pass rendering into maya


Did you get tran_result to work by any chance? I know it worked with the ‘old’ architectural lib from 3dsmax, didnt work with the one coming with maya 8.5 x64 though.


hi floze, sorry for my late answer
if i remember correct i got tran_result inn the refraction pass, don’t realy remember. i can give it a test later to day maby.

btw. thanks for sharing your compling setup, it works very good :slight_smile:


The batch stuff? Heh, it’s quite basic and far away from being perfect. Works for the poor man’s compiling environment however… :slight_smile:

Maybe the x86 stuff is working, didnt try that too deeply. As for the x64 libs I’m quite sure that it’s bugged, still waiting for news though. :shrug:


Great work Osaires! This is really helpfull for our production. I hope someone can compile a 64 bit version?


So,any chance for us to have a real shadow pass, I mean with mia, not p_Meka because my work flow now is based much in this shader


Yes i’m curently working on a shader that will replace the diffuse component of the mia shader, and that shader will output shadow pass, and a few other passes to.

but i’m not sure when i`l get it done, to much to do right now.

btw. ghostlake114 how is the shader working? is it buggy?


No, it s good but I always feel difficult to deal pass composite without shadow pass (this pass help me alot)


Hey ppl!

Seems like a great wrapper! Any chanse someone could compile this for 64bit win? And maybe as 64bit *nix and OSX…? I havn’t got a clue how to compile a shader but need this badly for atleast XP 64bit.

Thanks a billion for a great work there! =)