1 / 23

Status – Week 277

Status – Week 277. Victor Moya. Lightning. Diffuse Lightning. Light Sources. Specular Lightning. Emission. Gouraud Shading. Phong Shading. Bump Mapping. OpenGL Lightning. Light Sources. Ambient Light. Directional Light Sources Infinite light source (parallel rays). No attenuation.

lance-weiss
Télécharger la présentation

Status – Week 277

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. Status – Week 277 Victor Moya

  2. Lightning • Diffuse Lightning. • Light Sources. • Specular Lightning. • Emission. • Gouraud Shading. • Phong Shading. • Bump Mapping. • OpenGL Lightning.

  3. Light Sources • Ambient Light. • Directional Light Sources • Infinite light source (parallel rays). • No attenuation. • Point Light Sources. • All directions. • Attenuation. • Spot Light Sources. • Cone of light. • Attenuation. Kc, Kl and Kq are constant, linear and quadratic attenuation values. U: Direction of the spot light. L: Unit direction vector from surface point to light spot.

  4. Diffuse Lighting A: Ambient light T: Texture sample. D: Surface diffuse reflection color. Ci: Intensity of the i light at the surface point. N: Normal vector of the surface. Li: Unit direction vector to the light source I.

  5. Specular Lighting S: Surface specular color. Ci: Intensity of the incident light. m: specular exponent (larger, sharper hightlight). G: Gloss map sample. N: Normal vector at the surface. L: Unit direction to light vector. Hi: Halfway vector (V + L). V: Unit direction to viewer vector.

  6. Emission Kemission = EM E: Surface emission color. M: Emission map sample.

  7. Gouraud Shading • Lighting is calculated at each vertex and interpolated across the triangle. K = Kprimary * T1 * T2 * ... * Tk + Ksecondary Ti : Color samples for one of k texture maps. * : One of several available texture combination operations

  8. Phong Shading • Interpolate vertex normals and evaluates the lighting formula at each pixel. K = Kemission + Kdiffuse + Kspecular • Problem: interpolation of normals produce non unit vectors. Use normalization cube maps.

  9. Flat, Gouraud and Phong Shading

  10. Bump Mapping • A hardware implementation of Phong Shading. • Uses a texture map to perturb the normal vector at each pixel (not interpolated). • Bump Map: 2D arrays of 3D vectors. Direction of the normal vector relative to the interpolated normal vector at the pixel. • Uses tangent space for storing the perturbations. Object to tanget space transformation (3x3 matrix multiplication).

  11. Bump Mapping

  12. OpenGL Lighting • Calculated at vertex, interpolated inside the triangle (Gouraud). • Bump mapping supported by propietary extensions. • Pixel Shaders for programmable per pixel lighting.

  13. OpenGL Lighting

  14. OpenGL Lighting

  15. OpenGL Lighting

  16. Hardware Pipeline • Command Processor. • Vertex Shader. • Rasterization. • Pixel Shader. • Fragment Operations and Tests.

  17. Command Processor • Recieves commands from the CPU (driver, OpenGL/Direct3D). • Fetches data from memory: vertex data (DMA). • Updates and stores OpenGL/Direct3D render state.

  18. Vertex Shader • Transforms and lits vertex streams. • Vertex shader program (from GPU memory?). • Vertex shader constans (from GPU memory?). • Inputs: vertex data 16x4D • Outputs: vertex data 14x4D

  19. Rasterization • Includes: • Clipping • Divide by w • Affine transform • Primitive assembly • Culling • Setup • Fragment generation. • Recieves vertexs and produces fragments. • Uses OpenGL/Direct3D render state. • Input: vertex (15x4D). • Output: fragments (10x4D).

  20. Pixel Shader • Shades fragments: calculate texture address, read texture, color operations. • Pixel Shader program and constants (from GPU memory?). • Texture read: TMU (texture sample, filter unit, texture cache, GPU memory). • Optional: • Modify depth coordinate (1 Z output). • Render to texture (up to 4 colors outputs). • Input: fragment (12x4D). • Output: color (2x4D).

  21. Fragment Operations and Tests • Includes (OpenGL): • Fog. • Color Sum. • Ownership Test. • Scissor Test. • Alpha Test. • Stencil Test. • Depth Test. • Blend. • Logic Operation. • Accesses framebuffer (GPU memory). Updates framebuffer. • Framebuffer: color, Z and stencil. • OpenGL/Direct3D render state defines operations. • Input: color. • Output: FB updated.

  22. Others • Antialiasing • Anisotropic Filtering (textures). • Line Antialiasing. • Edge Antialiasing • Full Screen Antialiasing (FSAA): • Supersampling. • MultiSampling. • TBDR: Tile Based Deferred Rendering (STMicro PowerVR). • HOS (High Order Surfaces): N-Patches, Bezier, Displacement Mapping, TruForm, Tesselation.

More Related