Uploaded on

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,093
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
2
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. 3D Computer Graphics - a Technical Introduction AKA 3D Graphics Programming ! By Praseed Pai K.T. http://praseedp.blogspot.com [email_address]
  • 2. Background
    • UT Game Engine Release
    • Discussion in the BarCamp user Group
    • Volunteered to take a session on Graphics Programming Aspects
    • Has in the past consulted for companies in the CAD/CAM space.
    • Lack of Graphics Programmers in Kerala ( INDIA)
  • 3. Computer Graphics – What the heck is it ?
    • William Fetter in 1960 coined the term
    • Ivan Sutherland's Sketch Pad Thesis @ MIT
  • 4. Part - 1 PIXELS !
  • 5. What is a Pixel ?
    • Pixel or Picture Element is a 32 bit integer value
    • RGBA – Red Green Blue Alpha
    • One can use an array of unsigned integers to store the pixel data.
    • Once the data is populated , we can transfer the stuff into a Windows Device Independent Bitmap.
  • 6. After Pixels , what else ?
    • Bresenham's Line Algorithm
    • Midpoint Circle Algorithm
    • Triangle , Rectangle , Polygon Filling
    • Copy the Stuff into the Device
  • 7. Demo
    • Clear the Screen Background
    • Plotting Arbitary data at a point
    • Rectangle,Triangle , Circle , Arc Rasterization demo
    • Image Point Processing ( Color to Grey Scale and Image Negative )
    • Procedural Image
  • 8. Part 2 Transformation and Matrices
  • 9. 2D Physical Co-ordinate System
  • 10. Transformation
    • Translation
    • Rotation
    • Scale
  • 11. Logical Co-ordinates
  • 12. Demo
    • A Clock Program using MFC
    • Manual co-ordinate Transformation.
    • Clock Geometry
  • 13. Part 3 Finally it's 3D Time
  • 14. 3D Co-ordinate System – Are you on the Left or Right ?
  • 15. 3D Transformation - Translation
  • 16. 3D Transformation - Rotate
  • 17. 3D Transform - Scale
  • 18. 3D Viewing - Perspective
  • 19. 3D viewing – Perspective Matrix
  • 20. 3D viewing - Ortho
  • 21. 3D viewing – Ortho Matrix
  • 22. Primitives
  • 23. Primitives ( contd.. )
  • 24. Jim Kajiya and his Rendering Equation
  • 25. Lights Please
  • 26. Rendering A scene using Global illumination
  • 27. Numerical Evaluation of Rendering Equation
    • Computationally Very Expensive
    • Monte Carlo Rendering
    • Global Illumination Algorithm
    • Radiosity , Photon Rendering , Bidirectional Path Tracing , MetroPolis Light Transport Algorithms solve the Rendering Equation to determine the Pixel Color
    • AQSIS – A RenderMan Compliant Renderer
  • 28. How do i Light in a feasible manner?
  • 29. Local Illumination Models
    • Global Illumination by solving Rendering Equation is not suitable for Real Time Graphics
    • We go for Approximation algorithms to create illumination models which are close to the physically based models
    • Phong Lighting Model with Gourord Shading ( more about it later ) was the only feasible thing for real time work.
    • Thanks to GPU we can have per pixel lighting like Phong Shading.
  • 30. Phong Lighting Model
  • 31. Phong Lighting Model
  • 32. Shading – Flat Shading
    • Every Polygonal face will have same color
    • Fastest Shading Method
    • Visual Fidelity is not good
  • 33. Shading – Gourord Shading
    • Calculation is done per vertex
    • The Colors are interpolated
  • 34. Shading – Phong Shading
    • Per Pixel Lighting Calculation
    • Most Expensive
    • Feasible only on a GPU
  • 35. Lights – Directional Light
  • 36. Lights – Point Lights
  • 37. Light – Spot Light
  • 38. Images , so far ar synthetic .how do i add details ?
  • 39. Texture Mapping - Adding Detail to the surface
  • 40. Texture co-ordinates
  • 41. Demos
    • Texture Mapping an Image on to a Quad
    • Environment Mapping Demo
    • Terrain
    • MultiTexturing
    • Fog
    • Demos from Ultimate Game Programming book
  • 42. Duo Who made PC a graphics Platform
  • 43. Part 4 Procedural Techniques
  • 44. GPU
    • Aka Graphics Cards
    • Became Programmable from 1999
    • Now one can write code using High Level Languages
    • Cg from Nvidia
    • GLSL from OpenGL ARB/Khronos
    • HLSL from Microsoft
    • Modern day GPU
  • 45. Graphics Pipeline
  • 46. Demo – Ambient Light Vertex Program //////////////////////// // // Vertex Program to Demonstrate Ambient Light // varying vec3 normal, lightDir; void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
  • 47. Demo – Ambient Light Fragment Processor ////////////////// // Fragment Program for Ambient Light // // varying vec3 normal, lightDir; void main() { float intensity=0.2; vec4 color= vec4(1.0,1.0,0.0,0.0); gl_FragColor = color*intensity; }
  • 48. Rasterizing Triangle using Shaders Vertex Shader void main() { gl_Position = ftransform(); }
  • 49. Triangle – Fragment Shader uniform vec2 v0, v1, v2; ///////////////////////////////////// // // 2D cross product; // float crs(const vec2 u, const vec2 v) { return u.x * v.y - u.y * v.x; } ///////////////////////////////////// // Main routine test whether screen pixel is // within the triangle // void main() { vec2 p = gl_FragCoord.xy; if (crs(v1 - v0, p - v0) >= 0 && crs(v2 - v1, p - v1) >= 0 && crs(v0 - v2, p - v2) >= 0) gl_FragColor = vec4(1.0,0.0,0.0,0.0); else gl_FragColor = vec4(0.5); // gl_FragColor = vec4(1.0,0.0,0.0,0.0); }
  • 50. More Demos
    • GLSL Code snippets for doing various Lighting Models
    • GLSL demo from now defunct 3D Labs inc..
  • 51. Turner Whitted and his Rendering Technique
  • 52. Ray Tracing
    • Shooting a Ray from Eye into the scene ( for every pixel we need to do this )
    • It reverses the actual vision process to reduce the computational time..
    • We require robust computational primitives
    • Ray Casting Demo
    • Ray Tracing Demo
    • A Discussion on POV Ray
  • 53. Q & A
    • THANK YOU