42
SE 313 – Computer Graphics Lecture 12: Lighting and Materials Lecturer: Gazihan Alankuş 1

SE 313 – Computer Graphics

  • Upload
    iman

  • View
    34

  • Download
    0

Embed Size (px)

DESCRIPTION

SE 313 – Computer Graphics. Lecture 12: Lighting and Materials Lecturer: Gazihan Alankuş. Projects. Weekly reports Video Sources Final demo. Projects. Weekly reports Help me understand your own contribution Video Sources Final demo. Projects. Weekly reports Video - PowerPoint PPT Presentation

Citation preview

Page 1: SE 313 – Computer Graphics

1

SE 313 – Computer Graphics

Lecture 12: Lighting and MaterialsLecturer: Gazihan Alankuş

Page 2: SE 313 – Computer Graphics

2

Projects• Weekly reports• Video• Sources• Final demo

Page 3: SE 313 – Computer Graphics

3

Projects• Weekly reports– Help me understand your own contribution

• Video• Sources• Final demo

Page 4: SE 313 – Computer Graphics

4

Projects• Weekly reports• Video

– Prepare a video that demonstrates your project– Example: https://www.youtube.com/watch?v=auurLcPFGrs&list=PL0E431E2DD85623D5&index=6

– Should include:• A title scene with your names, IEU, SE 313, my name• Project description and demonstration• Between 2-5 minutes

– Upload to YouTube with this text(text in [brackets] are optional):• Term project for SE 313 Computer Graphics in İzmir University of economics.

[your names (optional)] İzmir Ekonomi Üniversitesi SE 313 Bilgisayar Grafiği dönem projesi. [your names (optional)]

• Sources• Final demo

Page 5: SE 313 – Computer Graphics

5

Projects• Weekly reports• Video• Sources

– Give me all your source files– Include a README file on how to use them

• Step-by-step instructions• Versions of software that you used• External factors

– If you had external help (downloaded models and textures, help you received from someone else, etc.), clearly write them.

– Was this a project that was a joint project with some other class? If so, write it down. – If you don’t do these, you claim that it was all your work and was for this class only. If I

prove that it wasn’t, you have cheated and will be punished according to university rules.

• Final demo

Page 6: SE 313 – Computer Graphics

6

Projects• Weekly reports• Video• Sources• Final demo– Set up a half-hour meeting with me– The last day for the meeting is 18th of January• My available times may be filled before that. Be quick

and try to find a time. – Send everything (video, sources, etc.) me 24 hours

before that

Page 7: SE 313 – Computer Graphics

7

Lighting and Materials• Lighting– Real-time (local illumination)– Better (global illumination)

• Materials and surface detail– Normals– Materials

Page 8: SE 313 – Computer Graphics

8

Lighting and Materials• Lighting– Real-time (local illumination)– Better (global illumination)

• Materials and surface detail– Normals– Materials

Page 9: SE 313 – Computer Graphics

9

Lighting• Projecting 3D geometry into 2D is not enough.

Projecting the edges

only

Projecting the faces

Copying the object’s colors in the 2D projection does not look good

Page 10: SE 313 – Computer Graphics

10

Lighting• We see objects through light bouncing from them

• We see different tones according to the way light bounces

• Computers need to simulate this to create realistic pictures

Page 11: SE 313 – Computer Graphics

11

Lighting

• Simulating light is very difficult. There can be infinite number of rays coming from a light source. We need something fast!

Page 12: SE 313 – Computer Graphics

12

• Observation: if the light can bounce directly from the light source to the eye, the surface looks lighter

Lighting

Page 13: SE 313 – Computer Graphics

13

• Observation: if the light cannot bounce directly, then the face looks darker

• We use these observations to simulate lighting• We use the normal vector to determine the

orientation of the face

Lighting

Page 14: SE 313 – Computer Graphics

14

Two types of lighting

• Diffuse reflection– We see darker color

even if light does not bounce directly to the eye

• Specular reflection– We only see color when

light bounces directly to the eye

Page 15: SE 313 – Computer Graphics

15

Ambient lighting• There is so much light that comes from the

sun, light bounces from everything in the environment

• Even if you are in a closed room in daytime, there is light in the environment

Page 16: SE 313 – Computer Graphics

16

The three types of lighting

Page 17: SE 313 – Computer Graphics

17

Emission

• Emission is the fourth type of lighting

• Simulates objects that emit light by themselves (if it’s a lamp, for example)

Page 18: SE 313 – Computer Graphics

18

Different colors for different lighting

Page 19: SE 313 – Computer Graphics

19

Simulating lighting in real time• These four types of light calculations

(ambient, diffuse, specular, emission) help us simulate lighting in computers in real-time.

• This way we can have video games that look real and react instantly

Page 20: SE 313 – Computer Graphics

20

Lighting and Materials• Lighting– Real-time (local illumination)– Better (global illumination)

• Materials and surface detail– Normals– Materials

Page 21: SE 313 – Computer Graphics

21

Global Illumination• Simulating light locally is an approximation.

Light bouncing from nearby objects is ignored.• There are algorithms to simulate light better.

Page 22: SE 313 – Computer Graphics

22

Radiosity

• Relationships between faces of polygons are computed to see whether they would illuminate or shade each other

• Slower than local illumination, better results

Page 23: SE 313 – Computer Graphics

23

Ray tracing

• Light is reversible• Rather than simulating the

actual lights, trace light rays that would come to the eye

• Start from the eye and see whether you reach a light source after bouncing on objects

• Slower than radiosity. Very real-looking results.

Page 24: SE 313 – Computer Graphics

24

How they are used in practice

Local Illumination• Real-time applications• Video Games • The image does not have to

be very realistic• Renders very quickly• What you see in Blender 3D

view

Global Illumination• Batch applications• Movies• The image has to look very

real• Renders slowly

– Render farms with many supercomputers are used for long movies

• What you see in Blender Render view

Page 25: SE 313 – Computer Graphics

25

Lighting and Materials• Lighting– Real-time (local illumination)– Better (global illumination)

• Materials and surface detail– Normals– Materials

Page 26: SE 313 – Computer Graphics

26

Normals

• Surface normals determine the color tones that the surface will have because of lights

Page 27: SE 313 – Computer Graphics

27

Normal Mapping

• Surface normals determine the color tones that the surface will have because of lights

• Surfaces with such detail requires too much geometric detail and renders slowly.

• We fake it by using normals from a detailed model on a non-detailed model

Page 28: SE 313 – Computer Graphics

28

Normal Mapping• With normal mapping, you can have a mesh

with less detail that looks like another mesh with more detail

Page 29: SE 313 – Computer Graphics

29

Lighting and Materials• Lighting– Real-time (local illumination)– Better (global illumination)

• Materials and surface detail– Normals– Materials

Page 30: SE 313 – Computer Graphics

30

Materials• Things that determine the color of a surface– Properties of lights– Properties of surfaces

Page 31: SE 313 – Computer Graphics

31

Materials• Things that determine the color of a surface– Properties of lights• Position• Colors and intensities for ambient, diffuse, specular

components– Properties of surfaces• Normals• Colors for how ambient, diffuse and specular

components will be reflected• Emission

Page 32: SE 313 – Computer Graphics

32

Materials• Matching properties of the light and the

surface are multiplied together

Diffuse color of the light

Diffuse color of the material

Visible diffuse color on the

surface

LR

LG

LB

MR

MG

MB

SR

SG

SB

Red light(1, 0, 0)

White material(1, 1, 1)

Red surface(1, 0, 0)

Page 33: SE 313 – Computer Graphics

33

Next week• We will practice these in Blender next week• Now we will have a lab that you will be graded

in

Page 34: SE 313 – Computer Graphics

34

Lab• Modeling• Texturing

Page 35: SE 313 – Computer Graphics

35

Lab: Modeling• Starting from a cube,

model this table.

Page 36: SE 313 – Computer Graphics

36

Lab: Modeling• Model the legs by

subdividing the bottom face, extrude individually, scale, translate, extrude

• Model the book on the table by creating the rectangle by cutting the edges one by one using the knife tool. Then, extrude it up.

Page 37: SE 313 – Computer Graphics

37

Lab: Modeling• Model the drawer using

extrude.

• After taking the drawer out, extrude inwards to create the inside of the drawer.

Page 38: SE 313 – Computer Graphics

38

Lab: Texturing• Open the redwood

texture in the main uv mapping so that the whole model has the redwood texture.

Page 39: SE 313 – Computer Graphics

39

Lab: Texturing• Map the book cover on

the book cover on top of the table.

• Create a separate UV map for the book and name it “book”

• Map the book image in that UVMap

• Using the clone brush, copy that to the main texture

Page 40: SE 313 – Computer Graphics

40

Lab: Texturing• Create a separate UV

map for the inside of the drawer and name it “drawer”.

• Map the junk in it

Page 41: SE 313 – Computer Graphics

41

Lab: Texturing• Use the clone brush to

paint into the main UV map from the drawer UV map

• Leave some empty places to give a dirty look.

Page 42: SE 313 – Computer Graphics

42

Lab: Bonus

• Bonus1: Use other wood textures to give a more detailed view to the table

• Bonus2: create other geometry on top of the table and texture them with images you find on the internet