Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Intro to 3D Graphics - WIG Boston - 2017

Intro to 3D Graphics - WIG Boston - 2017

Invited talk for Women in Games Boston. Presented on Monday 2 October 2017

Douglass Turner

October 02, 2017
Tweet

More Decks by Douglass Turner

Other Decks in Education

Transcript

  1. Elastic Image Software LLC 8 for each object in the

    scene determine its corresponding pixels for each corresponding pixel calculate depth of object at pixel if depth is closer than any object yet seen put this object in the pixel endif end end Sketch of a simple rendering algorithm
  2. Transform Transformation Matrix Coordinate Frame Reference Frame Eye Space Model

    Space World Space Different words for the same thing
  3. Unity uses quaternions for rotation. They are easier to specify

    and control then rotation via matrices.
  4. Quaternion demo: HelloLight - iPhone For an implementation of quaternions

    in Swift for iOS see the EIArcball class in my HelloMetal repository on Github: https://github.com/turner/HelloMetal
  5. We attach a set of attributes to each vertex. •

    position: x, y, z • surface normal: nx, ny, nz, • texture coordinate: u, v
  6. u,v define a coordinate system on the surface of an

    object for attaching a texture u v
  7. We are very familiar with a two- dimensional coordinate system

    on the surface of a 3D object. Longitude/Latitude
  8. Illumination Models === math Fortunately it is a very specific

    collection of math function with the sole purpose of creating color
  9. Some math The dot product. The cosine of the angle

    between N and L. A function of two vectors that produces one number. In the context of illumination this number scales reflected brightness. N.L
  10. diffuse = kd * (N.L) • V - Eye vector

    • L - Light source vector • N - Normal vector • kd - diffuse scale factor Diffuse Illumination
  11. Image Based Lighting (IBL) Use an image as the only

    source of light High Dynamic Range (HDR) Image More bit depth. To bring out shadow detail and subtlety. Use with … Global Illumination (GI) Result: lovely highly realistic images
  12. All of what we have talked about up to this

    point is preamble to where the real action happens, the … GPU
  13. The GPU takes the triangles and textures and rasterizes then

    for display. We control the GPU with small programs called shaders written in GLSL or Metal (iOS).
  14. A shader defines the look of an object Shaders come

    in pairs • vertex shader • fragment shader
  15. void main() { vec4 raw = texture2D(hero, v_st); vec3 inverted

    = 1.0 - raw.rgb; gl_FragColor = vec4(inverted, 1.0); }
  16. • Simultaneous movement • Similar movement at multiple scales •

    Smooth randomness • Flocking behavior • Meditative • 360 degrees of movement
  17. Douglass Turner [email protected] @dugla 781 775 3708 Slides at Speaker

    Deck https://speakerdeck.com/douglassturner/intro-to-3d-graphics-wig-boston-2017