Showing posts with label camera. Show all posts
Showing posts with label camera. Show all posts

Wednesday, May 2, 2012

Do not scale the camera!


There are cases where you shouldn't scale the camera, otherwise you will get artifacts or poor performance.

Case 1:  When you use a mia_env_blur node  to provide with a blurry reflection to a mia material.


This is a highly reflective metal material. I use the mia_envBlur to apply the blurry reflection like the following.

  
And then I scale up the camera by 5 times.


You'll get this pinching point like artifact.
This time, I will scale the camera down by 5 times ( 0.2 ).


Another weird artifact.
So, don't scale up or down your camera when you use mia_envBlur for blurry reflections.
It doesn't matter how much. As soon as you begin changing the scale it will go bad.



Case2:  When you use Optimize for Animations FG mode with View option on.



This time, I use the FG to create this.


I use Optimize for Animation mode with View option on. It gives me a fairly even FG point distribution like below.


So far, so good. But if I scale up the camera, let's say by 10 times.
The FG brightness diminishes by around that much like below.



This has to do with the fact that the View mode uses the camera space to deal with FG points and density. You can compensate the brightness by scaling up the Min/Max pixel value by the same scaling factor that's applied to the camera.

That being said, I'd rather not use a scaled camera.
 

Tuesday, May 1, 2012

lat-long style Environment map creation



 
Rendered using Vue xStream

E-on software's Vue is one good solution for the realistic natural environment creation. I do like the atmosphere and the sky it generates.

If you render the environment in Vue in lat-long style and use it for IBL in Maya, it can be a very efficient environment setup.  Vue provides with an option to export the sky in lat-long style but takes very long time to render since it only utilizes a single cpu thread for this particular task.

So, what I usually do is to create the sky in Maya using the xStream plug-in and render within Maya.
If a panoramic lens shader like latlong_lens shader is available, it will make your life a bit easier. But, if not, you can still render 6 images in cubemap style and transform them into a lat-long format.



Here's the result of the lat-long lens shader. It can directly create spherical type (lat-long) panoramic image from one single camera.


The only problem it has is this shader is not always available, especially for a newly released Maya.
If that is the case, you need to turn to the traditional cubemap method which requires 6 images-top, bottom, front, back, left and right.



You can use one camera and rotate it like above image or can use 6 cameras.
I prefer the latter. 



Here's my camera rig. Note that the naming convention has to be like that.



Each camera must cover exact 90 degrees of field of view in square frame.

Here's the render settings.

 Don't forget to set the framebuffer to 32bit float.


Now, batch render it.







I will stitch these 6 images into one cross-type cubic environment map.
To do this, I use an application called "cube2cross.exe". This takes 6 hdr format images to generate one big cross type hdr map.


I load this in HDRshop.


Using the settings above, I transform the cross type map into lat-long type env map.


This transformed result is basically identical to the one that's rendered through the lat-long lens shader.
Both methods take advantage of using full cpu threads.


The hdr image is now loaded in Maya's IBL. Now it takes virtually no time to render the environment.