Learning with Modern OpenGL Evan Hart NVIDIA. Disclaimer Deprecated functionality supported by many...

9
Learning with Modern OpenGL Evan Hart NVIDIA

Transcript of Learning with Modern OpenGL Evan Hart NVIDIA. Disclaimer Deprecated functionality supported by many...

Page 1: Learning with Modern OpenGL Evan Hart NVIDIA. Disclaimer  Deprecated functionality supported by many vendors  Old versions of OpenGL are still supported.

Learning with Modern OpenGL

Evan Hart

NVIDIA

Page 2: Learning with Modern OpenGL Evan Hart NVIDIA. Disclaimer  Deprecated functionality supported by many vendors  Old versions of OpenGL are still supported.

Disclaimer

Deprecated functionality supported by many vendors

Old versions of OpenGL are still supported

Fortran and Cobol are still important even if most courses now focus on Java

This is about what to teach/learn, not about changing production code

Page 3: Learning with Modern OpenGL Evan Hart NVIDIA. Disclaimer  Deprecated functionality supported by many vendors  Old versions of OpenGL are still supported.

Introduction with New APIsIntroduction with New APIs

• Focus on fundamentals of graphics

• Less focus on API mechanism

• Requires some tools to help things along

• Still provides access to fast feedback

• More marketable knowledge

Page 4: Learning with Modern OpenGL Evan Hart NVIDIA. Disclaimer  Deprecated functionality supported by many vendors  Old versions of OpenGL are still supported.

Fundamental FocusFundamental Focus

• Focus on core algorithms at the pixel and vertex level

– Illumination models like Phong

• Rich C-like language for development

– Algorithms are not hidden behind switches

Page 5: Learning with Modern OpenGL Evan Hart NVIDIA. Disclaimer  Deprecated functionality supported by many vendors  Old versions of OpenGL are still supported.

API MechanismAPI Mechanism

• Newer API mechanisms are more verbose

• Less reliance on API imposed anachronisms

– Latching behavior of vertex submission

– More orthogonality

Page 6: Learning with Modern OpenGL Evan Hart NVIDIA. Disclaimer  Deprecated functionality supported by many vendors  Old versions of OpenGL are still supported.

ToolsTools

• Good support code goes a long way

• Few would recommend starting without GLUT or GLU in ‘old’ OpenGL

• Is shader creation or VBO creation substantially different?

Page 7: Learning with Modern OpenGL Evan Hart NVIDIA. Disclaimer  Deprecated functionality supported by many vendors  Old versions of OpenGL are still supported.

Tools vs ComplexityTools vs Complexity

• Single Triangle, no tools

– 126 lines (minor reformatting)

• Single Triangle, compile and link functions

– 86 lines

• Single Triangle, create shader function

– 74 lines

• Old OpenGL Single Triangle

– 35 lines (no comment lines)

Page 8: Learning with Modern OpenGL Evan Hart NVIDIA. Disclaimer  Deprecated functionality supported by many vendors  Old versions of OpenGL are still supported.

MarketabilityMarketability

• Most new 3D apps use shaders

– Arguably most require them

• All APIs are eliminating fixed-function

– OpenGL, OpenGL ES, and Direct3D

• Some PhD level graphics students have trouble explaining the math for Phong illum.

– For better or worse this is probably the most common shader component (other than matrix multiplication)

Page 9: Learning with Modern OpenGL Evan Hart NVIDIA. Disclaimer  Deprecated functionality supported by many vendors  Old versions of OpenGL are still supported.

Pros & ConsPros & Cons

Advantages

• More closely tied to the core algorithms

• Better matched to new code development

• More closely matches other modern APIs presently in use

Disadvantages

• More verbose API with fewer defaults

• No GLUT / GLU functions

• Still lots of apps using OpenGL 1.x