You are on page 1of 21

Computer Graphics Theory

References
Shirley, P et al 2010 Chapter 4 Raytracing in
Fundamentals of Computer Graphics, A K
Peters, Massachusetts, USA.

Slater, M et al 2002 Computer Graphics and


Virtual Environments, Pearson Education,
USA.

Dorsey, J et al 2008 Image Sampling


Techniques in Digital Modeling of Material
Appearance, Morgan Kauffman,MA, USA
p248.
Department of Digital Animation
jmc academy
Rendering is the process Rendering
of unifying all algorythms
in a scene resulting in an
image.

The creation of the


image is ultimately about
converting an input of
objects in 3d space to a
2d image space of pixels.

Department of Digital Animation


jmc academy
Rendering can be generalised Rendering
into two general categories,
each relating to how an object is
converted to pixels.
(Shirley, 2010)

Object-Order Rendering.

Image-Based Rendering.

Department of Digital Animation


jmc academy
Raycasting is an early Image-Based Rendering
example of image-based
rendering.

This involves sending out “rays”


from a viewplane grid of pixels.
When a ray intersects with an
object it returns colour values.
This is repeated from the centre © kim edwards 2010

of each pixel.

Department of Digital Animation


jmc academy
Object-Order Rendering


“Object-Order rendering,
each object is considered
in turn, and for each
object all pixels that it
influences are found and
updated”.
(Shirley 2010)

Department of Digital Animation


jmc academy
Object-Order Rendering
Object-order rendering is also
referred to as rasterisation and
scanline rendering.

Object-Order rendering is
generally less computationally
expensive than image order
rendering.
3d packages combine both object-order
and image-based rendering, using object
based rendering whenever possible.

Object-Order rendering however is far more


complex to write and less flexible than
image-order rendering.

Department of Digital Animation


jmc academy
Image-Based Rendering
A ray is shot from the image
for each pixel to an object and
from the intersection point to the
light.
“The light arriving through each
pixel depends on the shape,
incident light and material of the
object visible through the pixel.”
(Dorsey, 2008).

© kim edwards 2010

Department of Digital Animation


jmc academy
Image-Based Rendering

Point A is lit whilst Point B is in


shadow.

In Maya having shadows off


is the same as ignoring any
intersections in the light ray view ray view ray

journey from the viewray


intersection to the light. light ray

light ray
shadow ray

A B
© kim edwards 2010

Department of Digital Animation


jmc academy
Image-Based Rendering

Image-based rendering
is not remarkably new in
concept.

Of course the artist &


subjects are replaced by
mathematical arguments.
Albrech Duhrer 1500’s.

Department of Digital Animation


jmc academy
A Centre Of Projection Image-Based Rendering: views.
and a View plane of
pixels.

Correct perspective
naturally follows this
system providing
geometric rules are
followed.

Perspective: a ray shot from Centre of Projection.

© kim edwards 2010

Department of Digital Animation


jmc academy
Image-Based Rendering

A Centre Of Projection
through a View plane
of pixels highlighting
distance-scale
relationship.

© kim edwards 2010 Centre of Projection: example of scale over distance.

Department of Digital Animation


jmc academy
Image-Based Rendering
Generation of
orthonographic and
oblique views.

A ray is shot from the


centre of each pixel in the
view plane.

Parralell Perspective or “orthonographic”: a ray shot from the centre of each pixel. © kim edwards 2010

Department of Digital Animation


jmc academy
Image-Based Rendering
A more detailed model for
a camera highlighting the
pyramidal view volume
that results.

(Slater 2002)

Department of Digital Animation


jmc academy
Aliasing is a common issue Aliasing.
caused by the discrete
sampling of a continuous
subject.

Aliasing “artefacts” are common


across computer graphics.

Many colours may be viewed


through a pixel. Or a curved line
will be insufficiently represented
by the density of pixels. It is
solved through a range of
mechanisms involving multiple
samples per pixel.
(Dorsey, 2008) Department of Digital Animation
jmc academy
Image-Based Rendering: raytracing.
Raytracing extends
raycasting to test for
reflection and refraction.
normal

Reflection casts another ray direction

at “mirrored” angle from COP


intersection point on the surfaces
normal. reflection

0 0
This ray will then continue until it
in turn hits other geometry. This
point is tested with light and so
forth.
© kim edwards 2010

Pure specular reflection

Department of Digital Animation


jmc academy
Image-Based Rendering: raytracing.
Raytracing extends
raycasting to test for
reflection and refraction.
IOR = 1 IOR = 1.53 n

Refraction changes the angle of


0 0

the ray before collecting a colour


value.

Indexes of Refraction are widely


available tables of refraction for a
variety of phennomena.
Air = 0 © kim edwards 2010

Glass = 1.53
Department of Digital Animation
jmc academy
Recursive Raytracing opaque
no specular
reflection

The addition of reflection and


refraction results in high degree light ray

light ray

of complexity.
reflection ray

Recursive raytracing describes reflection ray

A
the tree of possible ray’s casted light ray

with the addition of reflection and refraction ray

refraction.
light ray ignores IOR

opaque

A= specular
reflection

© kim edwards 2010

Consider this example:


2 reflective objects
1 reflective/transparent object
1 light Department of Digital Animation
Testing for colour on one point of an object. jmc academy
Recursive Raytracing opaque
no specular
reflection

Typically the number ray’s cast


light ray

light ray

can be adjusted by specifying a


maximum number of relection/ reflection ray

refraction rays cast in the tree. A


reflection ray

This is necessary to reduce the light ray

large number of calculations refraction ray

light ray ignores IOR

possible (consider two mirrors opaque

A= specular

facing each other).


reflection

© kim edwards 2010

This diagram also illustrates for refraction


that the lightray (shadow feeler) for the blue
object ignores the IOR of the intervening red
sphere in it’s calculation.
Department of Digital Animation
jmc academy
To summarise Rendering
Rendering can be categorised
into:
Object-Order Rendering.
eg.scanline
Image-Based Rendering.
eg.raytracing

Both convert a 3d scene into 2d


image space.
Both are used in conjunction in
animation software.
Kenneth A. Huff, Department of Digital Animation
jmc academy
2001
Rendering: Shading
So far we have considered the
view and light/shadow within an
image-order system.

We have also considered


reflection/refraction in isolation
with raytracing.

However the interaction of


light with surfaces and the
consequent appearance is
defined further through shading
models.
Department of Digital Animation
Kenneth A. Huff, jmc academy

2000

You might also like