photorealism
play

Photorealism Steve Ash, Rhodes College 2006 Photorealism The goal - PowerPoint PPT Presentation

Photorealism Steve Ash, Rhodes College 2006 Photorealism The goal is to model the interaction between light source and surface materials ambient light diffuse reflection specular reflection transparency Photorealism The goal is to model the


  1. Photorealism Steve Ash, Rhodes College 2006

  2. Photorealism The goal is to model the interaction between light source and surface materials ambient light diffuse reflection specular reflection transparency

  3. Photorealism The goal is to model the interaction between light source and surface materials ambient light diffuse reflection point -light illuminating the object scattered light illuminating the object light is reflected equally in all directions (the light source has no direction)

  4. Photorealism The goal is to model the interaction between light source and surface materials specular reflection transparent interaction between light and a highly interaction between light and a highly transparent surface reflective (shiny) surface

  5. (lx,ly,lz) Algorithm (x,y,0) For each pixel P in the canvas: shoot a ray V from the eye E to P (ex,ey,ez) find intersection point Q with object find color of object at Q which depends on: L * object material and light source properties N set pixel P to computed color V

  6. Light and Materials Light sources will be modeled by their intensity I = ( R, G, B ) and position P = ( X, Y, Z ) no position for ambient light, just intensity Material properties of objects will be modeled by O = ( R, G, B ) coeff. of reflection e.g. high R coefficient will imply material that appears more Red The color, I , observed on the object will be the sum total of the interactions of all light sources and the material properties of the object I = Ambient + Diffuse + Specular + Transparent

  7. Light and Materials Point light sources modeled by their intensity I p = ( R, G, B ) and position P = ( X, Y, Z ) no position for ambient light, just intensity I a Intrinsic color of the object specified by O = ( R, G, B ) Material properties of objects modeled by various coefficients of reflection k a – ambient coefficient k d – diffuse coefficient k s – specular coefficient n – specular highlight k t – transparency coefficient η – index of refraction The intensity observed on the object will be the sum total of the interactions of all light sources and the color and material properties of the object I = Ambient + Diffuse + Specular + Transparent

  8. Ambient Component To model the ambient intensity determine how much ambient light is reflected Ambient = k a I a O a This is done for each color channel λ = ( R, G, B ) Ambient λ = k a I aλ O λ Ambient R = k a I aR O R Ambient G = k a I aG O G Ambient B = k a I aB O B

  9. Diffuse Component Diffuse describes matte surfaces light is reflected equally in all directions amount of reflected light depends on amount of surface area hit independent of viewer pos smaller area hit, so more intensity per unit area, but viewer sees less larger area hit, so viewer sees more, but less intensity per unit area

  10. Diffuse Component Diffuse describes matte surfaces light is reflected equally in all directions amount of reflected light depends on amount of surface area hit I total I total I total = A 1 I Δ1 = A 2 I Δ2 A 2 A 1 smaller area hit, so more intensity larger area hit, so viewer sees more per unit area, but viewer sees less but less intensity per unit area The effect cancels out – see more, but less intense, or see less but more intense diffuse component proportional to cos θ between light and surface normal N θ Diffuse λ = k d I pλ O λ cos θ = k d I pλ O λ ( N • L ) L

  11. Specular Component The specular highlight is a region of high intensity moves along the surface depending on viewer position highly concentrated – falls off quickly with viewing angle

  12. Specular Component The specular highlight is a region of high intensity moves along the surface depending on viewer position highly concentrated – falls off quickly with viewing angle Phong model for specular reflection specular highlight depends on angle between reflect ray R and the gaze V L R L R V N N α V α θ θ θ θ same ray in each case left viewer will see less reflection right viewer will see less reflection since reflected ray diverges more since closer to reflected ray

  13. Specular Component The specular highlight is a region of high intensity moves along the surface depending on viewer position highly concentrated – falls off quickly with viewing angle Phong model for specular reflection specular highlight depends on angle between reflect ray R and the gaze V L L N N R V R V highest perceived intensity when R = V varies with viewer position

  14. Specular Component The specular highlight is a region of high intensity moves along the surface depending on viewer position highly concentrated – falls off quickly with viewing angle Phong model for specular reflection specular highlight depends on angle between reflect ray R and the gaze V L R Specular λ = k s I pλ O λ cos n α N V α θ θ = k s I pλ O λ ( R • V ) n n – specular reflection exponent high n, more focused (smaller) highlight

  15. Specular Component Calculating R, assuming L, N unit N L R θ θ

  16. Specular Component Calculating R, assuming L, N unit N L R θ θ Shrink N to level L, N', R L R N' S S θ θ N' = N * ( |L| * cos θ ) = N * cos θ

  17. Specular Component Calculating R, assuming L, N unit We have N R = N’ + S L R S = N’ – L θ θ Shrink N to level L, N', R L R N' S S θ θ N' = N * ( |L| * cos θ ) = N * cos θ

  18. Specular Component Calculating R, assuming L, N unit We have N R = N’ + S L R S = N’ – L θ θ Therefore R = N’ + S = N' + (N' - L) = 2N' – L Shrink N to level L, N', R = 2N cos θ – L L R N' S S R = 2N ( N • L ) – L θ θ N' = N * ( |L| * cos θ ) = N * cos θ

  19. Specular Component Calculating R, assuming L, N unit We have N R = N’ + S L R S = N’ – L θ θ Therefore R = N’ + S = N' + (N' - L) = 2N' – L Shrink N to level L, N', R = 2N cos θ – L L R N' S S R = 2N ( N • L ) – L θ θ Now can compute Specular λ = k s I pλ O λ ( R • V ) n N' = N * ( |L| * cos θ ) = N * cos θ

  20. Summary The color, I , observed on the object will be the sum total of the interactions of all light sources and the material properties of the object I = Ambient + Diffuse + Specular + Transparent I λ = k a I aλ O λ + k d I pλ O λ ( N • L ) + k s I pλ O λ ( R • V ) n + Transparent I a – the intensity of the ambient light I p – the intensity of the point light source only if N • L > 0 O – the intrinsic color of the object k a , k d , k s – ambient, diffuse, specular coefficients this is done for each color channel λ = (R, G, B)

  21. (lx,ly,lz) Algorithm (x,y,0) For each pixel P in the canvas: shoot a ray V from the eye E to P (ex,ey,ez) find intersection point Q with object find surface normal N at intersection point Q L N find the directions (unit vectors): L (Q to light) X R (reflected ray L) R V V (Q to eye) only if N • L > 0 I total = Ambient + Diffuse + Specular set pixel P to I total

  22. Ray-Sphere Intersection Sphere equation (x – c x ) 2 + (y – c y ) 2 + (z – c z ) 2 - R 2 = 0 Ray equation p = source + t*direction p x = s x + t*d x p y = s y + t*d y p z = s z + t*d z Common point (p x – c x ) 2 + (p y – c y ) 2 + (p z – c z ) 2 - R 2 = 0 (s x + t*d x – c x ) 2 + (s y + t*d y – c y ) 2 + (s z + t*d z – c z ) 2 - R 2 = 0 t = ? could have 0, 1, or 2 solutions which one should we pick

  23. Sphere Surface Normal N ray P C N is of unit length and has the same direction as CP

  24. Scene Specification camera { location <0, 0, 80> 300 -- #rays per row/column of the screen screen_size 60 density 300 } (-100,125,150) (0,0,80) light_ambient { rgb <0.2, 0.1, 0.1> } 60 (10,0,-20) light_source { 60 <-100, 125, 150>, rgb <1.0, 1.0, 1.0> } sphere { <10, 0, -20>, 35 color { rgb <0.0, 1.0, 0.0> } finish { ambient 0.2 diffuse 0.4 specular 0.8 phong_size 90 transparent 0.9 index 1.33 } } image source: http://en.wikipedia.org/wiki/File:Ray_trace_diagram.svg

  25. Scene Specification camera { camera { location <0, 0, 80> location <0, 0, 80> screen_size 60 screen_size 60 density 300 density 40 } } ∆w = fit 300 into 60 ∆w = fit 40 into 60 +30 +30 -30 +30 -30 +30 -30 -30 windows is 60x60 but 40 rays window is 60x60 but 300 rays so we need 300 x 300 Canvas so we need 40 x 40 Canvas window (-30,+30) is (0,0) in canvas window (-30,+30) is (00) in canvas window (+30,-30) is (300,300) in canvas window (+30,-30) is (40,40) in canvas

  26. Single Object Multiple Light Sources For each pixel P in the image: shoot a ray from the eye E to P find intersection point Q with object find surface normal N at intersection point Q for each light source S: find the directions: L (Q to S) X R (reflected ray L) V (Q to eye) compute intensity for S: only if N • L > 0 I S = Diffuse + Specular I total = Ambient + Sum I S (all visible light sources) set pixel (x, y) to I total

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend