Category

Shaders & Texturing

Maya & Arnold – 3 Three-Point Lighting

By Rendering, Shaders & Texturing

In the last chapter we have set up an environment light – which is great for outdoor scenes or quickly illuminating an object. Three-Point Lighting consists of the Key Light, Fill Light, and Back Light. It refers to situations in reality where several light sources illuminate objects – typically by night, indoors or in situations with bouncing lights. By directing position, intensity, color, shadow behavior of your lightsources you can actually “paint” with light by emphasizing aspects of your model to influence the perception in the spectator. Watch Light & Shadow, an Emmy winning film from director Steve Weiss (20 min) if you want to learn more about the subject. The basic concept of Three-Point Lighting in relation to 3D applications is briefly explained in this Tutorial.

In physical based render engines like Arnold the scene measures refer to real world values. I scaled the displaced terrain from the last chapter to a size of 40000 units (=400 m) which allows me to place a building of  about 7 x 7 and 12 meters on top of the hill. The object I want to see illuminated is called Breather Surface and the building a modified  Menn´s Surface, both are parametric objects created with the free (and still working) Cinema 4D plugins from Jürgen Meier. Create your own building, make sure you cut out enough area for windows.

buildingwireframe

The typical approach to Three-Point Lighting is to start with a Key Light. In our case we already have the environment light which we can use as the Back Light. With the IPR window open adjust Elevation and Azimuth in the aiPhysicalSky to bring the sun close to the horizon. With the main object selected RMB > Assign New Material > aiStandard Material, increase specularity – because every object in our physical world has some (more or less) specularity. You can find out more about specularity and energy conservation in this introduction to physical based rendering. Move around your camera to find a nice framing with the sun highlighting the edge of the objects from slightly above or the side. The default camera in Maya comes with a focal length of 35 mm which is fine in most cases. I widened the angle to 28 mm for capturing more from the room and to make the image more dynamic. Don’t worry about the noise, we will fix that later in the Render Settings.

backlightstart

With the small Icons “Resolution Gate” and “Gate Mask” above the viewport you can overlay the aspect ratio of your final rendering. Once you are happy with the framing in the viewport go to > View > Create Camera from View.

createcamera

Lock your new camera by clicking the small lock icon above the viewport. To move around in your scene and to adjust lights switch back to the default working camera at > Panels > Perspective > persp.

switchcamera

Let’s bring in the Key Light, the dominant light source. In the Outliner select the aiSkyDomeLight and hit “H” to hide it for now. Add > Arnold > Lights > Maya Spot Light. Rotate it above and beside to the camera’s viewing axis. For better visibility you can scale the camera and light symbols in the viewport, it does not affect their beavior. Add some color to the Light and increase the intensity to about 100000. The shadow should be softened slightly at > Radius in the Arnold tab of the light.

keylightsolo

To soften and extend the illumination provided by the key light and to make more of the subject visible, add a > Arnold > Lights > Area Light to serve as our Fill Light. I rotated it away from the object, that the light bounces back from the wall to soften it. Increase the intensity to compensate the energy loss, in my case about are fine. Adding subtle color makes the light composition look more interesting.

filllightsolo

When working with the IPR make sure you leave the settings for exposure and gamma at their default values 0 and 1 as well as View Transform at sRGB gamma. These sliders can be temporarily toggled for diagnosis but must always be switched back by clicking on the icon. The illumination of the scene will be controlled with the intensity of the light sources as well as the brightness and specularity of the materials. Exposure settings can later be adjusted with the camera settings.

iprexposure

The setup from above.

lightsetup

Key Light, Fill Light and Back Light together.

threepointlights

Finally I slightly increased the intensity for all lights proportionally and added specularity inside the building. To reduce the noise I changed > Render Settings > Arnold Renderer > Sampling > Camera (AA) to 8. In the report at the bottom of the IPR window you can see how that increased the render time. For fluent working it is recommended to stay with the default sampling rates, you can even reduce the Camera (AA) Sampling to 1. You only need to increase Camera (AA) Sampling for the final output and quality previews.

threepointlightsimproved

Continue with Maya & Arnold Part 4 – Camera / Depth of Field Blur

Maya & Arnold – 2 Skydome Lighting and Background

By Rendering, Shaders & Texturing

Every render engine has its own set of lights and materials therefore it is important to pick lights for rendering with Arnold always from the Arnold menu. Add > Arnold > Lights > Skydome Light.

aiskydomelight

At the Color attribute of the aiSkyDomeLightShape click on the Texture checkerboard icon and in the Create Render Node popup choose the > Arnold > Texture > Environment > aiPhysicalSky. Alternatively you can select the > Maya > 2D Texture > File node and load an external HDR (High Dynamic Range) image. With their higher bit depth (32bit) HDR images are able to capture the lighting information from real world environments which is helpful to illuminate photorealistic scenes. You can downlad free HDR samples from the sibl archive. When you load 32bit HDR images in Maya (.hdr or .exr) make sure to change the Color Space to Raw. Jpeg and everything else should remain at sRGB. Find out more about the new Maya 2017 color management in the Arnold User Guide.

colorspaceraw

I’m interested in a more artificial look and will continue with the aiPhysicalSky.

aiphysicalsky

Once we have a light in the scene it would render without background:

aiskydomelightonly

To add a background go to the Render Settings with the little icon from the shelf. Switch to > Render Using Arnold Renderer. At the tab > Arnold Renderer > Environment click on the Background checkerboard icon and select the aiPhysicalSky.

rendersettings

The aiPhysicalSky node is only available here if you have it created in the previous step with the Skydome Light. If  you have decided to use a HDR image for lighting you can use the same HDR file as background image. Since the background image linked at the Render Settings does not contribute to lighting, you can use any file here (also regular 8 bit jpeg images). The free HDR samples from the sibl archive come mostly with high resolution jpeg images, they should be preferred here.

backgroundcreateskyshader

At the Color attribute of the aiSky node click on the Texture checkerboard icon, in the Create Render Node popup choose the > Maya > 2D Textures > File node and load an external image.

backgroundcreateskyshaderfile

To make the support geometry of the aiSkyDomeLight or aiSky invisible in the viewport you can switch off the LOD Visibility at the Attribute Editor.

aiskydomelightvisibility

Now with the groundplane selected RMB > Assign New Material.

assignnewmaterial

In the popup window select > Arnold > Shader > Surface > aiStandard.

aistandard

In the Attribute Editor change the diffuse color. Click on the IPR (Interactive Render Preview) button. You might notice a black gap between the terrain and the horizon.iprterrain

The Physical Sky model renders everything black below a latidude of 0 degrees. To fix it create another Poly Plane with no subdivision, scale it to a value of 10000000 (=100 km) place it slightly below the terrain to avoid intersections and with RMB > Assign Existing Material (the same terrain material). If you have changed geometry in your scene you need to klick on the IPR refresh icon to update it. Other changes in the scene like navigation or shader modifications are automatically updated.

iprrefresh

In the aiPhysicalSky node you can influence the lighting and color mood by changing Elevation and Azimuth of the sun. More information about the Physical Sky model with example pictures can be found in the Arnold Manual.

aiskysettings

Continue with Maya & Arnold Part 3 –Three-Point Lighting

Maya & Arnold – 1 Setup

By Maya, Rendering, Shaders & Texturing

Arnold will be automatically installed with Maya 2017, by default version MtoA 1.3.0 (Maya to Arnold), but it’s still possible to manually install newer versions of MtoA. The most recent versions can be downloaded here. To activate it in Maya go to > Windows > Settings/Preferences > Plugin Manager and tick both mtoa.mll boxes, refresh, close.

loadplugin

Let’s create a project folder which conveniently bundles textures etc. associated with the Maya scene in one place. Go to > File > Project Window. Click “New”, type in a name in “Current Project” and change the Location. As soon as you hit “Accept” Maya automatically creates a set of folders there.

projectwindow

Now go to > File > Save Scene As … and save the file to the “scenes” directory. A prefix with the date or a consecutive number makes it easier to navigate between iterations of your work later.

saveas

The advantage of the Project folder is, that files associated with the Maya scene are stored in one place. To share projects with different computers you just copy the complete project folder containing texture maps etc. to the new place. If you want to switch the project folder in Maya simply choose > File > Set Project, navigate to the project folder you want to work with and hit “Set”.

Let’s start with a ground and > Create > Polygon Primitives > Plane or use the Polygon Shelf.

polyplane

Arnold calculates the light decay in real world measures therefore it’s recommended to work with somehow realistic measures in your scene. The default size of the Plane is 1×1, Maya’s default units are centimeters, so we need to increase its size. In the next step we will add a terrain structure to the plane and to make the details visible we need to add more subdivisions to the plane. Be careful here, if you crank up the subdivision too high Maya will slow down or freeze.

planesubdiv

One easy technique to create a terrain is to use the sculpt tool. An alternative texture based method will be explained below. Tostart sculpting switch to the Sculpting tab and select the Lift Tool.

sculpting

Adjust the brush size with B + drag or middle mouse button (MMB)-drag left/right. The brush strength can be changed with M + drag or MMB-drag up/down and pull out some hills. In case your groundplane is cut off in the viewport select the camera in > Windows > Outliner and increase the Far Clip Plane value.

farclipplane

Instead of – or in addition to sculpting you can also use the Texture deformer to add roughness to the ground. With a subdivided plane selected go to > Deform > Texture. In the Attribute Editor increase the Strength to 10. Click on the Texture checkerboard icon and in the Create Render Node popup choose a Maya > 2D Texture > Noise node. Fractal, Simplex Noise and Mountain works also or you can choose the file node and link a height map (download here).

texturedeformer

I was after a kind of extraterrestrial landscape and ended up with these noise settings.

noisesettings

You can deform surfaces also with displacement shaders during rendertime with the disadvantage that the distance between displaced surface and other objects cannot be seen in the viewport. It is more memory efficient and useful for rendering surfaces like water.

Continue with Maya & Arnold Part 2 – Skydome Lighting and Background

Maya & Arnold 2017

By Maya, Rendering, Shaders & Texturing

With this multi part tutorial you can learn how to properly set up a Maya project with image based and 3-point lighting, how to create texture shaders, how to work with Cameras and render single different passes (AOVs) for compositing.

dofipr

1 Setting up a Project in Maya
2 Setting Up Skydome Lighting and Background
3 Three Point Lighting
4 Camera / Depth of Field Blur
5 Sequence Rendering
6 AOVs
7 Texture and Normal Mapping
8 Displacement Mapping
9 Creating Ocean Surfaces with the HOT Plugin for Maya and Arnold
10 Texturing with the Substance plugin in Maya and Arnold
11 Rendering with the Volume Shader

Advanced Maya Viewport 2.0 Setup

By 3D Basics, Maya, Shaders & Texturing

In this tutorial you can learn how to set up 3-point lighting, some shading basics, and how to tweak Viewport 2.0 – Maya’s built in realtime renderer. Along the way you will find some useful tips how to set up a project and organize objects in the Outliner.

Viewport 2.0 Tutorial Result

I used the free plant model “Dandelion” from xfrog.com (direct download here), the HDR panorama “05-16_Day_C” from noemotionhdrs.net and a photo-scanned low-poly ground model which you can download here. But any other assets can be used to follow this tutorial.

Set up a new project with > File > Project Window. Click “New”, type in a name in “Current Project” and change the Location if appropriate. As soon as you hit “Accept” Maya automatically creates a set of folders on your drive.

2017_projectwindow

Copy the downloaded files to the newly created sourceimages directory. Back in Maya go to > File > Save Scene As … type a name and save the file to the “scenes” directory. The idea behind the Project folder is, that files associated with the Maya scene like texture maps are stored in one place. If you or someone else want to work with this project on another computer then you just copy the complete project folder containing sourceimages, scenes, etc. to the new place. To switch the project in Maya choose > File > Set Project, navigate to the project folder you want to work with and hit “Set”.

2017_SaveAs

Now > File > Import the Maya file “GC17_3.mb”. The plant should approximately cover the base grid. It consists of 24 lines in x and z direction with a distance of 1 cm (Maya’s default units are centimeters). 24 x 24 cm is a good size for this plant. The scaling can be changed anytime, but for lighting, simulation or when you want to exchange models within a team it is recommended to work with the proper measures right from the start. If you prefer a clean workspace you can go to > Display and uncheck > Grid.

2017_ImportedDefault

The dandelion model already comes with textures and alpha masks. To make them visible select > Shading > Hardware Texturing or switch on the tiny checkerboard icon above the Viewport. You can also use the “6” and “5” key to switch texturing on and off.

2017_HardwareTexturing

When you zoom in to inspect the leaves you can see that the texture is only visible on one side.

2017_hardwaretexturingblack

To find out why you can open > Windows > Outliner and select the geometry, then > Display > Normals to make their direction visible. You can see that without lights in the scene only the outward facing Normals will be shaded (as long as the Ambient Color of the material is black).

2017_hardwaretexturingnormals

Select > Display > Normals again to hide them. Switch on the light bulb icon above the Viewport or select > Lighting > Use All Lights. Since there are no lights in the scene, everything becomes black. You can also use the “7” and “6” key to switch the light mode on and off.

2017_lightson

Let’s start with > Create > Lights > Ambient Light. It evenly illuminates all surfaces without any shadow. Not quite realistic but we will use it later to slightly brighten the shadows. Changing it’s position or rotation does not affect its direction or strength.

2017_AmbientLight

To bring in shadows we need a ground object. Go to > File > Import … and select the downloaded “BeachRocks.obj” from the sourceimages folder. A Material with the scanned texture will be automatically created, just change the Ambient Color to black in the Attribute Editor. Move around the plant on the ground to a nice spot. To center the view select the plant and hit the “F” key, then adjust your viewing angle further.

2017_GroundImport

Let’s start the Three-Point Lighting with a black scene. Select the ambient light in the Outliner and hit the “H” key to hide it for now. Begin with the the Key Light, it represents the dominant light source, such as the sun, a window, or ceiling light. Select > Create > Lights > Directional Light. The Key light should be rotated 15-45 degrees above (seen from side view) and 15-45 degrees beside (seen from top view) to the camera’s viewing axis. Changing the position of a Directional Light has no effect. Switch on the Shadows icon above the Viewport or make a tick at > Lighting > Shadows. The Key Light defines the most visible lighting and shadows in the scene. In the Attribute Editor increase the Intensity accordingly. Also switch on “Use Depth Map Shadows”, maximize the Resolution and change the Filter Size to 20 to improve the shadow quality. You will notice that the shadow does not match the blossom. By default Viewport 2.0 works with OpenGl which does not consider alpha masks in materials. On Windows computers it is possible to use DirectX for even better realtime shading effects, different shader set ups are then required.

2017_directionallight

To soften and extend the illumination provided by the key light and to make more of the subject visible, we add a Fill Light. It can simulate light scattered from the sky (other than the sun), secondary light sources such as table lamps, or reflected and bounced light. If necessary, you may add several of them to a scene. Hide all lights in the Outliner with “H” and > Create > Lights > Spot Light. For better handling use the Scale Tool to make the light cone visible. Scaling does not change the light intensity of Spot- or Directional Lights (only Area Lights are affected). Seen from the top view, the Fill Light should come from a generally opposite angle than the Key Light – to fill it’s shadows. It can be raised to the subject’s height, but should be lower than the Key Light. The intensity of the Fill Light should be less than 50% of the Key Light. Since the Intensity of the Key Light is already 2.5 we can leave it at 1. Tick here also “Use Depth Map Shadows”, maximize the Resolution and change the Filter Size to 20 to improve the shadow quality. Changing the color of the Fill Light makes the scene look a little bit more interesting.

2017_FillLight

To highlight the edge of the objects and to help visually separate them from the background let’s add the Rim Light or Back Light. Place a Spot Light behind your subject, opposite from the camera. Tick here also “Use Depth Map Shadows”, maximize the Resolution and change the Filter Size to 20 to improve the shadow quality. To add some variation I changed the color to a colder tone.

2017_BackLight

Now the Three-Point Lighting set is complete. Switch on Key, Fill and Back Light in the Outliner. Let’s clean up the Outliner in the meantime. Rename the lights according to their function and > Create > Empty Group. MMB drag the Lights into the Null Object, create others for the cameras and the geometry. To hide the Groups in the Outliner you can select > Show > Objects > Sets and > Invert Shown.

2017_outlinerhidesets

Now you can collapse the groups with unused scene elements or hide them from the Viewport with the “H” key.

2017_outlinergroups

To make the material of the plant appear a little bit more lightweight, just increase the Translucence value in all plant shaders slightly.

2017_translucence

The shadows in some parts are quite dark – unlike in reality where almost always diffuse light is around. By using the Ambient Light with a very low intensity we can fake that effect here.

2017_ambientadjust

The ground texture looks a bit overexposed compared to the plant, so let’s adjust that. Select the object and in the Attribute Editor click on the Input icon next to the Color slider.

2017_croundcolorlink

You will be directed to the Texture attributes where you can decrease the Exposure.

2017_groundexposure

For the sky background create a sphere with a radius of 250 cm. It should enclose the ground but be not bigger, otherwise the quality of the shadows might become too poor (the anti aliasing of the lights is calculated relative to the dimension of the whole scene). With the sphere selected RMB > Assign New Material >Maya > Surface > Lambert.

2017_assignlambert

Click on the checkerboard icon next to the Color slider.

2017_assignbgtexture

The “Create Render Node” Windows pops up. Select > 2D Textures > File.

2017_assignbgtexturefile

In the Attribute Editor click on the folder icon and select the downloaded HDR image in the sourceimages folder (the low-res version is fine). Since the sky panorama is in HDR format (High Dynamic Range) the Color Space needs to be changed to RAW (without color correction). Reduce the Exposure to -1 for now, you can fine tune it later.

2017_bgexposureraw

The Normals of the Sphere are pointing outwards by default, but we need them inwards here. To flip the direction  select > Mesh Display > Reverse. In the Shape tab of the Attribute Editor switch off “Casts Shadows” and “Receive Shadows”.

2017_bgshadowoff

To prevent the lights affecting the intensity of the background go to the material settings in the Attribute Manager and maximize the Ambient Color and disable Diffuse. Then the material becomes a kind of self-illuminating. You can quickly test the effect by selecting the Light group in the Outliner. When you hit the “H” key to hide all lights in the scene, everything becomes black – except the Background Sphere.

2017_bgdiffuseambient

Now let’s tweak the Hardware Render Settings. In the Viewport go to > Renderer > Viewport 2.0  > Options, enable Screen-space Ambient Occlusion and maximize Samples, Radius and Filter. Ambient Occlusion adds a shadow effect at overlapping or angular surface areas. It does not work well with the alpha mask of the dandelion here, so we need to reduce the Amount to 0.3. In other scenes higher values should work fine. To add some more finesse adjust the Hardware Fog settings and activate the atmospheric effect in the Viewport at > Shading > Hardware Fog.

2017_hwrenderersettings

In the last step let’s add Depth of Field blur to the scene. Make sure that your custom camera is the active camera. In the Viewport select > Panels > Perspective > (Camera Name). In the Shape tab of your custom camera make a tick at Depth of Field and change the Focus Distance according to the distance from the camera to the focus object. Activate >Shading > Depth of Field or the small icon above the Viewport.

2017_dofsettings

lighteffectslayers