PDA

View Full Version : Enable stereo rendering in mr 3.8



haggi
February 19th, 2011, 00:59
I wrote a very simple geometry shader which enables stereo rendering in mr 3.8. In maya2011 you dont have access to this option, so I tried to enable it, and - it seems to work.

Here is the link:

http://joomla.renderwiki.com/joomla/index.php?option=com_content&view=article&id=343&Itemid=239

Remydrh
February 21st, 2011, 01:25
Hey Haggi,

Thanks for the shader! But mine doesn't seem to export correctly. I assigned it to a cube like I would any usual geo shader and enabled it.

I don't get a stereo render and my export doesn't have it in the camera block.

Did I goof something?

Win 7 64, Maya 2011 SP1 64

Thanks!

haggi
February 21st, 2011, 10:43
Hmmm. Strange. I did exactly the same with the same system and I got the renderings.

If you export the scene, there is no modification in the camera block because it is a geometry shader which will be executed during rendering only, not during export.

Can you tell me whats in your output window? There should appear something like:

"Executing stereo settings for camera: ..."

haggi
February 21st, 2011, 17:11
BTW: the default of 6.5 of eye distance is quite large, in a real scene I had to set it to .0065 to get a good result.

Remydrh
February 21st, 2011, 18:57
I'll see what I can get you.

Yeah, the default "30%" of focal length refers to what is exported. If you export the camera it will have something like: 1.534 something something

Multiply that by .3 and you have a good place to start. I usually go a tad higher than that to push it some. But not too much or it "shrinks" the perceived scale.

Remydrh
February 22nd, 2011, 10:16
Figured it out, had it in the wrong folder, Maya saw it but Standalone did not.

Works fine even on a large motion blurred file. :-)

haggi
February 22nd, 2011, 10:57
Unfortunatly it seems not to work properly in XSI and 3dsmax. Only maya uses it as described in the manual.

haggi
February 22nd, 2011, 12:09
Okay, I think its no worth more investigation because in a real production scene, lot of geometry, lots of textrues, the speed gain was about 4%, thats not much.

Remydrh
February 22nd, 2011, 12:45
Mmmaybe. Maybe not. In some test scenes I've run at Luma, the gain is anywhere from 10-15% if the frames are substantially large and the scene is heavy.

It kills the translation time of the heavy scene on top of cutting rendertime as well.

If you abandon it, want to open source the shader? :D

haggi
February 22nd, 2011, 13:06
If you abandon it, want to open source the shader? :D

Of course, I'll post it these days :)

RGhost77
February 24th, 2011, 08:32
In my tests I can't achieve true stereo rendering effect. In all modes (toein,offaxis) mr sa 3.8 render two images with same perspective. It seems like one camera just moved by x axis on eyedistance value. If place two outputted images on each other the objects edges will be same.
Maybe I'm doing something wrong? Can someone share simple scene (.mi) with proper stereo effect?

haggi
February 24th, 2011, 19:07
I updated the package with the source code. You can download it from the link in the first post.

Remydrh
February 24th, 2011, 22:15
Excellent! Thanks!

AndrewHazelden
March 3rd, 2011, 12:42
Hi. I compiled a Maya 2011 Mac OS X 64-bit version of the settingsShader. Included with the download is a sample Maya scene you can experiment with. I also created Hypershade icons for the shader.

You can download the mental ray settingsShader for Mac OS X 64-bit here (http://www.andrewhazelden.com/files/2011/March/stereo_camera_settingsShader_for_Mac_OS_X-64-bit.zip).

Here is my blog post about the shader (http://www.andrewhazelden.com/blog/2011/03/mental-ray-stereo-camera-rendering-settingsshader-for-mac-os-x-64-bit/).


http://www.andrewhazelden.com/blog/wp-content/uploads/2011/03/dino_stereo_test-560x315.jpg (http://www.andrewhazelden.com/blog/wp-content/uploads/2011/03/dino_stereo_test.jpg)
http://www.andrewhazelden.com/blog/wp-content/uploads/2011/03/stereo-settingsShader-icon-560x290.png
http://www.andrewhazelden.com/blog/wp-content/uploads/2011/03/stereo-settingsShader-Maya-ui-560x315.png (http://www.andrewhazelden.com/blog/wp-content/uploads/2011/03/stereo-settingsShader-Maya-ui.png)

AndrewHazelden
March 4th, 2011, 10:42
SettingsShader Performance Comparisons

The benchmarks were completed using the wooden dinosaur model on grass sample scene included with my build of the Mac OS X version of the settingsShader. Rendered on a Mac Pro 3,1 with 8 cores @ 3.2 GHz each. Final Gather rebuild was turned to off and a new primary Final Gather map was used for each render.


Render a single camera view in mental ray for Maya 2011:
RC 0.2 info : wallclock 0:43:34.09 for rendering


Render two cameras using mental ray with Maya 2011′s built-in stereo camera rig feature:
mayaRender.log:1179: RC 0.2 info : wallclock 0:44:11.08 for rendering
mayaRender.log:2273: RC 0.2 info : wallclock 0:20:35.92 for rendering
Total time for left and right cameras = 1:04:47.0 (3887 seconds)


Render two cameras using mental ray for Maya 2011 and Haggi’s settingsShader:
RC 0.2 info : wallclock 0:58:13.87 for rendering
(3493.87 seconds)

Summary:
Using the settingsShader rendered 11% faster than using Maya’s built in Stereo Camera feature.