# Overview and aims

By the end of the lecture you will be able to:

• Describe the role of lighting in 3D graphics
• Light a 3D Graphics scene
• Explain the role of materials and textures in 3D graphics
• Texture an object in a 3D tool like blender.
• Create a interactive textured and lit scene with in Processing

vs

## Surface Appearance

We can divide what we see of an object into two elements, gross shape and
surface appearance.

interacting with

interacting with

## Material

The appearance of an objects is created by light interacting with its
surface properties, called its material.

vs

Becomes:

vs

## Material

Shape and appearance are therefore dealt with by the geometry and material of
an object.

# Overview and aims

By the end of the lecture you will be able to:

• Describe the role of lighting in 3D graphics
• Light a 3D Graphics scene
• Explain the role of materials and textures in 3D graphics
• Texture an object in a 3D tool like blender.
• Create a interactive textured and lit scene with in Processing

Light comes from a light sources, bounces over objects and ends up in the
camera, creating an image.

In computer graphics we simulate this process, mostly by going backwards:
we work from the camera, work out which bit of an objects is casting light
on the camera, and then how the light affects it

This makes it easy to handle light that falls directly from a light source
onto an object but hard to handle light that bounces off other objects in
between (a lot of the light that illuminates real world scenes bounces off
walls etc. before hitting objects, if this did not happen then everything
would be very stark light and shadow, like early CG)

Point lights exist at a single position and give out light in all directions.
You can use them for modelling a lamp.
To create one you need to specify a colour and a position.

Directional lights, don’t have a position, they illuminate the entire scene,
but they only illuminate it in one direction (e.g. only from the top).
You can use them for modelling the sun or far away lighting.
To create one you need to specify a colour and a direction.

Spot lights are similar to real world spot lights. They are at a specific
position and give out light in a cone pointing at a specific direction.
The light is strongest at the centre of the cone and falls of towards the edge.
To create one you need to specify a colour and both a position and direction.
You also need an angle which determines how big the cone is and a concentration
parameter which controls how much the light is concentrated in the middle and
falls off towards the edge.

In Computer Graphics light only bounces directly off objects from the
light source. This creates very stark light and shadow. In the real world a
lot of light bounces off walls and other objects before falling on the object,
creating a more generalized light. One way of simulating this is to have an
ambient light. Light that just illuminates everything from all directions.
A bit of a hack.

```lights(); ambientLight(); directionalLight(); pointLight(); spotLight();```

The processing command `lights()` creates the default lighting setup.
There are also commands that give you more detailed control, by creating ambient,
directional, point and spot lights.

All of these commands need to be called in the draw method before
drawing any geometry

Look them up in the Processing references

## Global Illumination

As I’ve mentioned, ambient light simulates light boucing off other objects, but
it is really just a hack and doesn’t do a proper simulatation. A number of
methods attempt to properly simulate light bouncing off other objects (called
global illumination).

## High Dynamic Range

Monitors, cameras and the standard 24 bit colour representation cannot represent the full
range of lighting intensity that is visible to the human eye. Recently methods
have been developed to represent this full range called high dynamic range lighting.

# Overview and aims

By the end of the lecture you will be able to:

• Describe the role of lighting in 3D graphics
• Light a 3D Graphics scene
• Explain the role of materials and textures in 3D graphics
• Texture an object in a 3D tool like blender.
• Create a interactive textured and lit scene with in Processing

## Materials

Materials are the surface properties which determine how light interacts
with the surface.

## Colour

The most basic material is the colour of the surface.

## Texture

More complex materials can be achieved by applying an image to a surface,
a process called texturing.

# Types of Colour material

There are different colour materials which determine how different types
of lighting affect the surface

## Ambient Colour

Ambient materials control how the surface responds to ambient light.

## Diffuse Colour

Diffuse Colour controls how it responds to normal, diffuse lighting.

## Specular Colour

Specular colour determines the colour of direct reflections (highlights).

The relationship between diffuse and specular colour will determine whether
the surface appears shiney (lots of specular) or matte (no specular).

# Overview and aims

By the end of the lecture you will be able to:

• Describe the role of lighting in 3D graphics
• Light a 3D Graphics scene
• Explain the role of materials and textures in 3D graphics
• Texture an object in a 3D tool like blender.
• Create a interactive textured and lit scene with in Processing

## Texture Mapping

Texture mapping consists in applying an image to the surface of a 3D model
so that the colours in the image become the materials of the object.

It can allow you to create visual complex object without having to have very
detailed geometry, therefore making rendering more efficient.

Using photographs as the images for texture mapping allows you to have
highly realistic scenes.

When you texture map an object each pixel in the texture is mapped
onto a particular point on the polygons of your object.

The question is, how do you know which point goes where?

When you texture map an object each pixel in the texture is mapped
onto a particular point on the polygons of your object.

The question is, how do you know which point goes where?

We introduce a new set of coordinates, called texture coordinates or
UV coordinates. U and V are the coordinates of points on the image.
Each vertex has an x,y,z coordinate in space and a u,v coordinate for
its position in the image.

Most modelling software, including blender, allows you to produce a uv-unwrap.
This is an image created from a 3D mesh, with a section designed to map to each
polygon. You can then load the image into photoshop and edit it so there is
content for each polygon.

# Overview and aims

By the end of the lecture you will be able to:

• Describe the role of lighting in 3D graphics
• Light a 3D Graphics scene
• Explain the role of materials and textures in 3D graphics
• Texture an object in a 3D tool like blender.
• Create a interactive textured and lit scene with in Processing
Send article as PDF to