原文链接:http://www.cnblogs.com/vertexshader/articles/2917540.html
OpenGL®作为业界最为广泛使用的2D和3D图形接口标准,应用在成千上万的各式各样的计算机的程序中。从初期的崭露头角,到与Direct3D激烈竞争,后经历黯淡被Khronos接手又发扬光大,已经历经波折发展了20年。由于过去的黯淡,至今甚至仍有人站在错误的时间角度认为它是落后的——它从未停止它前进的步伐,这篇文章就来简述OpenGL的版本历史和发展。
OpenGL
发布时间:
OpenGL的最早版本OpenGL
OpenGL
发布时间:1997年1月
扩展 | 特性增加 |
| |
Polygon | |
| |
| |
| |
|
时隔5年OpenGL才发布新的版本OpenGL1.1,而Direct3D的出现(尤其是红色警戒的大卖)使得OpenGL感觉到了压力。顶点数组(Vertexarrays)的出现取代了glVertex*这类立即模式绘图函数,多个数据可以被一个函数调用绘制了,降低了调用函数带来的CPU循环开销;polygonoffset解决了z-fighting和stitching的问题;在pre-fragmentoperation开始支持逻辑操作(logic operation);纹理方面开始支持纹理代理(textureproxy)和纹理环境映射(textureenvironment),以及从帧缓冲(frameuffer)复制像素至texture或者subtexture;纹理对象(textureobject)的出现改变了过去只能使用显示表(display list)来静态地使用纹理的方法,现在纹理和参数(textureparameter)能被改变了。
OpenGL
发布时间:1998年3月16日
扩展 | 特性 |
Three-dimensionaltexture | |
BGR or BGRA pixelformat | |
| |
| |
| |
| |
| |
|
OpenGL
发布时间:1998年10月14日
OpenGL
发布时间:2001年8月14日
扩展 | 特性增加 |
| |
| |
| |
GL_ARB_multitexture(removed) | |
Texture add envmode, texture combine env mode, texture dot3 env mode | |
| |
|
这个版本开始支持压缩纹理(compressedtexture),可以有效地减少存储和带宽的压力,现在广泛的应用于各种对存储大小和带宽敏感的手持设备上;立方体纹理(texturecube)的出现主要用于在天空盒(skybox)、动态反射(dynamicreflection)等技术上;而multisample的出现让OpenGL可以支持纹理和Framebuffer的MSAA抗锯齿技术,代替了过去在光栅化状态(rasterizerstate)中趋近无用的抗锯齿设置。
OpenGL
发布版本:2002年7月24日
扩展 | 特性增加 |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
这个版本开始支持纹理自动生成Mipmap;以及关于point光栅化的parameter。
OpenGL
发布时间:2003年7月29日
扩展 | 特性增加 |
| |
| |
|
OpenGL
发布时间:2004年9月7日
扩展 | 特性增加 |
| |
| |
| |
| |
|
OpenGL
发布时间:2006年7月2日
扩展 | 特性增加 |
| |
|
这个版本增加了像素缓冲对象(pxielbuffer object),用来更快地像素传输(pixel tansfer)的工作,支持将像素从纹理对象(textureobject)和帧缓冲对象(framebuffer object)包装到(pack)像素缓冲对象(pixel bufferobject),或者从像素缓冲对象解包装到纹理对象和帧缓冲对象,另外像素缓冲对象也可以像普通的缓冲对象(bufferobject)一样被映射(map)更新数据,通过DMA的方式更加快地传输纹理;同时支持sRGB格式的纹理对象。
代号LongsPeak和OpenGL
OpenGL
发布日期:2008年8月11日
扩展 | 特性增加 |
| |
| |
| |
| |
| |
| |
| |
| |
Intergral imageformats |
- Application-generatedobject names
- Color indexmode
- Shading language1.10 and 1.20
- Begin/End primitivespecification
- Edgeflags
- Fixed functionvertex processing
- Client-side vertexarrays
- Rectangles
- Current rasterposition
- Two-sided colorselection
- Non-spritepoints
- Wide linee and linestrip
- Quadrilateral andpolygon primitives
- Sepatate polygondraw mode
- Polygonstripple
- Pixel transgermodes and operations
- Pixeldrawing
- Bitmaps
- Legacy OpenGL 1.0pixel formats
- Legacy pixelformats
- Depth texturemode
- Texture wrap modeCLAMP
- Textureborders
- Automatic mipmapgeneration
- Fixed functionfragment processing
- Alphatest
- Accumulationbuffers
- Context framebuffersize queries
- Evaluators
- Selection andfeedback mode
- Displaylists
- Hints
- Attributestacks
- Unified extensionstring
这个版本正式把帧缓冲对象(framebufferobject)划入core profile,现在OpenGL也具有离线的帧缓冲了,就像Direct3D的output-mergerstage专门管理render target和接收fragmentshader的输出;增加了许多GLSL的函数,尤其是texture方面的;帧缓冲对象之间可以互相拷贝像素到持有的不同的rendertarget,是性能上的提升;增加了浮点型和整型的texture和depth的imageformat;另外也增加了RGTC这个自带的纹理压缩模式;最为重要的增加就是transformfeedback,数据可以经过vertex shader和geometryshader之后,又输出回buffer而不经过rasterization以及之后的阶段,在物理和粒子的计算上面非常的有用;增加的vertexarray object方便管理buffer object以及vertex attribpointer和其开启/关闭状态,不必每次在渲染前都要设置一遍了;增加了重要的条件渲染(conditionalrendering)。
发布日期:2009年3月24日
扩展 | 特性增加 |
| |
| |
| |
| |
| |
|
有了Instancedrendering,减轻了同类物体绘制所占有的带宽压力;Copybuffer的出现,是让数据在client端进行拷贝,也是一种性能的优化;Buffer texture其实是让bufferobject像texture那样被访问,在某些特殊的场合有意想不到的用途;不得不谈的就是uniform bufferobject,过去OpenGL上传uniform数据需要靠glUniform*的函数进行上传,而OpenGL每个函数的调用所消耗的CPU循环都非常的大,频繁地调用glUniform*会带来很大的性能问题,而且到后期这些单个的uniform也会被保存至OpenGL管理的defaultuniform buffer中,现在开放了uniform bufferobject,通过map/unmap更新数据,函数调用开销明显地减少。
OpenGL
发布日期:2009年8月3日
扩展 | 特性增加 |
| |
| |
| |
| |
| |
| |
| |
| |
|
这个版本最重磅的支持就是几何着色器(geometryshader),可以用来生成新的图元类型(点、线和三角形),后期重要的tessellation等技术都会使用到它;还有一个就是Texture正式支持multisample,可以作为rendertarget来进行framebufferobject上的抗锯齿,而不是经过的WGL_ARB_multisample和GLX_ARB_multisample进行窗口的抗锯齿。
OpenGL
发布日期:2010年3月11日
扩展 | 特性增加 |
| |
| |
| |
| |
| |
| |
| |
|
这个版本是shader model4.0的OpenGL的最终版本,这个版本改变了程序需要查询输入变量(attribute)的location的方式,可以像HLSL指定semantic一样在shader里指定layout,减少了相应API的调用;同时将textureobject和sampler state解耦,增加了sampler object,samplerobject也可以绑定到ACTIVE_TEXTURE上了。
OpenGL
发布日期:2010年3月11日
扩展 | 特性增加 |
| |
| |
| |
| |
| |
|
这个版本和OpenGL3.3同时发布,增加了令人兴奋的Tessellation Shader;Shader Language4.00的subroutine提供了在运行时刻不需要切换着色器或者是重新编译或者使用if判断选择不同功能的方法,降低了切换着色器程序所带来的巨大开销(切换着色器的CPU循环消耗真的非常的惊人);另外GL_ARB_draw_buffers_blend让fragmentshader输出的每条buffer都可以完成各自的pre-fragmentoperaion,而不是像过去那样每条都完成相同的pre-fragmentoperation;GL_ARB_transform_feedback2和GL_ARB_transform_feedback3提供了transformfeedback object,以及transform feedback相关的控制(比如pause之类),也把transformfeedback当做一个对象来进行处理。
OpenGL
发布日期:2010年7月26日
扩展 | 特性增加 |
| |
| |
| |
| |
| |
Provoids 64-bitfloating-point component vertex shader inputs |
这个版本把OpenGLES的一些功能划入core profile的范围,一方面反映出了OpenGLES巨大的成功;GL_ARB_get_program_binary提供了可以将shader事先编译好序列化进入二进制文件,避免了运行时进行编译的方法;这个版本也提供了64位的浮点型输入变量,提升了数据精度。
OpenGL
发布日期:2011年8月8日
扩展 | 特性增加 |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
OpenGL
发布日期:2012年8月6日
扩展 | 特性增加 |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Get size of imagesfrom GLSL | |
| |
| |
| |
| |
| |
| |
|
扩展 | 特性增加 |
| |
| |
| |
| |
Introduces amechanism whereby the result of a query object may be retrievedinto a buffer object instead of client memory. | |
| |
AcceptSTENCIL_INDEX8 as a texture internal format. | |
New vertexattribute data format. | |
| |
| |
| |
Allow aimplementation to provide a per-texture setting for enablingseamless sampling from cube maps. | |
Add a built-invariable gl_DrawID in OpenGL Shading Language. | |
Add new built-infunctions to compute the cmpoite of a set of boolean conditionsacross a group of shader invocations. | |
Allows theseparation of the graphics processors address space from therequirement that all textures must be physically backed. |
附录
OpenGL 4.4pipeline
Q&A:
Q:OpenGL已经落伍了,更新的也非常的慢,再努力几年也赶不上技术雄厚的Direct3D。
A:近几年KhronosGroup接手OpenGL之后,发展速度迅猛,新版本的OpenGL已经更新到了OpenGL 4.4,其功能略超过Direct3D11,且被Nvidia和AMD主流显卡全面支持;值得注意的是有96.8%手持设备都只使用桌面OpenGL的子集OpenGLES作为他们的图形编程接口;许多家用游戏机也使用OpenGL作为其图形的编程接口。OpenGL已经重新回到主流的地位,我想或许你的教科书真的是太老了!
Q:OpenGL的功能会比Direct3D少,且OpenGL的速度不如Direct3D来得快。
A:PC上的OpenGL和Direct3D工作在同样的硬件上,他们的功能是基本一致的,另外你应该看看这个。
Q:从哪里才能下载到OpenGL的SDK?
A:OpenGL并没有SDK,想要启用高级OpenGL都是通过获取相应的函数指针来完成的,当然必须由显卡的驱动支持才行。不过有些库可以帮你完成这类繁琐的工作,比如GLEW。
Q:OpenGL的扩展是什么?
A:OpenGL功能的实现都是靠一个个扩展实现的,如果实现了OpenGL版本规范规定的扩展,那么就是实现了相应的OpenGL扩展。
Q:我如何知道我的设备支持了多少OpenGL扩展以及什么OpenGL扩展?
A:在编程中你可以使用特定的库比如GLEW检测相应的扩展是否被支持;你也可以下载OpenGLExtensionsViewer直观的查看支持的OpenGL的特性和扩展,这个软件也有多个平台的版本。
Q:感觉OpenGL的文档都太不详细了,我在搜索引擎里搜索的结果都很令人失望。
A:详细的OpenGL文档都在其官网里:①OpenGLRegistry里面有上百个OpenGL扩展的文档;②OpenGLReference Page里面有各个函数的使用方法;③OpenGLReference Card能帮助你宏观地了解OpenGL的所有主要函数;④OpenGLSpecification其实是扩展文档的集合,不过也是非常的详细和有用。
Q:什么是CoreProfile和Compatibility Profile?
A:在OpenGL的发展历程中,总是兼顾向下兼容的特性,但是到了一定的程度之后,这些旧有的OpenGLAPI不再适应时代的需要,还有一些扩展并不是驱动一定要实现的扩展,这些被统一划入可选的CompatibilityProfile;而由OpenGL规范规定必须支持的扩展,则是Core Profile,想要支持先进的OpenGL,相应的CoreProfile扩展必须被实现。
Q:有什么好的入门书籍可以介绍吗?
A:《OpenGLSuperbible》和《OpenGL Shading Language Cookbook》以及《OpenGLInsights》都非常的不错。
Q:OpenGL如何进行Debug,DirectX的PIX真的很好用呢。
A:现在支持GLSL和OpenGL跟步调试的只有Nvidia的Nsight,只支持Nvidia的显卡;其他的基本都是track,不支持GLSL的跟步调试,比如AMD的GPUPerfClient以及gDEBugger。还有AMD的GPUShaderAnalyzer也非常的不错,能看到相应的GLSL汇编代码。
Q:OpenGL有多少引擎支持呢!
A:基本主流的引擎都会在上层抽象一层,然后都有用OpenGL和Direct3D分别实现的模块;绝大部分的主流引擎都留有了OpenGL的实现。
Q:网上很多Tutorias都很老了,Nehe也落伍了,有没有比较好的Tutorias呢?
A:当然有!看看这个。