Top Banner
RENDERING Michael Heron
23

GRPHICS04 - Rendering (1)

Nov 01, 2014

Download

Technology

Michael Heron

This is a course on the theoretical underpinnings of 3D Graphics in computing, suitable for students with a suitable grounding in technical computing.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: GRPHICS04 - Rendering (1)

RENDERINGMichael Heron

Page 2: GRPHICS04 - Rendering (1)

INTRODUCTION

As part of the process of creating a 3D scene, we are building up a model of objects.The geometry of those objectsThe relationship of those objects to each

otherThe relationship of the objects to the

camera. However, in order to turn this scene into

a useable image, we must go through a separate process.Rendering

Page 3: GRPHICS04 - Rendering (1)

RENDERING

The aim of rendering is to view objects as solids.Not polymeshes, wireframes, or any other

of the representations we have discussed. Requires several steps

Identify which surfaces are visibleProject surfaces onto the 2D viewing planeShade surfaces appropriatelyRasterise

Convert from mathematical representation into bitmaps.

Page 4: GRPHICS04 - Rendering (1)

RENDERING – TWO FLAVOURS

Depending on the intended application, rendering can have one of two flavours. Real-time

Games, simulations Non Real-Time

Movies, static scenes

In both cases, the end goal is the same. Turn the mathematical representations of a 3D

scene into something pretty.

Page 5: GRPHICS04 - Rendering (1)

REAL-TIME RENDERING

For real-time scenarios, trade-offs are required.Scenes must be rendered quickly enough

for the human eye to be fooled Around 30 frames per second

Trade off is between photorealism and speed of processing. Can use tricks to ‘fool’ viewers.

As time goes by, this trade-off becomes less important.Computers get faster, our eyes don’t.

Page 6: GRPHICS04 - Rendering (1)

NON REAL-TIME RENDERING

For non-interactive media, time is not important. We can spent many more seconds rendering an

image because we have no throughput to reach. Each frame may take minutes/hours to render. Played back at 25-30 frames per second.

Like old fashioned cartoon animations.

Page 7: GRPHICS04 - Rendering (1)

RENDERING - LIGHT

Simply assigning a colour to a surface gives an unrealistic appearance.The interaction of light with objects is one

of the primary mechanisms for achieving ‘realism’

Light interaction is complex IlluminationReflectionShadingShadowsTexture of surfacesTransparency/Translucency

Page 8: GRPHICS04 - Rendering (1)

RENDERING - LIGHT The appearance of an object depends on:

The type of light source Distance to the light source Orientation of the object relative to the light

source Surface properties of the object

Determines the nature of light interaction Repeat for all light sources.

Lots of processing.

Page 9: GRPHICS04 - Rendering (1)

RENDERING - LIGHT

In non real-time situations, we can precisely model the physics of light interaction. Such as with ray-tracing Or radiosity

For real-time situations, an approximation will suffice. As long as it looks good.

Page 10: GRPHICS04 - Rendering (1)

LIGHT SOURCES

There are several kinds of light sources that are used in 3D modelling.Point light sourcesAmbient light sourcesDirectional light sourcesSpotlight sources

They are all used to give differing ‘textures’ of light and shadow.Choosing the right kind and number of

light sources an important part of good scene output.

Page 11: GRPHICS04 - Rendering (1)

LIGHT SOURCES - AMBIENT

Ambient light is the general background illumination. All objects reflect light to some degree Light can reach parts of a room/scene that are in

no direct line of light. Illumination is constant on all surfaces

Regardless of position or orientation Light is uniform across a scene.

Page 12: GRPHICS04 - Rendering (1)

LIGHT SOURCES - DIRECTIONAL Directional light sources emit light

strongly in a particular direction.Like the sun

Objects in the line of light more brightly illuminated than other objects.

Light is uniformly provided in a fixed direction.

Light source is assumed to be very far away.No need to deal with light distance

calculations. Objects at the back of a scene lit to the

same degree as objects at the frontProvided they are directly in the path of

light.

Page 13: GRPHICS04 - Rendering (1)

LIGHT SOURCES - POINT

Point light sources have Location Colour

They emit light equally in all directions. Like a lightbulb.

Light strength attenuates Gets weaker with distance Gradients of illumination across a surface

Can be moved around with a scene.

Page 14: GRPHICS04 - Rendering (1)

LIGHT SOURCES - SPOTLIGHT

Very similar to a point light source Difference is that spotlight source does not

radiate in all directions. Direction of light can be varied within a

scene. This distinguishes it from directional light.

Light attenuates with distance. This also distinguishes it from directional light.

Page 15: GRPHICS04 - Rendering (1)

SURFACES

The surface of an object represents the next implication for light interaction.

Surfaces can: Absorb light Reflect light Refract light Emit light

They can glow in the dark

Page 16: GRPHICS04 - Rendering (1)

ABSORPTION The colour of the surface determines the

level of absorption Black absorbs all visible spectrums White reflects all visible spectrums. Coloured surfaces vary depending on colour.

Reflect some wavelengths Absorbs others

Wavelength interaction with colours a matter of physics.

Page 17: GRPHICS04 - Rendering (1)

REFLECTION Reflection can be either

Specular Reflects like a mirror Light gets reflected at angles

Angle of reflection Ever tried shooting a laser pointer at a mirror?

It’s like that Diffuse

Reflects at many angles at once Diffuse reflection is the primary way in which we can

see objects.

Page 18: GRPHICS04 - Rendering (1)

REFLECTION

http://www.curriki.org/xwiki/bin/view/Coll_Athabasca/Unit3-Lesson2TheMovementofLight

Page 19: GRPHICS04 - Rendering (1)

REFLECTION Reflection is dependant upon

The arrangements of facets on a surface The roughness of the surface The orientation of the surface The absorbption of the surface.

Light can also be refracted As light moves from one medium to another, the

path of the light bends. Mechanics of this are not trivial

Page 20: GRPHICS04 - Rendering (1)

REFRACTION

http://www.curriki.org/xwiki/bin/view/Coll_Athabasca/Unit3-Lesson2TheMovementofLight

Page 21: GRPHICS04 - Rendering (1)

TRANSMISSION Sometimes, objects transmit light through

themselves. Such objects can be transparent (like glass)

or translucent Transparent objects refract light passing through.

White light through a prism Translucent objects diffuse the light that passes

through Frosted glass

Page 22: GRPHICS04 - Rendering (1)

LIGHT RENDERING

Two approaches used to render light Local reflection models

Everything floats in ‘dark space’ Only one reflection of light considered

Global reflection models Light reflects off of objects which reflect onto other

objects Indirect light

Very costly to render Not yet perfected

Page 23: GRPHICS04 - Rendering (1)

SUMMARY

One aspect of rendering is the interaction of light upon surfaces.This can be

Real-time Non Real-Time

Issue complicated by the physics of lightReflection, RefractionDifferent kinds of lights

Lighting is an important part of rendering believable 3D scenes.