baiscs of opengl

21
I am Mrinmoy Dalal I am here because I love to give presentations. You can find me at [email protected] Hello!

Upload: mrinmoy-dalal

Post on 12-Apr-2017

53 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Baiscs of OpenGL

I am Mrinmoy DalalI am here because I love to give presentations. You can find me at [email protected]

Hello!

Page 2: Baiscs of OpenGL

GRAPHICS and COMPUTERSLet’s start with the first set of slides

Page 3: Baiscs of OpenGL

Because of the nature of Moore's law, anything that an

extremely clever graphics programmer can do at one point can be replicated by a

merely competent programmer some number of

years later.-John Carmack

Page 4: Baiscs of OpenGL

What is COMPUTER GRAPHICS

Computer graphics are pictures and movies created using computers - usually referring to image data created by a computer specifically with help from specialized graphical hardware and software.

Page 5: Baiscs of OpenGL
Page 6: Baiscs of OpenGL

Open Graphics LibraryThe Cross – Platform, Cross – Application

Graphics API

Page 7: Baiscs of OpenGL

◉ OpenGL (Open Graphics Library) was developed originally by SGI (Silicon Graphics Incorporated)

◉ Utilities in OpenGL library can be called from C, C++◉ Bindings available also for other programming

languages such as Java, Tcl, Python, Ada, and Fortran◉ Built on graphics hardware and works fast◉ Portable to most other systems and able to use other

architectures’ graphics capabilities

What is OpenGL?

Page 8: Baiscs of OpenGL

Why learn OpenGL

Good support of hardware◉ Microsoft DX 10 and DX11 can only run on the platform

upon Windows Vista.◉ The same function can be implemented by OpenGL on

Windows XP.◉ OpenGL provides extensions for the latest function of GPU

vendors.Cross-platform

◉ OpenGL works on Windows/ Linux/ Mac◉ OpenGL ES◉ WebGL

Page 9: Baiscs of OpenGL

OpenGL LibrariesOpenGL core library◉ OpenGL32 on Windows◉ GL on most unix/linux systemOpenGL Utility Library (GLU)◉ Provides functionality in OpenGL core but avoids

having to rewrite codeLinks with window system◉ GLX for X window systems◉ WGL for Windows

Page 10: Baiscs of OpenGL

GLUT

◉ OpenGL Utility Toolkit library◉ A tool which allows the creation of windows and

handling of input on multiple systems◉ Making OpenGL cross-platform and extremely simple

to set up◉ Original GLUT is no longer being developed◉ There is a remake of GLUT called FreeGLUT

Page 11: Baiscs of OpenGL

GLEW

◉ OpenGL Extension Wrangler◉ A cross-platform open-source C/C++ extension

loading library◉ Provides efficient run-time mechanisms for

determining which OpenGL extensions are supported on the target platform

Page 12: Baiscs of OpenGL

API HIERARCHY

Page 13: Baiscs of OpenGL

OpenGL Pipeline

Page 14: Baiscs of OpenGL

OpenGL Pipeline

Page 15: Baiscs of OpenGL

OpenGL APIvoid glutInit(int*argcp, char **argv);

Initialized GLUTvoid glutInitDisplayMode(unsigned intmode);

Sets the display modevoid glutInitWindowSize(intwidth, intheight);void glutInitWindowPosition(intx, inty);

Set the size and the position on the screen for GLUT windowint glutCreateWindow(char *name);

Create window and give it a title/caption

Page 16: Baiscs of OpenGL

OpenGL API

void glutDisplayFunc(void (*func) (void));Sets the display callback for the current window

void glutMainLoop(void);Enters the GLUT event processing loop

void glClearColor(GLfloatred, GLfloatgreen, GLfloatblue, GLfloatalpha);

Specify clear values for the color buffersvoid glClear(GLbitfieldmask);

Clear buffers to preset values

Page 17: Baiscs of OpenGL

Place your screenshot here

Desktop project

First OpenGL test run with a Torus…

Page 18: Baiscs of OpenGL

What’s Happening

◉ OpenGL pipeline is the process, from vertex buffers to framebuffer, that your data goes through when you make a single "draw" call in OpenGL.

◉ Rendering a scene usually involves multiple draw jobs, switching out textures, other uniform state, or shaders between passes and using the framebuffer's depth and stencil buffers to combine the results of each pass.

Page 19: Baiscs of OpenGL

CONCLUSION

OpenGL is that technology which has literally unlimited scope. All one needs is to channel their creativity in the right direction and one could use this technology to earn millions, even probably, from the comfort of one’s home.

Page 20: Baiscs of OpenGL

Any questions ?You can find me at◉ @mrinmoydalal◉ [email protected]

Thanks!

Page 21: Baiscs of OpenGL

Credits

Special thanks to all the people who made and released these awesome resources for free:

◉Presentation template by SlidesCarnival◉Photographs by Unsplash

Also please refer to the video attached for an insight as to how I made the Rotating Torus.