Maya Technical Paper: How To Set Up and Optimise Alpha Planes When Using Mental Ray Tutorial Key
Maya Technical Paper: How To Set Up and Optimise Alpha Planes When Using Mental Ray Tutorial Key
i information m main This tutorial is created assuming the reader is relatively new /or is a little familiar with Maya already.
Tutorial overview
Using 2d textures can be a great way to speed up rendering time, though Maya has a very old bug with lambert shaders that do not do well mapped transparency (especially if it reaches the target total). When you create a new primitive in Maya, the assigned shader will be a lambert (unless otherwise configured in your preferences). A problem you might face during your creative pipeline when using alpha planes on lambert materials, is visual errors in rendering. These are common problems that may crop up in your workflow when you apply a colour and transparency alpha node to a shaders attributes. A solution is to use another shader, try a "surfaceShader". Maya notices that this type of shader is designed to alleviate connected render nodes (2D, 3D, materials, etc) and provides a more tuned confirugation for your lighting and rendering information.
When the plane is created, head over to the channel box tab (on creation, this tab should show up automatically. (If you would like to activate this tab at any time, this button is located to the far-right on the status line). Adjust the values of scale X, Y, & Z to 24 (the plane will grow to the size of the grid, which is by default 24 units big in the X and Z axis).
Fig 1.
Change the name of the plane to Tree_Plane_GEO. Either click once on name field to begin with renaming of primitive (change the prefix, Tree, to the name that resembles the content of your texture file), or go to main window and click on the button Window > Outliner. In times when your scene is populated by many items, you may want to start using the outliner. This is catalogue showing you all of the items in the scene. In this window, click on Display > DAG Objects Only (Direct Acyclic Graph), making sure this box is on, to filter what is being shown. When this box is off, many hidden nodes will become visible. Think of these as the strings holding the scene together, delicate and fragile. We want to safely search and select the plane without making unintentional alterations to any hidden nodes. You can now select the plane to rename. In the channel box, change the value of value rotate X by 90.
Fig 2.
We want to re-position the pivot to the centre bottom of the plane. Look at this sequence for direction:
With the plane still selected, click on the Channel Box button to the far-left of the status line to expand some settings. Change the Subdivisions Width to a different value. We will later return to sculpt some dimension to the plane using soft select. After re-positioning is confirmed, go to the main window and click Edit > Delete by type > History, in the same window click on Modify > Freeze Transformations. With plane selected, RMB and hold mouse trigger > Assign Favourite Material > Surface Shader. This temporary menu will vanish if right mouse trigger is not held down. When you confirm from this selection, the attribute editor should open up automatically.
Pressing the chequered box will bring open the Create Render Node window. To apply a texture, make sure you click on the input connections box (if you are on the base material attribute settings (to the right of Out Color) to bring up the render node attribute. Make sure the Filter Type dropdown is set to Off. Click on the yellow folder to prompt an open search if you have connected to a wrong image and want to redirect to a color alpha image. Find the location of this image. Make sure it is a correct graphic format. Make sure the Color Profile dropdown is set to sRGB. Doing so retains color information of the texture. We want to begin to disconnect light linking of this plane in your scene. The main settings have been configured. Note that there is a Color Balance tab below. We will be expanding this tab when applying the second render node, the transparency alpha. Look at this sequence for direction:
Straight away, notice the resolution is very low and the tree is resulted pixelated. This is a viewport resolution setting which we will change. Open your render settings. When the window appears, in the common tab, change the rendered using dropdown to mental ray. Scroll down, under the Image Size tab, change the sub-entry Preset dropdown to HD 720. Make a main scene camera, position it, and set it as the current render camera.
Note that the rendered tree does not Inherent from the reduced viewport resolution. This reduced resolution is a default so as to make sure Maya is running more efficiently for you. We will cover how to punch up the viewport
resolution of the tree in the viewport. Doing so will help to better visualise how the scene looks for when you later populate the scene. We will punch up the resolution in small increments. A basic rule of thumb is to stay within a square metric range of 256 (defaulted value) 512, 1024, 2048 or 4096. Here I have chosen 1024 as it multiples the resolution by four, optimising the viewport texture enough to maintain a more accurate rendered self. Changing the resolution is dynamically effective, updating live in the viewport, though increased metric values will cause lag and the live update will take longer to process. Selecting a metric higher than 4096 is generally frowned upon as it will cause increased odds of lag and unnecessary slowness in Maya. Another dependant factor is how well your computer is so if you begin to suffer lag, reduce the value.
The pixel dimensions of the tree are saved at 1024x1024; these are constrained proportions. Maya prefers square textures, especially when offsetting and tiling textures on any rendering primitives. It is good practice to save all of your textures in this way, selecting one of the ranges. Return to the base material attribute menu by LMB selecting the output connections button: Pressing the chequered box will bring open the Create Render Node window, to the right of Out Transparency, to bring up the render node attributes. Click on the yellow folder to prompt an open search if you have connected to a wrong image and want to redirect to a transparency alpha image. Find the location of this image. Make sure it is a correct graphic format. Make sure the Filter Type dropdown is set to Off. Make sure the Color Profile dropdown is set to sRGB. Doing so retains color information of the texture. We want to begin to disconnect light linking of this plane in your scene. Note that there is a Color Balance tab below. We will be expanding this tab now. Turn on the Alpha Is Luminance button. The main settings have been configured. Look at this image for direction. You should be able to see a transparent alpha in your viewport:
Return to the base material attribute menu by LMB selecting the output connections button:
We are now going to be reselecting a texture resolution for this alpha plane. Expand the Hardware Texturing tab and change the Textured Channel dropdown to Combined Textures, and the Texture Resolution dropdown to Highest (256x256) Expand the Extra Attributes tab. Change the Resolution value to 512, 1024, 2048 or 4096. Note that the resolution will be capped depending on what the file resolution of the texture is. Look at this image for direction. You should be able to see a transparent alpha in your viewport:
In the panel toolbar, turn on the Resolution Gate. With the plane still selected, open the Attribute Editor, scroll down and expand the Render Stats tab. Select settings based on configurations you have in mind for how object is going to operate. In the panel toolbar, click on the Select Camera button. In the attribute editor, scroll down and expand the Environment tab and brighten the color. Look at this sequence for direction. Try to imitate the positioning of these scene items to the ones in the example:
You can continue to tune settings so that the sphere may project shadows onto the alpha planes.