OpenGL book list
From: https://www.codeproject.com/Articles/771225/Learning-Modern-OpenGL
A little guide about modern OpenGL and why it gives us so much value.
Shaders + Cube Env Map + Phong Lighting
Introduction
Ok... so you want to learn modern OpenGL. Great! But what does it really mean and what options are available? Do you have to buy expensive books about this technology, or maybe some basic online tutorials are enough?
In this article, I will try to answer some of the questions above and create a guide to a wonderful world of graphics programming using OpenGL.
Let us start!
The plan:
-
Why Modern?
The first question I would like to answer is why there is a term called 'modern OpenGL'. Is there 'old OpenGL ' as well?
Basically modern means "using programmable graphics pipeline", old means "fixed pipeline".
What is the difference? This is quite a broad topic, but for now I think it is good to know that fixed pipeline was like a black box. You inserted the vertex data in the front (at the input) and you got triangles written to the framebuffer (screen) at the end. You could of course tweak this box to your needs but at some point, it was not enough.
Programmable pipeline is more like a white, transparent box where not only you put input data and wait for the result, but you can insert/change internal mechanisms as well. There is a general form of the pipeline, but a lot of parts are fully controlled by you - thanks to shaders.
Shader is a little program that can compute various things and is run on the GPU. It can transform vertices, calculate color of fragments, delete or add more triangles and even more.
To illustrate this idea, I prepared two images:
Idea of a fixed graphics pipeline
Idea of a programmable graphics pipeline
Although the images above are very very simplified, they show that programmable pipeline is much more flexible and more control is in the hands of a programmer. Thanks to shaders, one can create a lot of graphics effects that was not possible with fixed pipeline.
Currently, with new releases of graphics API (like OpenGL or DirectX), we get more and more control over the GPU. If we look at modern games' engines, we will see that great parts of it are run completely on GPU. Thus is it important to learn the modern way.
OpenGL Major Versions
Version
Important changes
1.1 - March 1997
Fixed pipeline! Note that the version 1.0 was released in 1992.
The latest 1.x version is 1.5 from July 2003 (includes, for instance, VBO and occlusion queries).
2.0 - September 2004
OpenGL Shading Language officially in the standard. Pixel buffer objects, sRGB.
Version 2.1 (July 2006) matches DirectX 9.0c.
OpenGL 2.0/2.1 is a safe point for targeting wide range of older devices (and still one can use shaders)
3.0 - August 2008
Deprecated features list, Frame buffer objects, floating point textures, transform feedback, Core Profile, Geometry shaders, synchronization objects.
OpenGL 3.3 (March 2010) can be compared to DX 10
4.0 - March 2010
Tesselation shaders, draw indirect, ES2 compatibility, program binaries, separate shaders objects, Compute shaders.
OpenGL 4.5 (August 2014) can be compared to DX 11.1 or even supersede it.
What You Should Learn?
I suggest the following topics for the beginning:
- General knowledge about the computer graphics
- Platform differences (PC vs Mobile vs Web vs Console)
- Graphics Pipeline - steps
- 3D Math - matrices, vectors, projections
- Camera models
- Shaders (Vertex and Fragment)
- Texture projection
- Basics of Buffers
- Basic lighting models
Then:
- Shaders (Geometry, Tessellation, Compute)
- Advanced memory management with buffers
- Shadows
- Global Illumination
- Cooperating with the driver: locks, minimizing memory transfers, batching...
- General Computing on GPU (OpenCL, CUDA, Compute shaders)
- ...
I left the second list unfinished on purpose. By the time you reach these points, you will definitely have a more clarified perspective on what you want to achieve and how to get where you want.
Where to Start?
OpenGL Superbible: Comprehensive Tutorial and Reference (7th Edition)
When we understand our motivation, we are able to start learning. Sometimes it is quite a hard task though! There are plenty of available resources so a person can be lost and lose his/her initial passion.
OpenGL Superbible became a standard book for learning OpenGL, and actually I cannot suggest anything different that that. Going back into my history, this was my first book about graphics programming. At that time, I had the first edition! Now we have the 7th (released on August 2015)
The Structure
- Basics: First triangle, the graphics pipeline, math, buffers, shaders. This is a nice journey through the pipeline so that you can get a overview of how it works.
- Details: Vertex, Primitive and Fragment Processing, the framebuffer, compute shaders
- Techniques: Lighting, shadows, cell shading, SSAO, fractals
- Advanced techniques: compute shaders, pipeline monitoring, loading, and arbitrating access to data, artistic and non-photorealistic effects. AZDO Techniques and how to debug OpenGL Applications. There is even a chapter about not core, but very important extenstions like Sparse textures and bindless graphics.
- The latest version of the book focuses on OpenGL 4.5. This is important because in OpenGL 4.5 we should be using direct state access functions rather than bind and update.
- Older versions of the book contained chapters about Platform specifics.
The book gives all the information needed to start and even become quite proficient with OpenGL. The book is both for beginners but also for people very familiar with graphics APIs. as you can see, there are basic chapters, as well as very advanced topics. The writing style is great and no one should have problems with understanding it. The size is around 1000 pages. I guarantee that you'll be often returning to the content of this amazing book.
It is also worth mentioning that there is a lot of online content that can help you. One of the best available tutorials about modern OpenGL (3.3+) comes from Jason L. McKesson in his arcsynthesis tutorials. Another good site is open.gl and lighthouse3d core and also learnopengl.com.
Additionally, if you want to get even more graphics theory, you can take a look at those two 'core' books:
-
Where to Continue?
s
Normal Mapping with GLSL
When you have the base and know how to use OpenGL, then you can choose in what area you want to go.
Some time ago, a person would usually go into rendering engine development - meaning more graphics effects. But today, we also have web and mobile apps so your focus can be different.
For 'normal' graphics development, I suggest investing some money in two books that appeared recently - two cookbooks actually!
One of them is OpenGL 4 Shading Language Cookbook and the second one is OpenGL Development Cookbook.
Cookbooks
OpenGL 4 Shading Language Cookbook - Second Edition
The idea of programming recipes was quite new to me, but I liked it from the beginning. In both mentioned books, there are lots of different sub-chapters that could be read almost in any order. We usually start with some simpler examples and move towards advanced ones, but still the structure is more loose as with 'common' programming books.
OpenGL 4 Shading Language is a great resource for learning almost the newest version of OpenGL - 4.3. It was refreshed recently and the content got even better. We have the following topics covered:
- The first two chapters introduce to GLSL and modern OpenGL
- Another two about Lighting and Texture usage (for instance, immutable textures!)
- Chapter 5 about image processing and screen space effects (like blur and hdr)
- Then there is a chapter about tesselation and geometry shaders
- Chapter 7 covers Shadows techniques
- Two others describe Noise and Particle animations
- Then, the last one touches on Compute shaders
Those topics create a very decent base for any graphics programmer.
The second book - OpenGL Development Cookbook - has a similar style as the first one. It uses OpenGL 3.3 - so a bit older, but still valid. The book describes similar areas: introduction to OpenGL, GLSL, lighting, shadows... but examples are different than in the first book. You can compare examples and get some new perspective and coding techniques.
What is important, OpenGL Development Cookbook adds some other valuable chapters to our graphics knowledge bag:
- Volume rendering
- Global illumination
- 3D Mesh file formats
- Animation systems and physics
All in all, you could treat both of those books as one pack. BTW: you can read my full review of OpenGL Development Cookbook in a separate codeproject article.
Those two cookbooks have great value for me because they fill a niche among graphics programming books. At one side, we have introductory level books like SuberBible, on the other side there are more 'hardcore' books like GPU Pro or ShaderX (and recent OpenGL Insights). The cookbooks fall in the middle and are great resources for anyone with some good OpenGL knowledge who wants to go further.
Is C++ Always Needed?
As you have probably noticed, all of the mentioned books and websites used C++ as a language for code samples. C++ seems to be the most popular choice in this area. But if you know other languages, you are not doomed!
OpenGL is only API and there are lots of different language bindings.
So:
- For Java, take a look at: Java™ Binding for the OpenGL® API or LWJGL
- BTW: LWJGL was used by Minecraft
- Additionally, most Android Apps use its Java based SDK to render graphics using OpenGL ES.
- For mobile development (and also HTML5), take a look at libgdx - it is a cross platform game and visualization development framework, based on OpenGL ES 2.0 and 3.0. Language: Java
- For C# (or Visual Basic) - .NET platform - look at openTK
- For JavaScript, just use WebGL
- Additionally for other languages, go here - opengl wiki pages
It is worth noticing that no matter what programming language you chose, the graphics theory is the same. So if you know how to make a graphics effect in one language, then it should be relatively easy to do it similarly in some different language.
The Hardware
Currently (December 2014, latest drivers) most of recent desktop GPUs will support OpenGL 4.* or at least 3.*.
Below you can find a quick summary:
GPU
Supported OpenGL Version
NVidia GeForce 6 and 7 Series
OpenGL 2.1
Tesla: NVidia GeForce 8, 9 100, 200, 300 Series
OpenGL 3.3
Fermi: NVidia GeForce 400, 500 Series
OpenGL 4.5
Kepler and Maxwell: NVidia GeForce 600, 700 800M, 900 Series
OpenGL 4.5
AMD Radeon R300, R400, R500,
OpenGL 2.0
AMD Radeon R600 (HD2000, HD3000), R700 (HD4000)
OpenGL 3.3
AMD Evergreen (HD5000)
OpenGL 4.5
AMD * Islands (HD6000, HD7000 and HD8000)
OpenGL 4.5
AMD Volcanic Islands (R7 and R9) and newer
OpenGL 4.5
Intel(R) HD Graphics 2000/3000 (Sandy Bridge)
OpenGL 3.1
Intel(R) HD Graphics 2500/4000 (Ivy Bridge)
OpenGL 4.0
Intel(R) HD Graphics 4400/4600/5000 (Haswell)
OpenGL 4.3
If you want some more details take a look at this wonderful OpenGL Hardware Database
AZDO
Some time ago (at GDC 2014) there was a great presentation delivered about achieving even more performance with OpenGL. This whole set of ideas is called AZDO - "Approaching Zero Driver Overhead". As the name suggests this approach focuses on minimalizm the driver work. Very often gpu has a lot of available power, but it has to wait for the driver to finish some work.
Short summary of techniques:
- How to update buffers so that they do not create stalls in the pipeline (fe persistent_mapped_buffer, orphaning, multi buffering)
- explicit synchronization (fences, locking)
- minimize number of draw calls (fe. draw indirect, batches)
- packing textures into arrays for faster access, using bindless textures , sparse textures
AZDO is complicated but powerful. It can unlock a lot of power in your engine. This is also a good starting point for new graphics API like do DirectX 12 or Vulkan - in which the driver will be minimalistic and all the work will be dependent on clients(programmers).
OpenGL Next and Vulkan?
Announced at GDC 2015 in San Francisco, and then officially published on February 16th 2016 (Khronos), Vulkan is a new API that should unlock even more power from the hardware.
From the official Khronos presentation:
As you can see with Vulkan we'll get more direct control over GPU/CPU. The driver work is minimized. Of course, Vulkan is multiplatform: from high end PC to low end mobile devices (Except for Mac OS). Theoretically, we should see more framerates, more object on the screen and better hardware utilization.
The flexibility and performance comes at some cost though. You get the control, but most of the things the driver did (synchronization, buffere management, shader management, multithreading, command buffers) will have to be handled by your engine. Large engines do such management anyway, thus they should benefit the most. But if you're doing a simple simulation, with basic rendering that can hurt. Even simple Vulkan demos contains hundreds of lines of code just for some basic stuff.
While not for everyone, Vulkan brings a lot of promises. It's completely new, so there is no overhead of the legacy functionality. If you take graphics programming seriously, please check out code samples and Vulkan examples.
Vulkan Resource list from Geeks3d
Resources and Links
- GLSL Core Tutorial » Lighthouse3d.com - GLSL Tutorial for Core versions
- OpenGL - Introduction - An extensive, yet beginner friendly guide to using modern OpenGL for game development on all major platforms
- Learning Modern 3D Graphics Programming - A great tutorial from Jason L. McKesson
- reddit/r/opengl - One of the central points with news, questions and tutorials
- learnopengl.com - another grat source for learning OpenGL (available also as a free PDF)
- Original AZDO presentation from GDC 2014 Vault
-
Conclusion
s
Water on GPU + Normal Mapping Source: Simple Water Simulation
In this article, I tried to give you enough resources to start and make good progress with graphics programming. OpenGL is a very popular technology right now. A lot of new possibilities will be available for anyone with decent graphics API experience. You can not only make AAA game engines, but also move into web or mobile development. And with Vulkan there's even more (low level) fun!
Have a nice journey with Modern OpenGL!
You can also see more about OpenGL at Bartek's blog: http://www.bfilipek.com/.
OpenGL book list的更多相关文章
- 【AR实验室】OpenGL ES绘制相机(OpenGL ES 1.0版本)
0x00 - 前言 之前做一些移动端的AR应用以及目前看到的一些AR应用,基本上都是这样一个套路:手机背景显示现实场景,然后在该背景上进行图形学绘制.至于图形学绘制时,相机外参的解算使用的是V-SLA ...
- [OpenGL超级宝典]专栏前言
我小时候的梦想呢,是做宇航员或者科学家或者是做一款属于自己的游戏,后来前面两个梦想都没有实现,于是我就来实现我的第三个梦想了,,,我呢,也算是零基础,因为我的专业是物联网工程,这个专业覆盖面之广,简直 ...
- OpenGL超级宝典笔记----渲染管线
在OpenGL中任何事物都在3D空间中,但是屏幕和窗口是一个2D像素阵列,所以OpenGL的大部分工作都是关于如何把3D坐标转变为适应你屏幕的2D像素.3D坐标转为2D坐标的处理过程是由OpenGL的 ...
- OpenGL超级宝典笔记----框架搭建
自从工作后,总是或多或少的会接触到客户端3d图形渲染,正好自己对于3d图形的渲染也很感兴趣,所以最近打算从学习OpenGL的图形API出发,进而了解3d图形的渲染技术.到网上查了一些资料,OpenGL ...
- 现代3D图形编程学习-基础简介(3)-什么是opengl (译)
本书系列 现代3D图形编程学习 OpenGL是什么 在我们编写openGL程序之前,我们首先需要知道什么是OpenGL. 将OpenGL作为一个API OpenGL 通常被认为是应用程序接口(API) ...
- OpenGL shader 中关于顶点坐标值的思考
今天工作中需要做一个事情: 在shader内部做一些空间距离上的计算,而且需要对所有的点进行计算,符合条件的显示,不符合条件的点不显示. 思路很简单,在vertex shader内知道顶点坐标,进行计 ...
- OpenGL: 纹理采样 texture sample
Sampler (GLSL) Sampler通常是在Fragment shader(片元着色器)内定义的,这是一个uniform类型的变量,即处理不同的片元时这个变量是一致不变的.一个sampler和 ...
- OpenGL ES 3.0: 图元重启(Primitive restart)
[TOC] 背景概述 在OpenGL绘制图形时,可能需要绘制多个并不相连的图形.这样的情况下这几个图形没法被当做一个图形来处理.也就需要多次调用 DrawArrays 或 DrawElements. ...
- opengl 笔记(2)
/*- * Opengl Demo Test * * Fredric : 2016-7-10 */ #include <GLUT/GLUT.h> #include <stdlib.h ...
- opengl 笔记(1)
参考<opengl入门教程>.<OpenGL之坐标转换>.<OpenGL绘制管线操作细节>等资料. 复习下留个备忘:) /*- * Opengl Demo Test ...
随机推荐
- Synchronize Ultimate
支持多种服务器和主流云网盘进行同步 http://www.icecoldapps.com/ Unlock Code : xda201506 Unlock Code : icecoldapps20150 ...
- WinForm通用自动更新器AutoUpdater项目实战
一.项目背景介绍 最近单位开发一个项目,其中需要用到自动升级功能.因为自动升级是一个比较常用的功能,可能会在很多程序中用到,于是,我就想写一个自动升级的组件,在应用程序中,只需要引用这个自动升级组件, ...
- iOS 获取本地视频的缩略图
+(UIImage *)getImage:(NSString *)videoURL { AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:[NSU ...
- 字符串类型的变量,也要进行alloc内存分配之后才能用
nss_upperName =[[NSStringalloc]initWithString:labTopTitle.text]; nss_upperName =labTopTitle.text; // ...
- Asp.Net中使用Couchbase——Memcached缓存入门篇
本文个人同步博客地址: http://aehyok.com/Blog/Detail/96.html 个人网站地址:aehyok.com QQ 技术群号:206058845,验证码为:aehyok 本文 ...
- ios之两个view传值
delegate:demo使用场景,我有A,B两个controller,A是root,跳转到B,B的数据输入完返回A且携带数据显示到A. A.h #import <UIKit/UIKit.h&g ...
- 用ArrayAdapter来创建Spinner(自定义布局、默认布局、动态内容、静态内容)
android:dropDownWidth 下拉列表宽度 android:dropDownHorizontalOffset 下拉列表距离左边的距离 android:dropDownV ...
- 《Google Glass开发指南》
<Google Glass开发指南> 基本信息 作者: BestApp工作室 丛书名: 图灵原创 出版社:人民邮电出版社 ISBN:9787115349477 上架时间:2014-3-19 ...
- [Web 前端] this作用域问题
如何不用这种写法:理想的写法是this.setState({ .... }) 可能是我没有描述清楚,我不想用这种学法而已,这样多了一个变量,我觉得很不舒服.我尝试了先把 setState 赋值到变量里 ...
- CoreDNS介绍
本文介绍 CoreDNS 相关配置以及验证方法,实验环境为 Kubernetes 1.11,搭建方法参考kubeadm安装kubernetes V1.11.1 集群 busybox 的槽点 开始之前先 ...