1 / 20

Modelo de iluminación “simple”

Propiedades del cuerpo. Kr, Kg, Kb Ks, q. Surface. Modelo de iluminación “simple”. R = I a .Kr + Σ I i .((1-Ks).Kr. L i .n + Ks. ( V.r i ) q ) G = I a .Kg + Σ I i .((1-Ks).Kg. L i .n + Ks. ( V.r i ) q ) B = I a .Kb + Σ I i .((1-Ks).Kb. L i .n + Ks. ( V.r i ) q ). L. r. n.

adamdaniel
Download Presentation

Modelo de iluminación “simple”

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Propiedades del cuerpo Kr, Kg, Kb Ks, q Surface Modelo de iluminación “simple” R = Ia.Kr + ΣIi.((1-Ks).Kr. Li.n + Ks. (V.ri)q) G = Ia.Kg + Σ Ii.((1-Ks).Kg. Li.n + Ks. (V.ri)q) B = Ia.Kb + Σ Ii.((1-Ks).Kb. Li.n + Ks. (V.ri)q) L r n V

  2. Z buffer • Ademas del frame buffer (R, G, B) • Almacenar la distancia a la cámara (z-buffer) • Pixel es pintado solo si el nuevo z es más alto que el valor en el z-buffer value

  3. n1 , n2 , n3 Ir1 , Ig1 , Ib1 Ir2 , Ig2 , Ib2 Ir3 , Ig3 , Ib3 3 A1 A2 Irpixel= (Ir1.A1+Ir2.A2+Ir3.A3)/A A3 2 1 Gourard shading

  4. Gourard shading Flat shading Modelo de iluminación simple

  5. Que falta tener en cuenta? • Sombras • Transparencias • Reflexiones • Refracciones • Fuentes no puntuales • Iluminación proveniente de otros objetos

  6. Ray Casting For every pixel Construct a ray from the eye For every object in the scene Find intersection with the ray Keep if closest

  7. Ray Casting • Complexity? • O(n * m) • n = number of objects, • m = number of pixels For every pixel Construct a ray from the eye For every object in the scene Find intersection with the ray Keep if closest Shade depending on light and normal vector

  8. Ray Tracing • Secondary rays (shadows, reflection, refraction) reflection refraction

  9. Sombras

  10. Povray www.povray.org

  11. Ray Tracing Povray

  12. Radiosity

  13. Radiosity Estrategias posibles • Radiosity • Independiente de donde miro la escena • Computar la matriz de Radiosity y resolver el sistema de ecuaciones • Monte-Carlo Ray-tracing • Enviar toneladas de rayos indirectos

  14. Discrete Radiosity Equation Discretize the scene into n patches, over which the radiosity is constant reflectivity n A å = + r B E F B j i i i ij j j=1 form factor • discrete representation • iterative solution • costly geometric/visibility calculations A i

  15. Calculating the Form Factor Fij • Fij = fraction of light energy leaving patch j that arrives at patch i • Takes account of both: • geometry (size, orientation & position) • visibility (are there any occluders?) patch j patch j patch j patch i patch i patch i

  16. patch j j r i cos i cos j 1 Fij = ∫ ∫ Vij dAj dAi πr2 Ai patch i Ai Aj Calculating the Form Factor Fij • Fij = fraction of light energy leaving patch j that arrives at patch i

  17. Stages in a Radiosity Solution Why so costly? Input Geometry Form FactorCalculation > 90% Calculation & storage of n2 form factors Reflectance Properties Solve theRadiosity Matrix < 10% Radiosity Solution Camera Position & Orientation Visualization(Rendering) ~ 0% Radiosity Image

  18. A j A i Form Factor from Ray Casting • Cast n rays between the two patches • n is typically between 4 and 32 • Compute visibility • Integrate the point-to-point form factor • Permits the computation of the patch-to-patch form factor, as opposed to point-to-patch

More Related