Week 7 -Wednesday What did we talk about last time? Exam 1 Before - - PowerPoint PPT Presentation

week 7 wednesday what did we talk about last time exam 1
SMART_READER_LITE
LIVE PREVIEW

Week 7 -Wednesday What did we talk about last time? Exam 1 Before - - PowerPoint PPT Presentation

Week 7 -Wednesday What did we talk about last time? Exam 1 Before that Specular and diffuse shading Aliasing VertexPositionNormalTexture[] vertices = new VertexPositionNormalTexture[36] { // Front face //Bottom face new


slide-1
SLIDE 1

Week 7 -Wednesday

slide-2
SLIDE 2

 What did we talk about last time?  Exam 1  Before that

  • Specular and diffuse shading
  • Aliasing
slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6
slide-7
SLIDE 7

VertexPositionNormalTexture[] vertices = new VertexPositionNormalTexture[36] { // Front face new VertexPositionNormalTexture(new Vector3(1, 1, 1), Vector3.UnitZ, new Vector2(.5f, 0)), new VertexPositionNormalTexture(new Vector3(-1, -1, 1), Vector3.UnitZ, new Vector2(1, 1)), new VertexPositionNormalTexture(new Vector3(-1, 1, 1), Vector3.UnitZ, new Vector2(0, 1)), new VertexPositionNormalTexture(new Vector3(1, 1, 1), Vector3.UnitZ, new Vector2(.5f, 0)), new VertexPositionNormalTexture(new Vector3(1, -1, 1), Vector3.UnitZ, new Vector2(1, 1)), new VertexPositionNormalTexture(new Vector3(-1, -1, 1), Vector3.UnitZ, new Vector2(0, 1)), //Right face new VertexPositionNormalTexture(new Vector3(1, 1, 1), Vector3.UnitX, new Vector2(.5f, 0)), new VertexPositionNormalTexture(new Vector3(1, 1, -1), Vector3.UnitX, new Vector2(1, 1)), new VertexPositionNormalTexture(new Vector3(1, -1, 1), Vector3.UnitX, new Vector2(0, 1)), new VertexPositionNormalTexture(new Vector3(1, -1, -1), Vector3.UnitX, new Vector2(.5f, 0)), new VertexPositionNormalTexture(new Vector3(1, -1, 1), Vector3.UnitX, new Vector2(1, 1)), new VertexPositionNormalTexture(new Vector3(1, 1, -1), Vector3.UnitX, new Vector2(0, 1)), //Left face new VertexPositionNormalTexture(new Vector3(-1, 1, 1), -Vector3.UnitX, new Vector2(.5f, 0)), new VertexPositionNormalTexture(new Vector3(-1, -1, 1), -Vector3.UnitX, new Vector2(1, 1)), new VertexPositionNormalTexture(new Vector3(-1, 1, -1), -Vector3.UnitX, new Vector2(0, 1)), new VertexPositionNormalTexture(new Vector3(-1, 1, -1), -Vector3.UnitX, new Vector2(.5f, 0)), new VertexPositionNormalTexture(new Vector3(-1, -1, 1), -Vector3.UnitX, new Vector2(1, 1)), new VertexPositionNormalTexture(new Vector3(-1, -1, -1), -Vector3.UnitX, new Vector2(0, 1)), //Bottom face new VertexPositionNormalTexture(new Vector3(1, -1, 1), -Vector3.UnitY, new Vector2(.5f, 0)), new VertexPositionNormalTexture(new Vector3(1, -1, -1), -Vector3.UnitY, new Vector2(1, 1)), new VertexPositionNormalTexture(new Vector3(-1, -1, -1), -Vector3.UnitY, new Vector2(0, 1)), new VertexPositionNormalTexture(new Vector3(-1, -1, -1), -Vector3.UnitY, new Vector2(.5f, 0)), new VertexPositionNormalTexture(new Vector3(-1, -1, 1), -Vector3.UnitY, new Vector2(1, 1)), new VertexPositionNormalTexture(new Vector3(1, -1, 1), -Vector3.UnitY, new Vector2(0, 1)), //Top face new VertexPositionNormalTexture(new Vector3(-1, 1, -1), Vector3.UnitY, new Vector2(.5f, 0)), new VertexPositionNormalTexture(new Vector3(1, 1, -1), Vector3.UnitY, new Vector2(1, 1)), new VertexPositionNormalTexture(new Vector3(1, 1, 1), Vector3.UnitY, new Vector2(0, 1)), new VertexPositionNormalTexture(new Vector3(1, 1, 1), Vector3.UnitY, new Vector2(.5f, 0)), new VertexPositionNormalTexture(new Vector3(-1, 1, 1), Vector3.UnitY, new Vector2(1, 1)), new VertexPositionNormalTexture(new Vector3(-1, 1, -1), Vector3.UnitY, new Vector2(0, 1)), //Back face new VertexPositionNormalTexture(new Vector3(1, 1, -1), -Vector3.UnitZ, new Vector2(.5f, 0)), new VertexPositionNormalTexture(new Vector3(-1, 1, -1), -Vector3.UnitZ, new Vector2(1, 1)), new VertexPositionNormalTexture(new Vector3(-1, -1, -1), -Vector3.UnitZ, new Vector2(0, 1)), new VertexPositionNormalTexture(new Vector3(-1, -1, -1), -Vector3.UnitZ, new Vector2(.5f, 0)), new VertexPositionNormalTexture(new Vector3(1, -1, -1), -Vector3.UnitZ, new Vector2(1, 1)), new VertexPositionNormalTexture(new Vector3(1, 1, -1), -Vector3.UnitZ, new Vector2(0, 1)), };

Note:These cube vertices are what we did in class. They might not be organized in the most helpful way, and their texture coordinates are totally wrong.

slide-8
SLIDE 8
slide-9
SLIDE 9

 When sampling any continuous thing (image, sound, wave)

into a discrete environment (like the computer), multiple samples can end up being indistinguishable from each other

 This is called aliasing  We can reduce aliasing by carefully considering how sampling

and reconstruction of the signal is done

slide-10
SLIDE 10

 Ever seen wheels of a car spinning the wrong way?  Without enough samples, it may be impossible to tell which way it's

spinning

 You need a sampling frequency twice as high as the maximum frequency

  • f the events to reconstruct the original signal

 Called the Nyquist limit

slide-11
SLIDE 11

 Jaggies are caused by insufficient sampling  A simple method to increase sampling is full-scene antialiasing,

which essentially renders to a higher resolution and then averages neighboring pixels together

 The accumulation buffer method is similar, except that the

rendering is done with tiny offsets and the pixel values summed together

slide-12
SLIDE 12

A variety of FSAA schemes exist with different tradeoffs between quality and computational cost

slide-13
SLIDE 13

 For non-interactive render

speeds, the A-buffer can be used

 The A-buffer generates a

coverage mask for each fragment for each pixel

 Fragments are thrown away if

they have z-buffer values that are higher than fragments with full coverage

 Final pixel color is based on

fragment merging

slide-14
SLIDE 14

 Supersampling techniques (like FSAA) are very expensive

because the full shader has to run multiple times

 Multisample antialiasing (MSAA) attempts to sample the

same pixel multiple times but only run the shader once

  • Expensive angle calculations can be done once while different

texture colors can be averaged

  • Color samples are not averaged if they are off the edge of a pixel
slide-15
SLIDE 15

 Active research is still trying to find techniques with good visual output and

good computational performance

 Stochastic (random) sampling reduces the visual repetition of some artifacts  Sharing samples between pixels can reduce overall cost

slide-16
SLIDE 16
slide-17
SLIDE 17
slide-18
SLIDE 18

 Transparency  Texturing basics

slide-19
SLIDE 19

 Keep working on Project 2  Keep reading Chapter 6

  • Transparency
  • Textures