unit vi o bject rendering. introduction lighting in computer graphics refers to the placement of...

26
UNIT VI OBJECT RENDERING

Upload: polly-tucker

Post on 01-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

UNIT VI

OBJECT RENDERING

Page 2: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

INTRODUCTION Lighting in computer graphics refers to the

placement of lights in a scene to achieve some desired effect.

Lighting is very important part of an image synthesis.

It is used to create 3D effect by separating foreground from background.

Rendering: It refers to the process of adding realism to computer

graphics by adding 3D qualities such as shadows and variations in color & shade.

It is the process of generating an image from a model by means of computer programs.

Model may contain geometry, view-point, texture, lighting & shading information.

Page 3: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

FEATURES OF RENDERING

Shading: How the color and brightness of the surface varies with lighting.

Texture mapping: A method of applying details to the surfaces.

Shadows: The effect of an obstructing light. Soft Shadows: Varying darkness caused by

partially obscured light sources. Reflection: a mirror like or a highly glossy

reflection. Transparency: Sharp transmission of the light

through the solid objects.

Page 4: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

LIGHT MODELLING TECHNIQUES We have four modeling techniques:

1.Rasterization : It includes a scan line rendering that considers the objects in the scene & projects them to form an image withno facility for generating a point of view perspective effect.2.Ray casting: It considers the scene as observed froma specific point of view, calculates the image based only on geometry.

Page 5: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

3.Ray tracing: It is same as ray casting but employs more advanced optimal simulation and usually uses the Monte Carlo techniques to obtain more realistic results at a speed that is often of slower magnitude.

4.Radiosity: It uses the finite element mathematics to simulate diffused spreading of light from surfaces.

Page 6: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

Example

Page 7: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

ILLUMINATION MODEL:

An illumination model is influenced and described using a particular equation.

Modeling the interaction of light with the surface of some object is known as lighting model.

The contribution from the light that goes directly from the light source and is reflected from the surface is called a local illumination model.

A global illumination model: It adds to a local model the light that is reflected from other surface to the current surface.

A global illumination model is more comprehensive, more physically correct and produces more realistic images.

Page 8: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

SHADING It is a process used in drawing for depicting levels

of darkness on a paper by applying media more densely or with a darker shade for darker areas or less densely or with a lighter shades for lighter areas.

It refers to a process of altering a color based on its angle to lights and its distance from lights to create a photorealistic effect.

The shading is performed during the rendering process.

It is an interpolation based technique that helps to understand how the angle of light sources reaches the object within a scene.

The shading techniques or models are widely used in rendering objects for commercial and other applications.

Page 9: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

There are four types of shadings: 1. Flat shading2. Polygon mesh shading3. Gouraud Shading model4. Phong shading

Page 10: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

FLAT SHADING: A flat shading is a technique used in a 3D

computer graphics. It shades each polygon of an object based on angle

between a polygon’s surface and the direction of the light source, their respective colors and the intensity of the light source.

It is used for high-speed rendering, where more advanced shading techniques are too computationally expensive.

It is a simplest shading model for a polygon known as constant shading or faceted shading.

Page 11: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

This approach applies an illumination model to determine a single intensity value that is then used to shade an entire polygon and holding a value across a polygon to reconstruct its shade.

The disadvantage of flat shading is that it gives faceted look to the low polygon models.

A flat shading is fast and fine for prototyping and testing but is of a little value for realistic games.

Page 12: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

POLYGON MESH SHADING: It determines the shade of each polygon

individually. The two basic shading models for the polygon

meshes take advantage of the information provided by the adjacent polygons to simulate a smooth surface.

Page 13: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

GOURAUD SHADING MODEL: The Gouraud is named after Henri Gouraud. It is method used in computer graphics to simulate

the differing effects of light and color across the surface of an object.

It is used to achieve a smooth lighting on the low polygon surfaces without the heavy computational requirements of calculating the lighting for each pixel.

Page 14: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

PHONG SHADING: Phong shading combines a model for the reflection

of light from surfaces with a compatible method of estimating pixel colors using interpolation of surface normals across rasterized polygons.

It is an empirical model of local illumination. Phong shading produces better results than the

Gouraud shading but it is more expensive in terms of computation.

Page 15: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

SHADOWS Region of darkness where light is blocked by an

object. A shadow is a dark region projected on to a surface

by an object that receives a light. It is used to add realism and perception of an

object position in space and their relative position with respect to light source.

Types of shadows are as follows: Self shadow Projected shadow Soft shadow Hard shadow

Page 16: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

Self shadow: It is created when the object itself prevent the light

from reaching some of its plane. Generally if the view area and the light source are

coinciding then shadow is generated. Projected shadow:

These shadows are created due to obstacles forming on the path in which the light travels.

A projected shadow is formed when an intervening object prevents the light from reaching the other object.

A projected shadow results when an intervening object prevents the light from reaching another object in the scene.

Projected shadows are found by projecting all the non self hidden planes into the scene from the position of light source.

Page 17: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

Soft shadow: Soft shadow are created by a single light source, and a

surface may have many overlapping shadows from several light sources.

It consists of umbra and penumbra. Umbra is a completely occulted region of shadow. Soft shadows appear more realistic than hard shadows

so are desirable for the more realistic simulation. Hard shadow:

Hard shadows are formed when an object receives light from a point light source at a very large distance.

A hard shadow is termed so because of the fact that the umbra region is only region that is clearly defined on it.

That is penumbra is undefined. Hard shadows are relatively easier to compute for a

given object than soft shadows.

Page 18: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting
Page 19: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

COLOR MODEL The human eye is sensitive to an electromagnetic

radiation with wavelengths between 380 and 700 nm.

This radiation is known as light. Color model is an abstract mathematical model,

describing the way colors can be represented. It may be represented as a tuples of numbers. Color models explains the properties or behavior of

color with some particular context. There are two types of color models

RGB color model CMY color model

Page 20: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

RGB color model: It is generally used in computer graphics. It corresponds to Red, Green and Blue intensity settings

of a color monitor. Other colors are generated by adding intensities of

primary colors. For example, Yellow(1,1,0) is a combination of Red and

Green. Each color is represented by a triple (R,G,B).

CMY color model: It is generally used in color output on printer. The primary colors are Cyan, Magenta and Yellow. Other colors are generated by adding intensities of

primary colors. For example, Cyan can be formed by adding green and

blue. It means there is no red color, i.e. red color is absorbed or subtracted.

Similarly Magenta absorbs Green and Yellow and removes blue.

Page 21: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

ANIMATION Art of creating a moving images by using

computers Applications of computer animations are games

cartoon motion pictures Animation creates the illusion of movement An image is displayed on the computer screen

which then quickly replaced by a new image that is similar to the previous image but slightly shifted

Page 22: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

KEY FRAME V/S PROCEDURAL To produce a key frame animation, the animator

creates the behavior of a model manually by using an intuitive “put that there” methodology. The animator has direct control over the positions, shapes, and motions of models at any moment in the animation.

On the other hand, to produce a procedural animation the animator provides initial conditions and adjust rather abstract physical parameters, such as forces and torques, in order to control positions, shapes, and motions of models. The effect of changing a parameter value is often unpredictable in procedural animation. The animator has to run a simulation to see the result.

Page 23: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

CONSTRUCTION OF AN ANIMATION SEQUENCE A typical animation sequence is obtained using:

Storyline A storyline is a sketch which are used by the action defining the

motion progression as a set of basic events that must take place

It comprises all the events in a story, consisting of rough sketches or it could be a list of basic idea for the motion.

Object definition: An object is a participant in an action that can have some

properties and bear relation with other object An object definition is given to each participant in the action

defined in terms of basic shapes such as circle, arc and so on.

Key Frame Specification: A key frame is a drawing that defines the starting and ending

point of any smooth transition. A sequence of key frame defines which movement will be seen.

Tweening: The process of generating intermediate frames between two

images to give the appearance that the first image evolves smoothly into the second image.

Page 24: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

MORPHING Morphing is a special effect in motion

pictures and animations that changes (or morphs) one image into another through a seamless transition. 

Morphing is a phenomenon by which a picture smoothly transmutes into another picture.

Intermediate images that bridge the transition are calculated from the source and destination images using a mathematical function.

Morphing is a combination of two process: a) Cross Dissolving

b) Warping

Page 25: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

Cross Dissolving:It changes the image color pixel by pixelIt produces intermediate images by averaging the pixel color row by row and column by column

A simple morph between two similar images and same dimension and resolution can be created by cross dissolving alone

WarpingWarping changes the shape of the feature in an

image by shifting its pixel aroundWarping is used to change the shape of the

image. It changes the row and column values of an

image pixel thus changing the actual shape of feature in an image

Page 26: UNIT VI O BJECT RENDERING. INTRODUCTION Lighting in computer graphics refers to the placement of lights in a scene to achieve some desired effect. Lighting

Morphing from Car into Tiger