Wednesday, February 29, 2012

Render Optimization in Vue

I have been unable to find many good (free) Vue tutorials so I decided to make several of my own.
Made using Vue 9XStream but should apply to most versions.




When creating in Vue, do NOT use a preset atmosphere (unless of course it is one you yourself made).  A lot of the presets come with a lot of extra baggage that may not even benefit your scene. 

Make your scene first and THEN create your very own atmosphere using the options available when you hit F4 (Check out my tutorial on Realistic Atmospheres in Vue for more information on this).

When making your scene it is important to know the difference in the types of available terrain meshes.
Standard Terrain: A simpler mesh that renders very quickly.  If covering it with an ecosystem it can be suitable for closeups, otherwise keep this one in the background.
Procedural Terrain: Tons of detail.  Tons of polygons.  Use only as hero scenery, not filler.

When setting up your atmosphere keep this in mind:
The top three lighting models in the Atmosphere Editor render pretty quickly.
The bottom two models take a lot longer.

I use Global Illumination for most outdoor scenes, despite it taking a bit longer.
ONLY use Global Radiosity if you specifically have tons of reflectivity, bouncing both color and light around your scene.  Otherwise, do not use this option.

Regardless of what lighting model you choose, take the Quality Boost slider in the Light tab down to at least -1.  You can lower this to about -1.5 in most cases before seeing any visible drop in quality.

The Sky, Fog, and Haze tab has it's own Quality Boost slider.  This one's effects are a bit more visible so be sure to play with it.  At times I have had it as low as -1.6!!  Almost every slider in this tab will boost render time, so keep this in mind when creating your atmospheres.


Select your Sun layer.
Make sure Lens Flare is off. 
It really jacks up the render time and can honestly be done better in post.
Reduce Shadows to 80% max, this will lower the render time as well as better emulate reality. 
Not many real-life shadows are 100% opaque anyways!


To open the Render Options use Ctrl+F9.
The Vue presets assume you are either using a renderfarm or have a studio level of processing at your disposal, I would advise not using the preset options.

To combat the enormous render times Vue is famous for, check the User Settings options under the Preset Render Quality segment.

The first thing we want to look at are the Anti-Aliasing Options. 
In the Anti-aliasing section click the Edit button.

Make sure Object anti-aliasing is Optimized.
In the Subrays per pixel section, start the Min at 4 and the Max at 6.
Start the Object anti-aliasing Quality threshold at 30%.

Turn on Texture Anti-aliasing.
Start with a Min of 4 and a Max of 10.
Try to keep the Texture Anti-aliasing Quality Threshold under 46%

Now hit the OK button and go back to the Render Options window.

Things to double check.
In the middle section under the Render Quality area.
If you do not need much reflection or transparency in your scene then turn off:
Trace Reflections
Trace Transparency
Blurred Reflections
Blurred Transparency

Never, ever click the Depth of Field button.  It is much faster to just render out the depth channel and do this in Nuke.  Make sure to check that the Optimize last render pass option and the Optimize Volumetric Lights options are checked.  This will save you literally hours of render time.

If the plants in your scene are far away or you do not have any plants, check the Ignore Indirect Lighting on Plants box.

The Advanced Effects Quality slider should be at 46% maximum, I usually render at about 40%.

Make sure Tile Rendering is NOT selected.  This process requires a vast amount of memory to complete and may crash the computer.  Once again, Vue is not very friendly desktop software, it was built for powerhouse machines at major studios or renderfarms to handle...some of these options are just not feasible on a single machine.

When setting your Picture Size and Resolution, keep in mind, the bigger the image/larger the DPI, the longer it is going to take.

If you can render at a lower resolution for the project at hand, do it...you will be glad you did.

Realistic Atmospheres in Vue

I have been unable to find many good (free) Vue tutorials so I decided to make several of my own.
Made using Vue 9XStream but should apply to most versions.


Call up the Atmoshpere Editor by pressing F4
            Under the Light tab there are several different types of atmospheres.
                        Spectral Atmosphere – The most physically realistic atmosphere type in Vue.                                                                                    Everything is mathematically calculated to emulate how light                                                                      and the atmosphere interact on planet Earth.
                        Global Ambiance – Darks become grey/lighter shadows.  Lower contrast.
                        Global Illumination – Dark Shadows.  Scatters only shadow not reflected color. 
                                                              High contrast
                        Global Radiosity – Scatters shadow and reflected color/light.  More detail in shadows.

Global Radiosity is extremely render intensive and should only be used in situations where the reflected light will be featured (example: interior of a flooded cave).  Use Global Illumination for most outdoor shots in order to save on render time (check out my Vue Render Optimization tutorial for more information).  However, should push come to shove, when using Global Radiosity:
1)      If using it indoors, a Gain of 0.5 - 0.75 should be enough to illuminate while still preserving shadows.  The higher the number, the more light is reflected.
2)      In order to preserve reflected and indirect light color turn on Indirect Skylighting.
3)      Changing the Bias will change the color of all reflected light.


In the Sky, Fog, and Haze tab.
In this tab it is important to remember, the higher the number on the slider, the higher the render time.
            Decay – More = More Orange in the Sky

            Decay Altitude – Anything below 10km is physically realistic

            Haze Altitude – 800m to 1.2km is physically realistic

            Scattering Anisotropy – Negative 1 pulls sun glow close to the camera. 
                                                      Positive 1 glow pushes the glow all the way to the sun. 
                                                      An accurate distance is between 0.45 and 0.65

            Cloud Anisotrapy – Controls the highlights on cloud bulges.
                                                -1 = Light behind cloud that will not travel through it
                                                1 = Sun punches straight through cloud

            Aerial Perspective – 1 = Atmosphere is scaled according to real world distances
                                                One way to make your scene look bigger than it is, is to pump this number a little higher.


In the Cloud Layers tab.
Warning: Clouds are puffs of gas and water, only n00bs make them solid objects.  Don't be a n00b.
            Scale: Changes the size of the fractal that the clouds are generated from. 
                        If your renders look speckled then raise this slider.

            Altitude: When the clouds start to form on the horizon.

            Height: How thick the layer of clouds is, this slider controls where the layer ends.

            Cover: Minor changes are better, controls cloud cover.
                        0% = no clouds in sky
                        100% = no sky visible through clouds

            Density: How thick and dense the clouds appear to be.
                        60% - 80% = Thick and Strong clouds
                        10% - 40% = High Altitude clouds
                        0.1% - 1% = Thin and Wispy
                        100% = There is no excuse for ever having your clouds this dense.

            Opacity: How much light penetrated your cloud layer as a whole.
                        Try and keep this setting the opposite of your Density setting.
                        80% - 100% = Thick and darker clouds, but not dense.
                        20% - 50% = Lots of light in clouds

            Sharpness: This controls the edges of your clouds.  Keep this as low as possible.

            Feathering: Controls the cloud wisps.  0 – 25 is recommended.

            Detail: Breaks the edges of your clouds into smaller clouds. 
                        Anything under 10% is not realistic.

            Altitude Variation: Random altitude jitter.  30% - 70% is realistic.

            Ambient Lighting: Lightens cloud layer as a whole, this can destroy a lot of contrast so use                                                      Opacity first and this one as a last resort.

            Shadow Density: How dark the shadows on the ground cast by the clouds are. 
                                          Keep this low if your Density or Opacity are particularly high.
                                          This setting greatly affects the visibility of Godrays
                                          (a setting you should only use if you enjoy ridiculous render times).

Double click on the picture of your cloud in the Cloud Layer tab to open up the Cloud Materials Editor (any changes here will affect the entire layer as a unit).
            Color and Density:
                        Scaling: If there are too many unnecessary details or small clouds in your scene be sure to pump this up!

                        Variations: Random cloud formation jitter function.
                       
                        Roughness: Too low = Smooth ice cream bulge clouds
                                             Too high = tons of tiny clouds instead of an edge

                        Uniformity:  Low value makes bottom of cloud layer as rough as the top.
                                                High value makes lower portions of cloud layer smoother.

Monday, February 27, 2012

Render Layers in Maya

Diffuse
Include your textured object, use only surface shaders as this layer will capture only texture information not light.

Specular
Use a black blinn with the proper settings on your object.  Include lights in this layer.

Shadow
Include the ground plane, your object, and lights that cast shadows.
Shade your objects and the ground plane white with no reflections or specularity.

Reflection
No lights in this layer.
You will use your cropped chrome sphere photo for this step.
In Maya make a sphere that is larger than your entire scene.
Assign a surface shader to this environment sphere.
In the surface shader attribute pane, change color to your chrome sphere file as a projection.
In projection settings change projection type to Ball.
In the material attributes change hardware texturing to out color.
Keep resolution at highest.

You will need to make another shader for your object.
Make a blinn and color it white.
Diffuse = 0
Eccentricity = 0
Spec rolloff = 1
Spec Color = White
Intensity = 1

Remember to turn off your reflection dome's visibility.


Match to Live Setup in Maya and Nuke

Match to Live Setup

The ability to match a CG object into live footage speaks volumes in regard to your ability to model, texture, and composite, as well as your attention to detail as a digital artist.

For the sake of simplicity we'll use a still frame.
When shooting footage or a still it can be very helpful to include simple objects that will save tons of time in post.

Here is the plate I shot with my *crappy* Canon PowerShot A410

Be careful not to edit or crop your photo as that will rob your image of recorded camera information and may cause strange distortions in the image's perspective.  

Shooting a version with a simple primitive cube will help you line up perspective in Maya

Shooting a chrome sphere will make reflections a snap
In order to effectively use the chrome ball data, you will have to crop it like so:




1) Use your plate with the cube in it as an Image Plane for your main camera.

2) Create a Cube in Maya and use it along with the grid in your Camera's view to match perspective from the plate to your scene.  Once you have it perfect, lock your Camera.
 
 
3) Create and texture your model.


4) Render out all of your passes (example: specular highlights, diffuse color, reflections...etc) and bring them into Nuke.

You'll be doing something like this...stay tuned!

Sunday, February 26, 2012

Lighting in Maya: Final Gather

Final Gather

A cool trick you can do whilst using Final Gather is the ability to emit light from geometry.
I typically light in this fashion using a Poly Plane, but you can pretty much use anything.

1) Make a Plane, right click on it and Assign Blinn.

2) On said Blinn, set the Incandescence to 1.

3) Make sure you are using Mental Ray, and turn on Final Gather in the Indirect Light portion of the Render Settings.

4) On your Render Options make sure you turn off Enable Default Lighting.

5) Still in Render Settings: Primary Diffuse Scale amplifies light while Global multiplies ALL values on ALL light...so be careful with that.

6) In order to have any kind of specular highlights when lighting with Final Gather, an object must be reflective.

7) To fix sharp reflections, use the Mental Ray Shader MiReflection Blur to soften the reflected images.

8) Take your Accuracy in the Render Stats to abut 4,000.

9) Secondary Diffuse Scale...the higher it is the more color bleed you can achieve!

This Final Gather image took roughly 45 min to render.

Lighting in Maya: Photons

Photon Lighting

Alright folks, now things get tricky.
Photons are a mathematically correct way of lighting as the computer will calculate each and every photon of light being emitted, granted, this can take a lot of power and setup to get working properly.
The benefit is that Photons show color in reflected and bounce light very well.

1) Create an enclosed scene to best show off the bouncing photons.

2) Make a Point Light near the ceiling and turn the Intensity to 0.  We are going to light this scene using the data of the photons the light emits rather than the light itself.  This will produce a much more calculated result.

3) Make sure the Emit Photons option is on in the Point Light Attributes, increase Photon Intensity.
        Higher exponant = quick falloff...never go over 5 if you can help it

4) Be sure you are using Mental Ray to render with and in the Render Settings, turn on Global Illumination.

5) Your first render might look like a terrible disco party, attempt to adjust this by bumping your Global Illumination Photons to above 1 million.

6) In the Render Settings, the Accuracy should usually be above 4,000.

7) Be sure Default Lights are turned off (those are what lights the scene if you do a quick render before adding actual Spotlights etc).

8) The image may be a bit spotty, reduce the spots by adjusting the Radius (Render Settings), start at a value of 1.

To show how well Photons bounce color in reflected light, I used bright colors on the walls.
This Photon lit scene took 7 min and 17 seconds to render.

Lighting in Maya: Depth Map Shadows

Depth Map Shadows

1) Set up your scene and light with Spotlights only if possible

2) On your Spotlight's Attributes, the default is (I'm pretty sure) to already have Depth Map Shadows selected.  The first thing you want to do is to turn Auto-Focus off.

3) Change the dropdown menu from Disk Based Dmaps to Overwrite and paste your desire file path into the maps file name.

4) Using Fcheck to view your new depth map (after doing a quick render), zoom in and out of the shown image (or alpha) by adjusting the Focus on your Depth Map Attributes of your Spotlight...you want to frame your entire scene.

5) Once your focus is set, turn Disk Based Depth Maps off.

6) The setting Filter will aid you in blurring the edge of your shadows.

This image using Depth Map shadows took 2 min and 18 seconds to render.

Lighting in Maya: Render Layers

Render Layers 101

When rendering in Maya, it is unwise to give up control of the image by rendering a single pass.
Using compositing software such as Nuke or Shake (may it rest in peace) it is possible to combine many layers that control specific aspects of the image (such as specular highlights or occlusion) whilst still retaining full control of the image.



1) Go to your Channel Box/Layer Editor.

2) Create a new empty Render Layer (whatever you do, don't use the ridiculous "smart select" Layer creator thing...it has SO many bugs that will mess up your day).

3) Double click on the name of the Layer to rename it.

4) Using your Outliner, select the objects you wish to have in this new Render Layer.

5) Right click on your Layer and Add Selected Objects.

Layer Protip: When working within a Render Layer that is not the Main Render Layer you must be very careful.  ANY changes you make will affect ALL layers.  In order to make changes that will only show up within your chosen layer (for example changing the color of a Spotlight or adjust a render setting), right click any attribute and select Create Layer Override.  The attribute title should now be orange and the change will only exist within the layer you are now working from.

Don't use the button with the plane, the yellow star, and the blue ball.
Seriously.  Use the button without the blue ball.



Lighting in Maya: Raytraced Shadows

Raytraced Shadows

The first thing you should know about Raytracing in Maya is that it activates reflections, so be sure all reflections are reacting in the way you desire before proceeding.

Lighting Pro-Tip: Most of the time, all you will need to light are Spotlights.  A Point Light is equal to SIX Spotlights and an Area Light is made of a bunch of Point Lights...wasteful.  Only use these if you don't mind unnecessary render times.

1) Set up your scene.

2) On your Spotlight's Attributes, turn on Raytrace Shadow.

3) In your Render Settings, turn on Raytracing (start off using Maya Software as your renderer).

4) Pump the Anti-aliasing up
        Shading: 2
        Max: 4

5) On the Spotlight Attributes, Raytracing section
        Light Radius: blurs the shadow
        Shadow Rays: cleans up the blur
        Ray Depth:  how many times the ray will bounce, ups the amount of indirect lighting

6) Back on your Render Settings
        Raytrace Quality
                Reflections: this should match Max Ray Depth on all light Attribute settings
                Bias: fixes possible zig-zag artifacts by raising or lowering the shadow away from the subject
                        0.3 is a good setting to start with as putting this very high will produce even worse results


This image took 35 min and 55 seconds to render.