CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer...

31
447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics

Transcript of CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer...

Page 1: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 1

Realistic Rendering

-- Radiosity Methods--

Introduction to 2D and 3D

Computer Graphics

Page 2: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 2

Radiosity methods...– ...were developed to account for the interaction

of diffuse light between objects in a scene...are excellent for creating interior environments made up of collections of non-specular objects

– ...create very realistic looking interiors– ...have created the most realistic and

impressive images– ...do not need to use an ambient light constant!

Advanced RenderingRadiosity Methods

Page 3: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 3

The history of Radiosity...– ...was formed from research in radiative heat

transfer in 1984 to account for heat transfer between objects (i.e., elements in a furnace or on a spacecraft)

– ...is based on a formula for creating an equilibrium of energy within an enclosure

– ...means that all energy emitted or reflected by every surface is accounted for by its reflection or absorption by other surfaces

Advanced RenderingRadiosity Methods

Page 4: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 4

Radiosity...– ...is the rate energy leaves a surface

– ...is the sum of the rates reflected or refracted from the surface

Radiosity methods...– ...are the techniques for computing surface

radiosities in an environment

– ...model diffuse light, unavailable with all other methods

Advanced RenderingRadiosity Methods

Page 5: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 5

Radiosity methods...– ...provide for color bleeding from one surface to

another– ...allow for shading within a shadow envelope

– ...create penumbrae along shadow boundaries Unlike ray tracing, radiosity works on objects

to determine the intensity at discrete points...

Advanced RenderingRadiosity Methods

Page 6: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 6

Unlike ray tracing, – ...it does not work at the pixel level...– ...this means radiosity is independent of the

viewer's position– ...radiosity first determines the light interactions

in an environment; then, one or more views are rendered

Advanced RenderingRadiosity Methods

Page 7: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 7

Radiosity methods...– ...treat the light source just like any other surface that

emits or transmits light– ...this means it allows surfaces to emit light– ...which ultimately means that light sources are all

considered to be area light sources! – (There are no point light sources with radiosity

methods)– ...or, you could say that all surfaces are perfect

diffusers

Advanced RenderingRadiosity Methods

Page 8: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 8

Radiosity is defined as the energy leaving a surface patch (per unit of time)...– ...where the environment is broken up into a finite number of

discrete surface patches– ...and each surface patch can emit and reflect light uniformly

over its entire area– ...so the sum of the light emitted and reflected is the

radiosity for that surface patch– ...plus concave patches include calculations including their

own reflected light when determining radiosity

Advanced RenderingRadiosity Methods

Page 9: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 9

Since radiosity is calculated per surface patch...– ...inorder to avoid flat shading for each surface

patch, the vertex radiosities must be calculated from the patch radiosities

– ...then, Gouraud or some other intensity interpolation shading technique can be used for more realistic shading

Advanced RenderingRadiosity Methods

Page 10: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 10

Vertex radiosities are determined...– ...for vertices interior to the surface, by the

average of the radiosities for the patches that share that vertex

– ...for vertices on the edge when averaged with the closest interior vertex, by the average of the radiosities of the patches that share the edge vertex

Advanced RenderingRadiosity Methods

Page 11: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 11

Vertex radiosities are determined...

Advanced RenderingRadiosity Methods

Patch 1 Patch 2

Patch 3 Patch 4

Vertex A

Vertex B

Radiosity of Vertex B is the averageof the radiosities of Patches 1 through 4

Radiosity of Vertex A is the sum ofPatch 1 and 3 radiosities minus Vertex B'sradiosity

Page 12: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 12

Uses form factors...– ...to characterize the effects of the geometry of

two surfaces when radiative energy is exchanged between them (i.e., light is reflected and refracted between them)

– ...which are independent of the wavelength and are a function of the geometry only; they do not need to be recomputed if lighting changes!

Advanced RenderingRadiosity Methods

Page 13: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 13

Uses form factors...

Advanced RenderingRadiosity Methods

•Patch normal

Ray's lengthbetween two areas

• The form factor is calculated... ...using the angles with the normals made by the ray between the patches, the length of the ray, and whether or not the patch is visible from the other

Angle i

Angle j

Surface patch i

Surface patch j

Page 14: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 14

Form factors between patches...– ...was developed in 1985 as the hemicube method

Hemicube form factors...– ...are used to approximate the hemisphere around patches because flat

projection planes are less expensive to compute

– ...constructs a hemicube around center of each patch

– ...where the patch normal and the hemicube Z axis are coincident

Advanced RenderingRadiosity Methods

Page 15: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 15

Hemicube form factors...

Advanced RenderingRadiosity Methods

Patch normal

Surface patch j

Surface patch i

Projection of patch j ontothe hemicube

Page 16: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 16

Hemicube...– ...faces are divided into cells– ...projects every other patch in the environment onto this hemicube– ...where two patches that project onto the same cell can have their depth

compared and the further patch rejected, because it cannot be seen from the receiving patch

– ...therefore, the contribution of hidden patches is ignored, like hidden surface removal!

Advanced RenderingRadiosity Methods

Page 17: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 17

Hemicube faces are divided...

Advanced RenderingRadiosity Methods

Patch normal

Surface patch j

Surface patch i Projection of both patches

Surface patch k

Page 18: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 18

With Hemicube...– ...each cell defines a portion of a patch's form

factor– ...the contribution of each cell in the hemicube

to the form factor is a function of the patches that project onto the cell and its position in the hemicube

– ...patches with the same projection on the hemicube have the same form factor

Advanced RenderingRadiosity Methods

Page 19: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 19

With Hemicube...

Advanced RenderingRadiosity Methods

Patch normalZ axis

Vector between the hemicube pixel(or cell) and the patch i

Surface patch i

•xy

Angle i

Angle j

Projection of patch j (1 pixelexample)

Page 20: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 20

Radiosity methods in general...– ...are difficult to code

– ...require extensive computing resources

– ...have performance dependence on the number of patches in an object since a hemicube calculation is performed for every patch (onto which all other patches are projected)

– ...have performance dependence on the complexity of the environment and the resolution of the hemicube

Advanced RenderingRadiosity Methods

Page 21: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 21

Aliasing also affects images generated with radiosity methods...– ...if a hemicube resolution is too low– ...but are in general minimal since diffuse

illumination changes slowly across a surface Much research is on-going to find faster,

more accurate, and less storage intensive techniques to perform radiosity methods...

Advanced RenderingRadiosity Methods

Page 22: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 22

Using radiosity methods...– ...the quality of the image is a function of the size of the

patches (i.e., the finer the patches the better the results!) Radiosity methods can be improved...

– ...by subdividing patches where problems occur (i.e., for example along shadow boundaries) ...by a process called substructuring

– ...with sub-patches solved independently among patches

Advanced RenderingRadiosity Methods

Page 23: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 23

Substructuring uses three steps...– ...evaluate the radiosity using the patch methods– ...subdivide patches that exhibit potential problems and

calculate the sub-patch form factors– ...determine the radiosities for the subdivided patches

• Subdivision of patches...– ...can be repeated until achieve desired accuracy– ...therefore improves the quality of images in the areas

that require more accurate treatment

Advanced RenderingRadiosity Methods

Page 24: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 24

With radiosity methods...– ...the conventional pipeline is used to achieve global illumination

effects needed for diffuse radiosity– ...the form factors are pre-computed for the entire image before being

processed by the viewing and rendering components of the pipeline

Advanced RenderingRadiosity Methods -- Pipeline

Page 25: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 25

With radiosity methods...

Modeling

MC WC VRC

ViewOrientationTransformation

NPC

View Mappingand Clipping

AbstractRendering

• • •

Advanced RenderingRadiosity Methods -- Pipeline

CalculateVertexIntensities

Radiosity

Page 26: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 26

• The last five subcomponents use the conventional methods...

DrawingSurfaceClip

NPC

ImplicitDisplayTransformation

DC

Map toDeviceCoordinates

PhysicallyRender:Rasterize

ApplyColor

DisplaySurface

Advanced RenderingRadiosity Methods -- Pipeline

Page 27: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 27

Standard radiosity methods...– ...provide a solution for diffuse surfaces to interact in a

closed environment– ...are well suited for diffuse reflectivity since a diffuse

surface's reflectivity is constant in all outgoing directions– modeled instead of specular (remember form factors!) ---

once specular light is modeled you MUST know the view!

– ...were expanded to incorporate ray tracing

Advanced RenderingRadiosity Methods -- summary

Page 28: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 28

Radiosity and ray tracing takes into account the interactions of light for...– ...diffuse to diffuse reflection,– ...diffuse to specular reflection,– ...specular to diffuse reflection, and– ...specular to specular reflection

Advanced RenderingRadiosity Methods -- summary

Page 29: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 29

Radiosity and ray tracing...– ...are combined as a two pass process: view

independent and view dependent (preprocessing and postprocessing steps)

Preprocessing...– ...first enhances the diffuse reflectivity and takes

into account the specular to diffuse reflection (however, this method does limit specular surfaces to perfect mirrors)

Advanced RenderingRadiosity Methods -- summary

Page 30: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 30

Preprocessing...– ...then it applies a standard radiosity method,

using the hemicube to determine the form factors

– ...only takes into account specular reflection enough to determine the impact on diffuse reflection

Advanced RenderingRadiosity Methods -- summary

Page 31: CS447/547 9- 1 Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.

CS447/547 9- 31

Postprocessing...– ...uses distributed ray tracing and takes into

account specular reflection and refraction as well as the viewpoint

– ...takes the diffuse intensities from the radiosity method and let's them contribute to the intensity of a pixel using linear interpolation

Advanced RenderingRadiosity Methods -- summary