14
RENDERING BASICS Introduction to 3D | 2006 c 2006 Gray Holland | a production of

Rendering

Embed Size (px)

DESCRIPTION

alias studiotools

Citation preview

RENDERING BASICSIntroduction to 3D | 2006

c 2006 Gray Holland | a production of

visualization | �INTERACTIVE SHADING

Hardware Shading F3 Hardware Shading is the principal tool for the evaluation of surfaces

and design work. It is fully interactive, yet its speed is directly tied to

the graphic performance of the given machine’s graphic card. The

key is to match the Hardware Shading settings to the speed of the

machine.

There are 3 levels of settings that will most dramatically affect the

speed of interactive shading:

1] Tessellation is the quantity of triangulation that will take place

when the shading is invoked (this will be covered in more detail on

the following page).

The “Fast” option is a must for responsive graphic performance.

“Accurate” will dramatically slow down interactively.

The “Tolerance” is a factor that is relevant to the units you are

working in. So in the example right, the triangulation will deviate no

more than 0.01 cm from the NURBS data.

2] Shading Method is the next level of performance.

Per Pixel is the high quality setting, and is necessary to show off

reflections, texture maps, bump maps, etc.

Per Vertex does not support the reflections, texture maps, etc., but

is focused on showing off basic surface quality. It is the appropriate

option for lower end graphic cards.

3] Ground Plane Settings are extra “bells and whistles” that

show realistic effects of interactive shadows and reflections. It is

most useful for preparing for software rendering, but it should be

used sparingly because it will dramatically slow the performance of

Hardware Shading (especially ground reflections).

The Ground Plane option opens the shadowing and reflecting effects.

Shadows produces shadows on the user defined ground plane. User

Defined matches the shadows to the lighting in the scene. Shadow

Blur and Transparency add realism.

Reflections add more realism, but this effect is very demanding

graphically. The level of Reflectivity, Depth and Blur can produce a

sophisticated look and feel.

Lighting Source has several useful options. “Default” has an overriding light that projects

from the view camera itself. “All Lights” interactively uses the lighting you have set up in

your scene.

Alt W Save Current Window [Default Panel > Windows tab]

Screen shots are great for quick presentations. The following can enhance quality captures:

• Background color can be changed to white.

• Toggle Model-gets rid of wire frame.

• Toggle Smooth –anti-alias the wire frame and shading

• Window Sync –synchronizes ortho windows for multi view shots.

visualization | �SHADING QUALITY

Tessellation

All rendering, both hardware and software, is based on the shading

of small triangles. Surfaces are broken up into small triangular facets

and then shaded smoothly from edge to edge combining to form an

over-all effect of smooth surface.

The examples to the right graphically show the effects of low and

medium tolerances for tessellation. One must remember that this

tessellation has NOTHING to do with the actual quality of the

surface, it is just controlling the quality of the tessellation, and thus

the speed of the interactive shading.

>> There are several areas that tessellation affects beyond Hardware

Shading; Diagnostic Shading, which is an alternative technical

shading technology, and Render Globals, which controls the quality

of software rendering; both have the same tessellation control at the

center of their quality settings.

>> A good way to figure out the tessellation for a rendering is to

use Hardware Shading to figure out the right tolerance number

interactively, then enter that same number into the Render Globals

Mesh Tolerance (WYSIWYG).

>> The Tolerance factor is basically the amount

of deviation from the NURBS surface allowed

when tessellating.

0.5 tolerance 0.01 tolerance

visualization | �TECHNICAL SHADING

Diagnostic Shading: [Default Panel]

Diagnostic Shading is a set of technical shading evaluation tools. They consist of abstract

visualization of concepts, such as graphic visualizations of rate of curvature (Mean, Gaussian,

Principle Minimum and Maximum) as well as stylized highlight and reflection studies (Stripe

Environment, Hard Horizon, and Sky). All are very useful when evaluating high end surface

development such as curvature continuous class “A” modeling...

>> The set of Curvature Evaluation tools includes

several ways of looking at the rate of curvature on

selected surfaces. These tools are designed to

help highlight surface quality issues and will provide

interactive feedback when manipulating surfaces.

>> The reflection shading places surfaces in hard-

edge theoretical environments to study the reflective

qualities interactively.

>> The key is that this shading is focused on

evaluation of surfaces, not about creating materials

and their assignment to objects.

visualization | �BASIC LIGHTING

Minimum Lighting Scenario:

Lighting does more than just illuminate your objects: it sets the

mood. And although you can add lots of lights to your scene, it’s best

to keep it simple. Below is a basic layout of the minimum lighting

needed to produce realistic shading and rendering of objects.

Most scenes need just 3 lights: one primary directional light for

overall illumination and highlights, one ambient light controlling

the shadow core intensity, and one last directional light, pointing

exactly opposite to the primary light, to simulate “bounced” light and

delineate the resulting core shadow.

Directional Light: [primary light source]

This light simulates the illumination from the

sun through the projection of parallel

rays of light.

Ambient Light: [core value]

This light has the effect of ambient or

defused light. It mainly determines the value

of the darkest areas of objects:

The core’s value.

“Fill” Directional Light: [bounced light]

This light simulates the bounced light

which illuminates the shadow

side of given objects.

Primary Directional Light

Ambient Light

“Fill” Directional Light

>> Create this fill light opposite the main directional light:

To accomplish this: scale a copy of the main directional light by -1 -1 -1

in the Informational Window (Alt Shift I). Then cool off the light’s color and

reduce its intensity by half (0.5).

[shadow]

[highlight]

rendering | �MATERIAL DEVELOPMENT

Multi-lister:

This is where all shading, lighting, and environment control are

created and edited. All these entities can be endlessly manipulated

and assigned to any number of surfaces. A simple double-click on

any of these shaders opens its editor, which gives access to the

shaders’ many attributes. In addition, the editor enables

the application of additional parameters: this is known as

“Texture Mapping.”

Alt Q Multi-lister All

Ctrl Q Multi-lister Picked Only

>> Image Mapping can add huge amounts

of realism to renderings by bringing real

world textures into the virtual world. Also

layering texture map on top of texture map

helps to create realistic shaders.

Editor:

The edit window provides access to all the detailed shader

controls. It also provides map points for the texture mapping

channels. Double-clicking on any shader icon in the multi-

lister opens the shader editor.

Mapping:

Texture mapping is the

primary way of adding realistic

details to shaders. Textures

are mapped onto the various

channels of a given shader.

There are several types of

mapping (covered more on

the following pages): Surface,

Solid, and Environmental.

All these types use two

categories of mapping:

Procedural Maps are software

controlled textures with many

variable attributes; and Image

Maps are textures controlled

by image files (.tiff, .jpeg,

.als, etc.). The key to building

realistic materials is often to

use multiple texture maps by

layering both procedural and

image maps throughout the

many shading channels.

>> Refract Limit:

Refer to pages 11-14

rendering | �BASIC SHADING

Diffuse: The ability of the surface to respond to light, affecting the fall

off of the highlight itself. The higher the Diffuse value, the more the

actual surface color realized. Thus a low value will “dull” the shader’s

color, a higher value will intensify its color—material saturation control.

Specular: Defines the color and intensity of surface highlights.

Specular Rolloff: applies to the quality of the specularity and the ability

of the surface to reflect from oblique angles. This value is often set low

for shiny materials, but can be used to produce many special effects.

Middle values are useful for rubber-like materials.

Eccentricity: Controls the size of highlights on a surface. Small

highlights define shiny surfaces like glass; large ones are used for soft

or velvety surfaces such as rubber.

Reflectivity: Is the ability of the surface to reflect its surroundings. Low

values simulate lightly textured plastics and diffuse reflective metals

like aluminum; high values work well for materials like glass, water, and

chrome.

Reflection: Refers to applied environmental reflection mapping only.

This is most useful for Hardware Shading and RayCasting. Raytracing

over-rides this channel with the scene’s Environment (unless Reflect

Map parameter is turned on).

The Blinn Shading Model:

There are four Shading Models (Phong, Blinn, Lambert, and

Lightsource). In the end Blinn is the most useful because it is the

most flexible. Blinn can produce a large range of shading effects by

manipulating six primary parameters (covered in detail below). Blinn

has the capacity to describe diamond hard leaded glass, or velvety

soft rubber, and everything in between…

Diffuse > 0.8

Specular > 0.4

Specular Rolloff > 0.4

Eccentricity > 0.4

Reflectivity > 0.0

Diffuse > 1.0

Specular > 0.5

Specular Rolloff > 0.0

Eccentricity > 0.2

Reflectivity > 0.3

Diffuse > 0.8

Specular > 0.7

Specular Rolloff > 0.0

Eccentricity > 0.2

Reflectivity > 0.2

Diffuse > 1.0

Specular > 0.5

Specular Rolloff > 0.0

Eccentricity > 0.3

Reflectivity > 0.3

rendering | �TYPES OF MAPPING

Surface, Solid, and Environment Mapping:

There are 3 basic types of texture mapping. Each applies

textures to channels in a different way, to achieve

different effects. All of these different mapping functions

can be used in different combinations to develop

sophisticated material effects.

Surface Mapping:

This type of mapping stretches the given texture to

the 4 corners of the assigned surface(s). Surface

mapping takes on all the parameterization

qualities of the mapped surface itself.

Solid Mapping:

This mapping procedure is based on the volumetric intersection of

surfaces with Projection Objects. There are 8 different types of Projection

Objects; each uses a different projection geometry model. The Solid

texture uses the Projection Object to place itself in respect to the applied

surfaces, and has the ability to move, scale, and rotate it in any way.

Environment Mapping:

This mapping is focused on applying

reflection environments. There are

several types of environments to map:

Cube is used to map 6 images to

create a room-like reflection. Ball and

Sphere environments map images to

for realistic exterior reflections. Chrome

and Sky environments produce stylized

procedural reflections.

>> Environment Maps applied directly to shaders work for Hardware

Shading and Raycasting

>> When Raytracing the Environment Map needs to be applied only to

the master Environment in the Multi-lister (see page 6).

>> Many of the Textures

offered are procedural in nature.

>> Image-based Textures

include: File, Stencil, Ball,

Cube, Sphere, Projection, and

Volume

rendering | �TEXTURE MAPPING

The Value of Effect:

Many of the texture mapping channels rely on a simple gray scale for

the level of effect. White is equal to 100% full effect, black is 0%

effect, and everything in between is a shade of that effect’s intensity.

The following examples highlight how this gray scale can control a

variety of texturing effects (mapping path: see page 6).

Transparency Map:

A Checker procedural texture is mapped to the transparency channel.

White areas are completely transparent; black are completely opaque

Notice that the transparent squares still have a specular highlight…

Specularity Map:

By adding a modified copy of the same Checker texture mapped to the

Transparency channel, and then applying it to the Specularity channel,

the appearance of a square “hole” is possible. In this case, the black

and white checker pattern is inverted to make the lack of specularity

(black) match up with the Transparency (white).

Bump Map:

Mapping this Checker pattern to the Bump channel will create a

slightly raised texture. Positive intensities produce positive bumps;

Negative values produce embossed bumps.

Displacement Map:

Applying the Checker map to the Displacement channel produces a

true 3D texture. Note that the intensity value can produce dramatic

effects.

>> This perforated steel shader involves several applications of the

same Ramp texture map, slightly modified to meet the requirements of

the given channel. For this shader, maps are applied to Transparency,

Specularity, and Bump channels to create the desired perforated effect.

100% effect

0% effect

50% effect

clear

translucent

opaque

rendering | 10IMAGE MAPPING

Mapping A Logo:

The following example covers the basics of creating a logo on a given

object, based on a set of associated image files. In this case we want

the color of the logo to be embossed into a metallic material.

Step 1: On the selected shader, start by mapping a Solid > Projection

map to the color channel. Then map a Surface > Stencil map onto its

Source Texture channel. Then map a Surface > File onto its Image

channel. Now you can finally Browse to map the actual color image

map. Now to place the map precisely in relation on the surface itself

you must first toggle on the Projection Object by clicking on the 3D

texture icon. Now select that Projection Object (green cube) and

transform it into position (see page 6).

Step 2: Note that the surface(s) seem to be covered by repetitions of

the logo (above left)—to limit the logo to just the intersection of the

Projection Object, you must turn OFF the “Wrap” option under “3D

Placement” (within the Solid Projection’s editor). When you are happy

with the placement of this logo rename it “COLOR_project” and save

out the Solid Projection map with the Multi-lister’s > Save As option.

Step 3: Now add a bump map to the Bump channel by clicking its map

button followed by the Browse button and selecting the recently saved

color Solid Projection, then name it “BUMP_project.” Next go to this

projection map’s image file and replace it with the prepared grey-scale

bump map. Note that the logo now looks embossed into the metal

surface (you must have Per Pixel selected in Hardware Shade to see

this effect).

Step 4: Now to make the logo float, you must

use the Stencil feature to Mask out the area

around the logo image.

Go back to the Stencil map and map a Surface

> File to the Mask channel, then browse for the

prepared masking image. You will now notice

that the result is a “floating” logo.

>> A negative

intensity

produces an

embossed

look, and

vice versa.

Color Image Map

Mask Image Map

Bump Image Map

Multi-Channeled Shader:

It is often necessary to produce several images to map to several

channels to create the desired effects. This shader represents an

example of this multi-dimensional use. Below is sample of the multi-

lister view of this shader with all of its channels exposed.

>> 3D Texture Icon:

Toggle on and off

>> These image files above are TIFF format prepared in Photoshop.

rendering | 11BASIC RENDERING

Global Quality Level: This field enables switching between 3 levels of

rendering quality settings. Of course these settings are a default starting

point and should be edited to reflect the requirements of the individual

rendering.

Mesh Tolerance: This controls the tesselation of objects in the render.

High values are good for fast test rendering. Low values are best for final

renderings, delivering fine details but longer rendering times (page 3).

Anti-aliasing Levels: Anti-aliasing controls the pixel smoothness of the

digital rendering. It also greatly affects rendering times. A general rule is

to set the Maximum value to twice the Minimum value. 8-12 values are

good settings for final renderings; 2-4 for medium tests, 1-2 for low.

Raytracing Maximum Limits: This set of controls is the overhead limit

for the rendering. These values can also greatly affect rendering times.

EACH shader has its own settings for these values, so don’t forget to set

them first (to their highest final rendering values). Then use this setting in

the globals to crop limits down during test rendering (pages 13-14).

Format: This is where the image format is set. TIFF is the best format

because it can store alpha channel information.

Render Window Selection: Allows the user to select which windows

to use for rendering and whether or not to include the alpha channel (or

mask). Multiple windows can be rendering and be set up at one time, but

they must have exactly the same resolution.

Resolution: These fields set the rendering resolution. To calculate the

printable size of a given rendering, multiply your desired DPI by the

image size in Inches to determine the render resolution:

such as 300 DPI (8.5’ x 11’) = 2550 x 3300 pixels.

Setting Up and Testing Renders:

Software rendering is very much like photography. First you compose

the shot. Next you adjust the placement of the lighting. Then you

snap some test shots...

Direct Rendering is a way to render directly into the Studio

windows. In fact, you can even select just part of the window

to render into. This is the place to tweak all the aspects of your

rendering [composition, lighting, shaders, etc.]. Do these tests at

smaller resolutions and at a Medium or Low Global Quality Level.

Lastly you will want to tweak the rendering settings themselves >>

[details to the right].

Final shots

should be

kicked off

for rendering

outside of

Studio...

Opens the

Render Globals

editing window

Kicks off

Direct Render

rendering | 1�RAYTRACING vs RAYCASTING

Raytracing 18:59 minutes

Time:

Slower [in most cases]

Memory:

More intensive with high levels of refractions and reflections.

Shadows:

Default hard edged shadows [fast rendering]

Soft Shadows option [increasing render time]

Transparency:

Photo-realistic refractions

Reflections:

Objects can reflect back and forth multiple times, as in reality.

Best Applications:

Outdoor lighting conditions, Super accurate shadows, anywhere realistic

“object to object” reflections and refractions are needed (metals and

glass)

Summary:

Raytracing accurately “traces” the rays of light and calculates physical

material properties as the rays intersect different types of materials. It is

also more expensive as far as time is concerned.

Computer Rendering:

There are the two types of rendering: Raycasting and Raytracing.

The key is to figure out which one is best for each individual

shot. Each has its own pluses and minuses; each has its own

characteristics, special considerations, and set up.

The following chart outlines some of the basic capabilities and should

help explain some of the basic differences between the two

rendering engines:

Raycasting 1:33 minutes

Time:

Faster [in most cases]

Memory:

Generally less intensive (except for large Shadow Maps)

Shadows:

Only with Spot lights

[Shadow Maps produce even, soft, and constant valued shadows]

Transparency:

Yes, but not realistic material quality [no refractions]

[Also, transparent objects will not cast any shadows]

Reflections:

Only reflection maps apply here. Objects cannot reflect into each other.

[Only environmental maps are be reflected].

Best Applications:

Interior lighting conditions, Softly defined shadows, non-refractive

materials, environmental reflections only.

Summary:

A limited but very time effective render. If you can use reflection maps

and avoid much refractive materials, this is a good way to render.

>> If a shader is representing a colored translucent

material, then that color must be added to the

Transparency channel in order to make a colored shadow

(often the color in the Transparency channel should be

slightly less saturated than the shader color itself).

rendering | 1�TRACING RAYS

Raytracing Concept:

Raytracing works basically backwards from how rays of lights work

in reality. Instead of rays of light bouncing off objects into a camera’s

lens, Raytracing starts by sending rays outward from its virtual

camera and traces their bounces through the objects in the scene.

The image below attempts to illustrate a single ray bouncing through

this sample scene. Refractions happen at points where the ray

intersects transparent objects and as a result changes the angle of its

path. The Refractive Index calculates the amount of refraction for any

given material. The largest count of refractions in a given scene will

determine the Refraction Limit needed to render effectively.

0

12 3

45

67

8

>> When Raytracing transparent

materials each material has to be

though of (and modeled) as a solid.

In the case of a glass filled with a

liquid, it is very important to have

small offsets between the 2 materials,

such as liquid and glass.

This assures correct Raytracing of

the materials and avoids potential

tessellation artifacts.

>> This ray trace reveals that it would take a Refraction Limit of

at least 8 to see the floor just behind the glass through all of its

refracted bounces (the Refract Limit is set per shader page 6, and in

the Render Globals page 11).

>> Just to be safe, you might want to add 2 more to the Refractive

Limit to achieve the best render results...

>> The Shadow Limit is linked to

the Refract Limit: for shadows to be

rendered properly the Shadow Limit

is always 1 less than the Refract Limit

(Shader page 6, Globals page 11).

rendering | 1�

Refractions Limits:

Setting the Reflection, Refraction, and Shadow Limits are some of

the most confusing aspects of Raytracing. Setting them too low will

not look realistic, setting them too high will drive rendering times

high. The illustrations on this page hopefully with help guide you

through setting up these limits “just right.”

RAYTRACING REFRACTION SETTINGS

Reflect Limit 2Refract Limit 10Shadow Limit 9

Soft Shadow 2

Reflect Limit 2Refract Limit 4Shadow Limit 3

Reflect Limit 2Refract Limit 8Shadow Limit 7

Reflect Limit 1Refract Limit 2Shadow Limit 1

Reflect Limit 2Refract Limit 6Shadow Limit 5

Hardware Shadewith shadows

Reflect Limit 2Refract Limit 10Shadow Limit 9

Soft Shadow 12

>> The Shadow Limit is always set 1 less than

the Refraction Limit (page 6 and page 11).

>> Rarely are reflections needed past 2, too

many reflections often make shots messy.

>> Final rendering with all the tweaked settings ends up taking

16:27 minutes to render at a 600 X 460 resolution.

>> Setting Shadow Samples to around 12 will most often give you fairly

smooth Soft Shadows, but will drive up render times; use 2 for test

renders.