3D MAX TUTORIALS

 

Premultiplied Alpha

There are two methods of storing alpha in a bitmap: premultiplied and nonpremultiplied.

To composite an image that is in nonpremultiplied format, the alpha must be multiplied by each of the R, G, and B channels before adding it to the color of the background image. This provides the correct transparency effect, but it must be done each time you composite. With premultiplied alpha, you store the R, G, and B components with the alpha already multiplied in, so compositing is more efficient.

This is not the only reason that the software stores images in the premultiplied format. When you render an image, you typically want the edges of the objects to be antialiased. This effect is achieved by determining the fractional coverage of pixels on the edge of the object, and then adjusting the alpha of the pixel to reflect this. For example, a pixel that is 30% covered by the object will have an alpha of .30.

To antialias the edges, the alpha must be premultiplied to darken these edge pixels. (This is equivalent to compositing the image over a black image). So it is natural, in a sense, for rendered images to have premultiplied alpha. If you do not premultiply the alpha of a rendered image, then just looking at the RGB you will see jaggies on the edges of objects. You would need to composite it against black using the alpha channel whenever you wanted to display it.

Note: To control whether or not the renderer uses the environment map's alpha channel in creating the alpha for the rendered image, choose Customize > Preferences > Rendering, and then turn on Use Environment Alpha in the Background Antialiasing group.

If Use Environment Alpha is turned off (the default), the background receives an alpha value of 0 (completely transparent). If Use Environment Alpha is turned on, the alpha of the resulting image is a combination of the scene and background image's alpha channel. Also, when you render to TGA files with Pre-Multiplied Alpha set to off, turning on Use Environment Alpha prevents incorrect results.

Tip: If you plan to composite objects in another program such as combustion or Photoshop, render the objects against a black background. Otherwise, a fringe of environment or background color can appear around the objects.


Comments

Home
Selectiong Objects
Selection Commands
Objects Properties
Programmers Forum
Birthday Gift Baskets
Creating Geometry
Transforms: Moving, Rotating, and Scaling Objects
Creating Copies and Arrays
Effects and Post-Production

Systems Animation
Character Assemblies Lights and Cameras
Advanced Lighting
Material Editor, Materials, and Maps
Rendering
3D MAX FORUM

Managing Scenes and Projects
Utilities
User Interface
Customizing the User Interface
Default Keyboards
Transforms: Moving, Rotating, and Scaling Objects
Creating Copies and Arrays
Rendering to Textures

Introduction
Glossary
Getting Started with 3ds max
Viewing and Navigation 3D Space
Modifiers
Surface Modeling
Precision and Drawing Aids
SpaceWarps and Particle
Adobe_Premiere Tutorials

Web Designer - offers freelance web design services, redesign, graphic design, content management, web development and e-commerce.
LTD