phong and blinn phong
TRANSCRIPT
![Page 1: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/1.jpg)
Lighting
![Page 2: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/2.jpg)
Agenda
• Modelos de iluminación
• Phong
• Blinn-Phong
• Implementation
• Multiples luces
• Deferred rendering
• Tiled Based rendering
![Page 3: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/3.jpg)
Modelos de iluminación
• Phong
• Blinn-Phong
• Lambert
• Oren Nayar
• Cook-Torrance
• Minnaert
![Page 4: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/4.jpg)
Phong
![Page 5: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/5.jpg)
Phong
![Page 6: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/6.jpg)
Specular Power
![Page 7: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/7.jpg)
Blinn-Phong
![Page 8: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/8.jpg)
Blinn-Phong
![Page 9: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/9.jpg)
Diferencia entre modelos
![Page 10: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/10.jpg)
Detalles de ImplementaciónPhong Blinn-Phong Approximate curve 4.0 4.2
![Page 11: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/11.jpg)
ResultadoPhong Normal Blinn-Phong Blinn-Phong With 4.2
![Page 12: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/12.jpg)
Problemas comunes
• WorldInverseTranspose
• Normales no normalizadas
• Directions no normalizadas
• LightColor no normalizadas
![Page 13: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/13.jpg)
WorldInverseTranspose
![Page 14: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/14.jpg)
Normales no normalizadas
![Page 15: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/15.jpg)
Direcciones no normalizadas
![Page 16: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/16.jpg)
LightColor no normalizadas
![Page 17: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/17.jpg)
Multiples luces
• Bucle en el que se recorren todas las luces y se acumula el resultado.
![Page 18: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/18.jpg)
Multiples luces
• Realizar varias pasadas acumulando el resultado mediante Additive.
![Page 19: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/19.jpg)
Multiples luces
• Cálculo de nuevas luces que acumulan al resto.
• Varios shaders para 1, 2, 3 y 4 luces.
• Problema con las transiciones entre luces.
![Page 20: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/20.jpg)
Deferred Rendering
• For each light
– For each object
• Añadir la contribución de luz al framebuffer
• Shader por tipo de material y por tipo de luz
• Perdida de ciclos de Shaders
– Superficies invisibles / Overdraw
– Triángulos fuera de la influencia de la luz.
– Perdida de tiempo
• Full VertexBuffer, Texture Filtering
![Page 21: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/21.jpg)
Deferred Rendering
• For each object
– Almacenar sus propiedades en el G-Buffer
• For each light and lit pixels
– Usar el G-Buffer para calcular la iluminación
– Añadir el resultado al framebuffer
• Número constante de pixeles (Screen Spaces)
• No contempla objetos transparentes.
![Page 22: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/22.jpg)
Deferred Rendering
RenderTarget 0 (SurfaceFormat.Color)
Color.R Color.G Color.B Specular Intensity
RenderTarget 1 (SurfaceFormat.Color)
Normal.X Normal.Y Normal.Z Specular Power
RenderTarget 2 (SurfaceFormat.Single)
Depth 32bit
![Page 23: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/23.jpg)
Deferred Rendering
![Page 24: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/24.jpg)
Tile-based Deferred Shading
• Dividir la pantalla en tiles y determinar que luces afectan a cada tile.
• Se utiliza suele utilizar DirectCompute.
![Page 25: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/25.jpg)
Tile-based Deferred Shading
![Page 26: Phong and Blinn Phong](https://reader034.vdocuments.site/reader034/viewer/2022042716/55a9787e1a28ab710e8b46da/html5/thumbnails/26.jpg)
Thank you so much
Javier Cantón Ferrero