a few things about graphics jian huang computer science university of tennessee
TRANSCRIPT
![Page 1: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/1.jpg)
A Few Things about Graphics
Jian Huang
Computer Science
University of Tennessee
![Page 2: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/2.jpg)
Graphics• Graphics studies light transport in 3D scene,
sometimes over time as well.• Example applications abound nowadays in
movies, MTVs, …• In a nutshell, it’s some math and methods to
compute such math efficiently on processors, memory banks and buses (lots of parallelism)
• Well, everything should start with that Rendering Equation
![Page 3: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/3.jpg)
The Rendering Equation• I(x,x’) = intensity passing from x’ to x• g(x,x’) = geometry term (1, or 1/r2, if x visible
from x’, 0 otherwise)• (x,x’) = intensity emitted from x’ in the direction
of x• (x,x’,x’’) = scattering term for x’ (fraction of
intensity arriving at x’ from the direction of x’’ scattered in the direction of x)
• S = union of all surfaces
![Page 4: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/4.jpg)
It’s not analytically solvable• So, instead of simply doing the math, can we use
computer to compute this equation in some simplified version (oftentimes, immensely)?
• When approximations are made, priorities are set accordingly to what is the most appealing to viewer given the current hardware capability
• The consumer of the result is human being, so the measurement of good and bad is not as conventional as other computer science disciplines
![Page 5: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/5.jpg)
What does it take to get that equation done?
• First, one has to model the scene– What color model is used (RGB, HSV)– Surfaces as geometrical meshes (volumes …)– Materials as lighting and texturing parameters– Light sources
• Second, compute the result for a screen device as it would appear on a retina – the rendering process– The graphics pipeline– Speed and high quality (30 fps, 60 fps, 120 fps)– Framebuffer: 320x240, 640x480, …, 1024x768, … 6000x6000. – Popular engines use OpenGL or DX, D3D libraries
![Page 6: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/6.jpg)
Geometric Primitives
• All geometric primitives are specified by vertices
![Page 7: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/7.jpg)
Transformations• Modeling transformations
• build complex models by positioning simple components
• Viewing transformations
• place virtual camera in the world
• transform from world coordinates to eye coordinates
• Vary transformations over time creates motion - Animation
WORLD
OBJECTEYE
![Page 8: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/8.jpg)
Affine Transformation in 3D
• Translation
• Rotate
• Scale
• Shear
![Page 9: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/9.jpg)
1. 2.
3. 4.
5. 6.
![Page 10: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/10.jpg)
3D Models - The Mesh
Assembled scene
![Page 11: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/11.jpg)
A Virtual World
• Objects– Shape: meshed geometry (and topology)– Appearance: lighting, shading and texture
• Scene– Camera and viewing– Light position– Scene composition
![Page 12: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/12.jpg)
Appearance
• Having just the geometry, objects don’t look right yet.
• The first step is to use light sources
• The second step is to put textures on
![Page 13: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/13.jpg)
Multiple Light Source• IL: light intensity
• For multiple light sources– Repeat the diffuse and specular calculations for each light source– Add the components from all light sources– The ambient term contributes only once
• The different reflectance coefficients can differ. – Simple “metal”: ks and kd share material color, – Simple plastic: ks is white
• Remember, when cosine is negative lighting term is zero!
![Page 14: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/14.jpg)
Un-lit
![Page 15: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/15.jpg)
Smooth Shaded
![Page 16: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/16.jpg)
What is a Texture?
• Color
• Specular ‘color’ (environment map)
• Normal vector perturbation (bump map)
• Displacement mapping
• Transparency
• ...
![Page 17: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/17.jpg)
Rendering
![Page 18: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/18.jpg)
Textures Make A Difference
• Good textures, when applied correctly, make a world out of nothing!
![Page 19: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/19.jpg)
Examples
![Page 20: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/20.jpg)
Examples (cont.)
![Page 21: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/21.jpg)
Examples (cont.)
![Page 22: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/22.jpg)
Before and After “Good” Texture
![Page 23: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/23.jpg)
Before and After “Good” Texture
![Page 24: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/24.jpg)
More
![Page 25: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/25.jpg)
Every Renderer is a State Machine
• All rendering attributes are encapsulated in the as states
• Transformations• Viewing• Rendering styles• Shading• Lighting• Texture mapping
![Page 26: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/26.jpg)
The Punch Line• Graphics models the world with geometry and
appearance attributes
• The rendering process is extremely computation-intensive. What processor won Processor-Of-The-Year award last year?
• The graphics state is complicated to maintain.• The requirement is high interactivity
![Page 27: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/27.jpg)
Distributed Graphics• Systems for distributing the shared graphical state
of multi-display, multi-person, distributed, interactive applications
![Page 28: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/28.jpg)
Distributed Graphics
• Two key problems:– The graphics database needs to be distributed
• Replication is a standard go-around
– The graphics states are distributed• This is the tricky part
![Page 29: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/29.jpg)
Distributed Graphics
• Two major categories:– Data can be replicated (let’s do this!)– Data can not be replicated
• Dependent on the choice– Drastically different approach– Specific pros and cons
• Let’s make sure graphics states are shared properly
![Page 30: A Few Things about Graphics Jian Huang Computer Science University of Tennessee](https://reader036.vdocument.in/reader036/viewer/2022062421/56649f505503460f94c72ae5/html5/thumbnails/30.jpg)
Distributed vs. Monolithic Apps
• Distributed control– In a non-trivial distributed application, different components need
to be notified of changes to the distributed state
• Interactivity– Network latency bandwidth limitations make updates to
distributed state much slower. For performance, need to perform some operations locally
• Local variations– There are times when a shared graphical scene may need to be
modified locally