Presentation is loading. Please wait.

Presentation is loading. Please wait.

Photorealistic Rendering vs. Interactive 3D Graphics

Similar presentations


Presentation on theme: "Photorealistic Rendering vs. Interactive 3D Graphics"— Presentation transcript:

1 Photorealistic Rendering vs. Interactive 3D Graphics
(An Introduction to Digital Image Synthesis)

2 Short Film Festival I will show a short film at the beginning of each class, so don’t be late!

3 How Do You Draw a Picture (Without a Computer)?
What is your subject? Viewing Parameters: Camera, Picture Frames, Resolutions Many ways to specify it: eye, focus length, image plane eye, direction, FOV, up vector

4

5 3D to 2D Projection OK, so we can map a 3D point (or vertex) to 2D image. But what about a 3D surface? Polygons are made from points. Actually, we only need triangles!

6 Scan Conversion Also called rasterization.
The 3D to 2D Projection gives us 2D vertices (points). We need to fill in the interior.

7 Shading

8 An Overview of 3D Pipeline
The above can be implemented in hardware. Z Buffer to detect hidden surfaces. Other transformations not mentioned here: Modeling and Viewing. Browse Chapters 5 & 6 of Watt’s book if you’re not familiar with it.

9 “…But They Don’t Look Real.”
Most things are not flat or simple geometry like spheres and cones. We need correct surface colors and shapes (and more) 

10 We also need correct lighting.
Textures help, but not enough. Even simple things like CD can be challenging.   

11 Real-time Graphics They’re becoming darn good!

12 But… Some effects are hard to do in hardware, such as the caustics:

13 A Different View: Ray Tracing

14 Actually inverse ray tracing.

15 Writing a Very Simple Version
Ray Tracing Writing a Very Simple Version

16 What Makes a Good Picture?
Contents (3D models). Lighting. Reflection. Shadow. Surface textures.

17 Ray Tracing Algorithm An overview in Pharr’s 1.2
More detail in Watt’s (pp ) and (pp ) Transmitted Reflected

18 Creating a Ray Parameters:
Image Plane (position, size, and resolution) Viewpoint Which ray (x, y)?

19 Ray-Object Intersection
For example: sphere (x-x0)2+(y-y0)2+(z-z0)2=r2 Ray: (x,y,z)=(x1,y1,z1)+t(xd,yd,zd) Find t that satisfy Normal vector? Also easy for planes, cones, …etc.

20 Shading Models Pixel color = ambient + diffuse + specular + reflected + transmitted The weight of each is determined by the surface properties. We will discuss each of them within the next a few lectures.

21 Light Source & Shadow Point light is easy to implement, but does not look real. How to determine a surface point is in the shadow? In real world: area light with soft shadow.

22 Reflection and Refraction
Reflected ray is determined by: incoming ray and normal vector. Refracted ray is determined by: Incoming ray Normal vector And density Snell’s law: I sin i = t sin t i t

23 Recursive Algorithm The reflected ray and refracted ray are traced recursively. Termination condition: Depth of trace Weight (to the final pixel color) of ray

24 Advantage We get all the following automatically:
Hidden surface removal Shadow Reflection Transparency and refraction

25 Disadvantage Slow. Many rays are spawned.
Slow. Ray-object intersection for every ray and every object. (We will discuss how to avoid this in the next lecture). The lighting is still not completely right!

26 Assignment 1 – A Ray Tracer
Split into two parts. Part A due March 28. Camera module Object module (sphere only) No recursive ray tracing Simple output (in text mode) The rest (Part B) are due April 11.

27 Required Modules Camera Module Object Module
Ray Tracer Module (main program) Display (Output) Module

28 Camera Module Definition of eye position and image plane.
Generating a ray if given (x, y) Note that x and y may be real numbers (not integers).

29 Object Module Sphere type only (for now). Ray-object intersection.
Light. Read from files. Camera is sometimes defined in the object file for convenience.

30 Ray Tracer Module Integration of other modules. Shading.
Spawn reflected and refracted rays.

31 Display (Output) Module
Output to a text file for now. Example: output 0 if no intersection and 1 if intersecting an object. May create PPM, TIFF, or JPEG files later.

32 Part A due March 28 Camera module Object module Ray tracer module:
Read from a file Sphere and Light only Ray tracer module: No shading. No reflection and refraction. Display module (in text mode)

33 Part B due April 11 Object module Ray tracer module: Display module:
Add at least a plane type. Ray tracer module: Add shading, reflection, and refraction. Display module: PPM, TIFF, or JPEG library will be provided. Add a demo scene of your own.


Download ppt "Photorealistic Rendering vs. Interactive 3D Graphics"

Similar presentations


Ads by Google