Max 2008: Physical Camera with DOF and motion blur

So, does anyone want a Physical Camera for mental ray in 3ds Max 2008? Read on...

The Photographic Exposure Control (mia_exposure_photographic) gives you values in f-stops and shutter speeds like in a real camera. However, it only applies to the exposure of the image (i.e. the brightness, basically).

In a real camera, the above mentioned parameters affect the depth of field and the motion blur of the camera.

This isn't supported out-of-the-box - the exposure control really only deals with the exposure.

A second thing is that the exposure knobs being "camera oriented", but they are not ON the actual Camera object. Whereas it would make more sense if these parameters "lived" in the UI of the Camera.

To try to solve these issues, I wrote a little "proof of concept" script to test out what such a UI would perhaps look like. It's very clumsy in many ways and an ugly hack, because it's just a "scriptable plugin", and scriptable plugins has a ton of limitations in max.

First of all, a scriptable plugin can only extend an existing object, not make a "new" one. Secondly, scriptable camera can only extend the "free" camera due to technical limitations of MaxScript (well, the MaxScript docs tell me so anyway), but most people "want" to use a "Target" camera.

Due to this limitation, the camera always gets created in "Free" mode, but after it has been created, you can switch it to "Target" mode. Ugly, but... livable.

How to use this plugin hack

1. Download this plugin and save into the "plugins" directory under your 3ds Max main directory.

2. Now, either restart max, or just load the plugin manually as well from the MaxScript menu.

3. Now, under your "cameras" you have a new "mr Camera" item.

4. Insert it - unfortunately always comes in as a "Free Camera". The UI at this point will look like the old camera.

5. Go to the "Modify" tab to see the "new" UI.

6. Play, rejoice, etc.

Remember, this is an ugly unsupported quick hack. The "mr Camera" simply "feeds" other existing plugins with value (mr Photographic Exposure, mental ray Depth of Field, motion blur, etc.) and doesn't really "do" anything by itself.

And it probably has more bugs than you can shake a stick at... but is provided here "for fun".




Andres del Castillo said...

Thanks fot this script.

Mihir said...

thanks alot........bhagaban

Travis said...

Has more thought been given to this? The camera could really use a white balance.

Perhaps this, or something along these lines will be included with the next release of Mental Ray?

Jeremy said...

nice work, your making it much easier for my stumbling form vray to mental ray

master-pipe said...

Absolutely unique and fine piece of information.
pvc pakistan I've never spent that much time reading before but this is really awesome..