Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE 5542 - Real Time Rendering. TBT (Not So) Real Time Rendering.

Similar presentations


Presentation on theme: "CSE 5542 - Real Time Rendering. TBT (Not So) Real Time Rendering."— Presentation transcript:

1 CSE 5542 - Real Time Rendering

2 TBT (Not So) Real Time Rendering

3 Time - TR 11:10 AM – 12:30 pM Place - DL 0264 Where ?

4 Labs ? Your own machine … Graphics PC Lab – CL 112D ? Platforms: PC (visual studio), Mac OS X or Linux

5 Who Am I ?

6 Name: Raghu Machiraju Email: machiraju.1@osu.edumachiraju.1@osu.edu Office hours: M: 3-4 PM TR12:30 PM – 1:30 PM The Instructor

7 Grading

8 Name: Tzi-Husan Wei Email: TBA Office hours: Monday: 4:30-5:30 PM Wed: 3:00-5:00 PM Fri: 3:00-5:00 PM The Grader

9 Grading  Labs: 45% (10+12+13+10) - Strict deadlines.  Final Project: 15% - No Final Exam  Quizzes: 20%(5x4)  (Take Home) Midterm:15%

10

11 Information Web: http://www.cse.ohio-state.edu/~raghu/5542 Piazza: https://piazza.com/osu/spring2015/cse5542/home Prerequisite: 3901 (560) or 3902 or 3903 math 2568 (568) or 571 permission from the instructor

12 Pre-reqs

13 Must Haves You need to be enthusiastic about Computer Graphics You need to be fluent in C/C++/Java programming You need to be comfortable with linear algebra You need to be willing to get hands-dirty: OpenGL, WebGL, 3D Printing, GLSL, hardware

14 CAVEATS – Not a …

15 Closer to …

16

17 The Book

18 Earlier …

19 Diff 7e 6e

20 Will Follow Text Closely

21 OpenGL programming Guide, 8 th edition OpenGL shading language 3 rd edition http://proquest.safaribooksonline.com Useful Books – OpenGL, GLSL

22 Useful Books - WebGL

23 Useful Books - JavaScript

24 Useful Tool - Blender

25 Reference Books – OpenGL/ES https://www.khronos.org/

26 Reference Books – HTML5

27 Reference Books Computer Graphics Principle and Practice 3 rd edition Real-Time Rendering 3 rd edition

28 Reference Books OpenGL 4.0 Shading Language Cookbook Graphics shaders: Theory and Practice, 2 nd edition

29 Reference - Und Others

30 Reference

31 What do we Study ?

32 Teapots

33 A Real One

34 Drawing Teapots

35 Step 1

36 Step 2

37 Step 3

38 Step 4

39 Step 5

40 Step 6

41 Manufacturing Teapots & Minions

42 Manufacturing Teapots https://www.ted.com/talks/lisa_harouni_a_primer_on_3d_ printing http://oncampus.osu.edu/replicating-in-3d/ http://news.cornell.edu/stories/2013/04/rapid-reality- students-design-3-d-printed-products

43 You will all make these http://www.thingiverse.com/thing:68880

44

45 Manufacturing Teapots http://onderin.de.buro.la/cura-ani-500-64c.gif

46 And These

47 Maybe Not This

48 Manufacturing Minions https://www.youtube.com/watch?v=-2uY7rjhhMs

49 We will not do this … Kevin Wolf, 3D Printer, Mechanical Eng., OSU

50 Virtual Teapots

51 An Icon !

52 Which one is real ?

53 Real vs Virtual – Boston Museum

54 More fake ones ! http://codegolf.stackexchange.com/questions/22620/draw-the-utah-teapot

55 Shutterbug !

56 Toy Story

57 A Platonic Relationship !

58 Building with Blender https://www.youtube.com/watch?v=QyiBw L2Scec

59 Another Method https://www.youtube.com/watch?v=x8AiEi 4aJ4g

60 You will be also doing this …

61 And better than this !

62 OpenGL, GLSL

63

64 Topics and Outcomes

65 To Reiterate Geometric Modeling 3D Printed Version Software Tools

66 Learning Outcomes - Familiarity  Basic understanding of graphics hardware/software  Basics of modeling and 3D Printing  Basics of interaction

67 Learning Outcomes - Skills  OpenGL/GLSL to control graphics hardware  WebGL/OpenGL-ES to allow interactions  Blender to build models

68 Learning Outcomes - Cognitive -Advanced real time rendering algorithms -Integrating three different software suites – WebGL, GLSL, OpenGL -Solid and curve modeling nuances

69 Specific Topics Overview of Graphics Hardware and Software Coordinate systems WebGL Interaction modes –HTML 5 –Immediate vs. retained mode OpenGL geometry drawing - OpenGL vertex buffer objects OpenGL Shading Language - Vertex and fragment shaders 3D transformation and Viewing

70 Specific Topics Illumination –Flat, Gourad, Phong shading models –Fixed function pipeline and shaders Visibility and Z-buffering Texture Mapping –Image and procedural textures Bump, environment, & projective texture mapping

71 Specific Topics Real time shadows Particle Methods Advanced topics in shaders –Geometry shader –Tessellation shader Advanced topics in rendering and graphics

72 72 Image Formation

73 73 Image Formation –Cameras –Microscopes –Telescopes –Human visual system

74 74 Synthetic Camera Model center of projection image plane projector p projection of p

75 75 Ray Tracing and Geometric Optics Problemo ? Image Formation (Eine Explanation)

76 The Real Thing ! http://www.uccs.edu/~rtirado/Astronomy_Texts/Lig ht_Image_Formation.pdf

77 Essentials of Image Formation Objects Camera Light source(s) Light-material interaction Independence of objects, viewer, and light source(s)

78 78 Light

79 79 Luminance vs. Color http://www.workwithcolor.com/color-luminance-2233.htm

80 80 How Many Colors ? Human visual system –Rods: monochromatic, night vision –Cones Color sensitive Three types of cones Only three values (the tristimulus values) are sent to the brain –Three primary colors – R, G, B

81 81 In Days Long Gone

82 Even in these days !

83 The Camera

84 Real Cameras

85 Viewing

86 86 Angel and Shreiner: Interactive Computer Graphics6E © Addison-Wesley 2012 Eine Simple Kamera – The Pinhole x p = -x/z/dy p = -y/z/d Simple Perspective - find projection of point at (x,y,z) z p = d

87 Perspective

88 DYC http://www.pinhole.cz/en/pinholecameras/dirkon_01.html

89 Not Bad

90 Let Us Go Digital http://electronics.howstuffworks.com/digital-camera.htm

91 Rasters

92 Pixels & Resolution

93 Is A Pixel Really A Square ? http://alvyray.com/Memos/CG/Microsoft/6_pixel.pdf

94 An image ? 8 bits/pixel 0 255

95 CCD Cameras - Resolution http://www.dalsa.com/shared/content/pdfs/CCD_vs_CMOS_Litwiller_2005.pdf

96 Image Digitization Sampling: Resolution Quantization: Measured Value

97 Image Digitization Sampling Quantization

98 https://get.webgl.org/

99 Kewl Sites http://www.chromeexperiments.com/webgl/

100 100 Coding in WebGL Can run WebGL on any recent browser –Chrome –Firefox –Safari –IE Code written in JavaScript JS runs within browser –Use local resources

101 Example: triangle.html 101

102 Example Code 102 attribute vec4 vPosition; void main(){ gl_Position = vPosition; } precision mediump float; void main(){ gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); }

103 HTML File (contd.) 103 Oops... your browser doesn't support the HTML5 canvas element

104 JS File 104 var gl; var points; window.onload = function init(){ var canvas = document.getElementById( "gl-canvas" ); gl = WebGLUtils.setupWebGL( canvas ); if ( !gl ) { alert( "WebGL isn't available" ); } // Three Vertices var vertices = [ vec2( -1, -1 ), vec2( 0, 1 ), vec2( 1, -1 ) ];

105 JS File (contd.) 105 // Configure WebGL // gl.viewport( 0, 0, canvas.width, canvas.height ); gl.clearColor( 1.0, 1.0, 1.0, 1.0 ); // Load shaders and initialize attribute buffers var program = initShaders( gl, "vertex-shader", "fragment-shader" ); gl.useProgram( program ); // Load the data into the GPU var bufferId = gl.createBuffer(); gl.bindBuffer( gl.ARRAY_BUFFER, bufferId ); gl.bufferData( gl.ARRAY_BUFFER, flatten(vertices), gl.STATIC_DRAW );

106 JS File (contd.) 106 // Associate out shader variables with our data buffer var vPosition = gl.getAttribLocation( program, "vPosition" ); gl.vertexAttribPointer( vPosition, 2, gl.FLOAT, false, 0, 0 ); gl.enableVertexAttribArray( vPosition ); render(); }; function render() { gl.clear( gl.COLOR_BUFFER_BIT ); gl.drawArrays( gl.TRIANGLES, 0, 3 ); }

107 JavaScript Notes JavaScript (JS) is the language of the Web –All browsers will execute JS code –JavaScript is an interpreted object-oriented language 107

108 JS Notes Is JS slow? –JS engines in browsers are getting much faster –Not a key issues for graphics since once we get the data to the GPU it doesn’t matter how we got the data there JS is a (too) big language –We don’t need to use it all –Choose parts we want to use –Don’t try to make your code look like C or Java 108

109 JS Notes Very few native types: –numbers –strings –booleans Only one numerical type: 32 bit float –var x = 1; –var x = 1.0; // same –potential issue in loops –two operators for equality == and === Dynamic typing 109

110 Scoping Different from other languages Function scope variables are hoisted within a function –can use a variable before it is declared Note functions are first class objects in JS 110

111 JS Arrays JS arrays are objects –inherit methods –var a = [1, 2, 3]; is not the same as in C++ or Java –a.length // 3 –a.push(4); // length now 4 –a.pop(); // 4 –avoids use of many loops and indexing –Problem for WebGL which expects C-style arrays 111

112 Typed Arrays JS has typed arrays that are like C arrays var a = new Float32Array(3) var b = new Uint8Array(3) Generally, we prefer to work with standard JS arrays and convert to typed arrays only when we need to send data to the GPU with the flatten function in MV.js 112

113 A Minimalist Approach We will use only core JS and HTML –no extras or variants No additional packages –CSS –JQuery Focus on graphics –examples may lack beauty 113

114


Download ppt "CSE 5542 - Real Time Rendering. TBT (Not So) Real Time Rendering."

Similar presentations


Ads by Google