I guessed that you plug a material into the ‘render buffer’ slot just so you can see it in the render view window, but it doesn’t get saved out? At least it didn’t for me. Or is that what the ‘skip renderregion’ control does?

Jozvex the renderbuffer or primary buffer is the standard rgba output… and it is controlled by the first tab in your renderglobals. instead the skip renderregion just allows you to skip the buffer writing while you’re not rendering a full frame (remember also to disable the buffers into the buffer_store… or mr will takes more time also to render them out while they’re not writed out in the final)

Did you write a zdepth shader,or is that just for reference?

if you enable the depth buffer in your camera->mentalray settings, you’ll get an automatic depth pass with no additional render time… the buffer_write will recognize this and will output the file… also supported are the motion and normal buffers. however take care that these buildin buffers will not interpolate the output so you’ll get jagged edges on the silhouette. you should use your custom shader and the buffer_store to get interpolated results (about this… do not enable manually the userframebuffer under the renderglobals(maya65)… you’ll get uninterpolated results… instead just play with the buffer.range to get enabled your buffers in the right way… it tooks me more time to hack this than actually write both the shaders…)… I will add some more explicit ctrls in the future.

would be nice that the names get the framepadding from the renderglobals?!
I also thought about this… along with a way to take the name directly from the buffer_store. :slight_smile:



Is it possible to get ths shader to output all shadows in a separate pass?
Or maybe fb’s don’t work that way?


You must understand that framebuffers are just used to output multiples images from a single render. Framebuffers are not a “pass system”, except if you layer your shaders (diffuse, spec, refl, … in separate shaders, mixed with a mixlayer ie) and then output these shaders to differents framebuffers. So you can output a shadow pass if you make a shadow shader :slight_smile:

PS: Zdepth and others specials things (available in the main framebuffer in maya render globals) are used by mr by default and can be outputed directly


Ok, I thought it worked like that, but one cannot know without asking :slight_smile:
Thanks for your reply.


I got some pms asking for explanations… what can I add in that direction is just that each
buffer when enabled (buffer.range) from the buffer_write is really empty and waiting for
the buffer_store to write to it while rendering… this means that you can actually use n
buffer_store to write all to the same buffers… if you decide that ie the channel1 will be
specular… you can attach to each mat you’ll need on that channel a buffer_store with a
specular shader plugged to the buffer1… mr will collect that infos and write them to a
separate image. but you could use also your buffers to make some sorts of alphas or objs
matting… just plug the full material to a ‘reserved’ buffer and not to the render.buffer…
the rendered image will show black while your obj will be on a separate img… or in the
same manner you could just collect a group of obj to get their own pass. the same thing
happens for example also for lights… you only need a shader that can link from the
hypershade the lights it needs… if you plain to output separate imgs for each light
contribution to be composed later you’ll need just a buffer_store and n. identical shaders
each one with its own light attached… here a minimal light study.

the occlusion pass is the standard render output… really no lights are directly worked out
in the main buffer. here each light has it own channel… evry mat in the scene will have
the same construction of the above hypershade… each mib_phong points to one of the
four lights… plugged into the respective buffer.


look great… i’ll test it tomorow and post my feed back…
realy great work.


got it !! :scream:
I was not really happy with the limitation of 7 buffers (8 actually but the first is reserved)
… well, I removed that. I acces directly the options block through mentalray api using
a geometry shader. fu*k you alias ! we have now unlimited buffers for real productions
(I have limited them to 16 for now). forget about that crap framebuffer options in the
renderglobals… create a dummy object that will not be rendered and simply attach the
buffer_api to its mentalray->geometry.shader, set there your buffer number and also the
output type… like interpolated.rgba(+rgba) and so on… you can still ctrl your revamped
options block while mentalray starts (mentalray RC)…


the other things remain the same.
here the final output with the verbose from ctrl.buffers.

EDITED:: buffer_api removed. it brings instability to maya.




must…first…finish…the…shader…I…wanna…include…a…multilayer.openexr…support… :slight_smile:


Hehe, great work again!





it is a pleasure to work with this shaders.
I consider this way better than using passes and override mechanisms.
unilimited buffers… super !!



That’s great !!
Btw, it’s crazy but I’d say that I went even and met fransceca in my dreams yesterday… and she doesnt look like a girl with a cat on her chest.


Well done man, It’s just perfect.

I just have a bit of wonder :

Is there a way to render a scene and seperate the shadows ?

What i mean is I want to have my color pass alone and my shadow pass alone, I went through and honestly couldn’t make it, It always gives me the shadow in color pass as well as the shadow pass.

I would be so thankfull to have an example scene like that .

Once again great stuff man.


Especially since mr 3.4 do not keep extra buffers in RAM (unless you ask it to), making renders of huge dimensions w. huge buffer count not limited by RAM size.

Spiffy, innit :wink:



First of all my compliments on this shader, too. Just great and even greater that you work so fast on the feedback, too.

I too wish for a shadow shader similar to the one available in XSI. If I remember correctly it’s an illumination shader that plug’s into the surface port of the material. It shouldn’t be that hard doing, but who will? :love:


I just digged into the XSI shaders a bit, and i managed to write an .mi file to load the shader in maya from the sibase.dll. As this is my first time doing such a thing i might still need some help with the light list AEtemplate. I’ll share it with all of you to use the sib_shadow_material.mi :wink:



I´m getting a diffrence in the way the images are sampled.Anybody else getting this:( Great shader, thanx for sharing:)


what about mac version?


senza parole…


Ok, i’m posting the sib_shadow_material.mi here because it could still use a little help from the community.

With this .mi file and the sibase.dll which comes with XSI you can load the shadow material shader from XSI inside Maya. Which means any object you assing this to just renders the shadow it’s receiving :bounce:

Things to look out for:

  • the shadow is rendered to the alpha channel if you don’t check ‘rgb’
  • for the alpha channel to appear check the ‘pass custom alpha’ in the renderoptions > custom entries
  • the shader should be plugged into the MR material shader i the shading group or else it’s slow

I hope someone would write a nice light selector AEtemplate like with all pixero shaders.

That’s it so far, enjoy! For all that have access to the sibase.dll (and don’t ask me for it!)

Great almost forgot the link: http://www.twentythree.de/andy23/sib_shadow_material.mi