So Cal Code Camp Summer ’12  Getting Started With OpenGL ES 2.0            By Matt Galaviz
About Me…• Currently part-time DBA (SQL Server)• Deep interest in game development• Started with Core Animation• Moved to ...
History•   OpenGL Website: http://www.opengl.org•   Introduced in 1992•   2D/3D graphics API•   Available on many differen...
History Continued• OpenGL ES Website:  http://www.khronos.org/opengles/• OpenGL ES 1.1 similar to OpenGL 1.5• 1.1 = Fixed ...
Programmable means more…• Control – do what you want with shaders• Responsibility – shaders need data and  programming• Co...
Differences between 1.1 and 2.0• Model/View/Projection (MVP)  – 1.1: Can call built in functions (glMatrixMode,    glIdent...
MVP Differences Continued– 2.0: Pass MVP matrices to shaders   • Side note: Matrix libraries may not be available on all  ...
Shaders• The programmable piece• Write in GLSL ES, similar functionality of C• Vertex Shader: handles vertex data• Fragmen...
Sample Shaders Vertex Fragment
Shader Creation•   Create Program•   Create Vertex and Fragment shaders•   Attach Vertex and Fragment shaders•   Compile• ...
Shader Creation Example                     Taken                     from iOS
Shader Usage• Use Program• Enable VBO’s  – Pass Data     • Attributes     • Uniforms  – Draw Objects  – Repeat data/drawin...
Shader Usage Example                       Taken                       from                       android
OpenGL ES 2.0 Availability•   Android: 2.2•   iOS: 3.0•   WebGL: 1.0•   Others
Getting Started• Identify goals  – Support ES 1.1 and 2.0     •   Rewrite code to support provider/consumer model     •   ...
Getting Started Continued– Multi Platform   • Many differences between android/iOS   • Java more similar to C++ in style a...
Poll• Do you currently use OpenGL ES?• Another graphics API?• What platform do you use?• Are you planning to support multi...
My Resources/References• Delicious:  http://www.delicious.com/mattgalaviz• Github:• http://www.github.com/geminileft
Other Resources/References• OpenGL ES 2.0 Specification  http://www.khronos.org/registry/gles/specs/2  .0/es_cm_spec_2.0.2...
The End• Questions/Comments• Contact me @ matthew.galaviz@gmail.com
Getting started with open gl es 2
Getting started with open gl es 2
Upcoming SlideShare
Loading in...5
×

Getting started with open gl es 2

1,022

Published on

Presentation for So Cal Code Camp 2012 session.

Published in: Technology, Art & Photos
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,022
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
31
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • http://www.khronos.org/registry/gles/specs/2.0/es_cm_spec_2.0.24.pdf
  • Getting started with open gl es 2

    1. 1. So Cal Code Camp Summer ’12 Getting Started With OpenGL ES 2.0 By Matt Galaviz
    2. 2. About Me…• Currently part-time DBA (SQL Server)• Deep interest in game development• Started with Core Animation• Moved to OpenGL ES 1.1• Meetup conversation inspired/challenged to learn OpenGL ES 2.0• Never wanted to be a Graphics Programmer ;)• Currently on 2nd or 3rd version of graphics/game engine, iOS and android
    3. 3. History• OpenGL Website: http://www.opengl.org• Introduced in 1992• 2D/3D graphics API• Available on many different platforms• Windows, Unix, Linux, OS X, etc.
    4. 4. History Continued• OpenGL ES Website: http://www.khronos.org/opengles/• OpenGL ES 1.1 similar to OpenGL 1.5• 1.1 = Fixed Function Pipeline• OpenGL ES 2.0 released circa 2008• 2.0 = Programmable Pipeline
    5. 5. Programmable means more…• Control – do what you want with shaders• Responsibility – shaders need data and programming• Complexity – shader source, compilation, VBO’s, MVP matrices, etc.• Discipline – maintaining shader data, switching shaders and other things can cause code to run SLOWER. Best practice adherence is a must!
    6. 6. Differences between 1.1 and 2.0• Model/View/Projection (MVP) – 1.1: Can call built in functions (glMatrixMode, glIdentity, glPushMatrix, glPopMatrix, etc.) Taken from android
    7. 7. MVP Differences Continued– 2.0: Pass MVP matrices to shaders • Side note: Matrix libraries may not be available on all platforms and may vary in use Taken from android
    8. 8. Shaders• The programmable piece• Write in GLSL ES, similar functionality of C• Vertex Shader: handles vertex data• Fragment Shader: handles pixel data• Comprised of attributes, uniforms and varying with types and variable precision• See specification for more details (approx. 200 pages)
    9. 9. Sample Shaders Vertex Fragment
    10. 10. Shader Creation• Create Program• Create Vertex and Fragment shaders• Attach Vertex and Fragment shaders• Compile• Hope for the best!
    11. 11. Shader Creation Example Taken from iOS
    12. 12. Shader Usage• Use Program• Enable VBO’s – Pass Data • Attributes • Uniforms – Draw Objects – Repeat data/drawing as needed• Disable VBO’s
    13. 13. Shader Usage Example Taken from android
    14. 14. OpenGL ES 2.0 Availability• Android: 2.2• iOS: 3.0• WebGL: 1.0• Others
    15. 15. Getting Started• Identify goals – Support ES 1.1 and 2.0 • Rewrite code to support provider/consumer model • Provider submits only primatives to consumer • Consumer determines how to handle primatives • Consumer = ES 1.1 or 2.0
    16. 16. Getting Started Continued– Multi Platform • Many differences between android/iOS • Java more similar to C++ in style and look than Objective-C • NDK on android possibly even more similar – Adds another layer of complexity • Even same platform can vary – iOS 5 GLKit • Keep shader source as separate files • Structure classes as similar as possible
    17. 17. Poll• Do you currently use OpenGL ES?• Another graphics API?• What platform do you use?• Are you planning to support multiple platforms?• Preferred platform?
    18. 18. My Resources/References• Delicious: http://www.delicious.com/mattgalaviz• Github:• http://www.github.com/geminileft
    19. 19. Other Resources/References• OpenGL ES 2.0 Specification http://www.khronos.org/registry/gles/specs/2 .0/es_cm_spec_2.0.24.pdf• GLSL ES Specification http://www.khronos.org/registry/gles/specs/2 .0/GLSL_ES_Specification_1.0.17.pdf• PowerVR developers http://www.imgtec.com/powervr/insider/pow ervr-insider.asp
    20. 20. The End• Questions/Comments• Contact me @ matthew.galaviz@gmail.com
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×