Baiscs of OpenGL
-
Upload
mrinmoy-dalal -
Category
Education
-
view
48 -
download
0
Transcript of Baiscs of OpenGL
I am Mrinmoy DalalI am here because I love to give presentations. You can find me at [email protected]
Hello!
GRAPHICS and COMPUTERSLet’s start with the first set of slides
“
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
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.
Open Graphics LibraryThe Cross – Platform, Cross – Application
Graphics API
◉ 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?
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
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
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
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
API HIERARCHY
OpenGL Pipeline
OpenGL Pipeline
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
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
Place your screenshot here
Desktop project
First OpenGL test run with a Torus…
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.
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.
Any questions ?You can find me at◉ @mrinmoydalal◉ [email protected]
Thanks!
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.