Photorealistic Rendering vs' Interactive 3D Graphics - PowerPoint PPT Presentation

About This Presentation
Title:

Photorealistic Rendering vs' Interactive 3D Graphics

Description:

How Do You Draw a Picture (Without a Computer)? What is your subject? Viewing Parameters: ... Spawn reflected and refracted rays. Display (Output) Module ... – PowerPoint PPT presentation

Number of Views:51
Avg rating:3.0/5.0
Slides: 34
Provided by: gary292
Category:

less

Transcript and Presenter's Notes

Title: Photorealistic Rendering vs' Interactive 3D Graphics


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 dont 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
(No Transcript)
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 Watts book if youre
    not familiar with it.

9
But They Dont Look Real.
  • Most things are not flat or simple geometry like
    spheres andcones.
  • 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
  • Theyre 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
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 Pharrs 1.2
  • More detail in Watts 10.3.1 (pp.284-286) and
    12.2-12.4 (pp.342-354)

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)2r2
  • Ray (x,y,z)(x1,y1,z1)t(xd,yd,zd)
  • Find t that satisfy
  • (x-x0)2(y-y0)2(z-z0)2r2
  • 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
  • Snells 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 October 8.
  • Camera module
  • Object module (sphere only)
  • No recursive ray tracing
  • Simple output (in text mode)
  • The rest (Part B) are due October 22.

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 October 8
  • Camera module
  • Object 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 October 22
  • Object 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.
Write a Comment
User Comments (0)
About PowerShow.com