1 / 14

Real Time Shaders

Real Time Shaders. CS 319 Advanced Topics in Computer Graphics John C. Hart. Real Time Shaders. Moore’s law: CPU power doubles every 18 months Advances in materials Advances in methods Advances in marketing Graphics version: GPU power doubles every 6 months

razi
Download Presentation

Real Time Shaders

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. Real Time Shaders CS 319 Advanced Topics in Computer Graphics John C. Hart

  2. Real Time Shaders • Moore’s law: CPU power doubles every 18 months • Advances in materials • Advances in methods • Advances in marketing • Graphics version: GPU power doubles every 6 months • Supports more sophisticated shading, though in unexpected ways (e.g. strange uses of the texture maps)

  3. AvailableTechnology • Texture Shading • Render shading expressionsusing texture mapping • Multipass • Combine shading components using image processing combinations • E.g. Render texture diffuse then render highlight • Multitexturing • Store multiple texture coordinates at each vertex • Textures are combined on the fly • Fragment lighting • Compute complex shading per pixel Slide #22 from Hanrahan’s “Real-Time Shading Languages”

  4. Texture Shading • Heidrich & Seidel, SIGGRAPH 99 • Implements shading models using texture maps • Disables hardware lighting • Evaluate shading expressions, store in texture coordinates • Precompute remaining expression in texture map

  5. Example: PhongTexture Shader • Express model as combination of colors C = kaCa + kd (NL) Cd + ks (VR)nCs • Plot vertices using texture coordinates • s = NL • t = VR • Precompute texture by evaluating • C(s,t) = kaCa + kdsCd + kstnCs • for 0 s,t 1 t = VR s = NL

  6. Example: Cook-Torrance c = VH and g2=h2+c2-1

  7. Example: Skin

  8. Hair

  9. Sampling • Problem • “Gouraud” interpolation of highlights • Interpolation of NL and VR which are proportional or power-proportional to intensity • Solution • Interpolate vectors instead • How?

  10. EnvironmentMaps • Spheremap • reflection into hemisphere • Singular at silhouette • Biased samples • Cubemap • projection onto cube faces • Awkward to store

  11. Radiance v. Irradiance Maps • Environment map • Panoramic picture of surroundings • Radiance map • Reflectance equation • Environment map is an irradiance map Li(wi) • Radiance map Lr(wr) computed by integrating BRDF with irradiance

  12. PhongRadiance Map • Spheremap is reflection of scene on sphere • Render phong highlight on sphere • Use rendered sphere as an environment map • Texture coordinate interpolation interpolates wr

  13. MeasuredRadiance Maps • Peercy, Olano, Airey , Ungar, "Interactive Multi-Pass Programmable Shading", SIGGRAPH 2000

  14. Real-Time Bump Mapping • Embossing • Multipass difference betweentexture and shifted copy • Environment-mapped bump mapping • Perturb environment map index with bump map (map of height field differentials) • Register combiners • Store vectors in texture map • Compute per-pixel dot product B B B

More Related