13/03/2012 OpenGL ES 2.0 and EGL on desktop, updated. OpenGL ES 2.0 on Windows 7. On AMD side, OpenGL ES 2 is brought to desktop thanks. On the library point. 由于Windows上的OpenGL程序最终都会动态链接到微软的OpenGL32.dll,可OpenGL32.dll只支持OpenGL 1.1,使我们不能直接使用. 这个问题在OpenGL 2.0出来后可能. Group组织今天又对其进行了第二次升级,放出了新的3.2版本,而NVIDIA也再次紧随而至,第一家发布了相关驱动程序。OpenGL 3.2. opengl es 3.0 软件截图 查看全部 1. 第一件你需要搞清楚的事,是 OpenGL ES 1.0 和 2.0 的区别。 他们有多不一样?我只能说他们很不一样。 OpenGL ES1.0 :. ·然后,使用 math library 来创建投影. OPENGL]windows平台下使用Open. GL. - 博客频道今天在用VBO的时候编译器提示找不到标识符,VBO不是已经成为Opengl核心了吗!!查了下原来微软把GL阉割了。。“一些常用的Open. GL扩展会在新版的Open. GL中加到Open. GL核心中去,成为Open. GL标准的一部分,可以简化程序开发,程序员使用这些功能时不必做繁琐的扩展初始化工作。比如多重纹理功能,在Open. GL1. 2. 1加入到Open. GL核心中,以前要使用多重纹理,要先检查是否支持GL_ARB_multitexture扩展,然后初始化gl. Active. Texture. ARB等函数,很麻烦,而Open. GL1. 2后,则可以直接使用gl. Active. Texture函数。不过,这种简化只有Mac/Unix/Linux程序员才能享受到,在Windows平台上没有这么简单。微软为了维护Direct. D,对Open. GL 的支持很消极,其Open. GL实现仍然是1. 1。由于Windows上的Open. GL程序最终都会动态链接到微软的Open. GL3. 2. dll,可Open. GL3. 2. dll只支持Open. GL 1. 1,使我们不能直接使用新版Open. GL,仍然要用扩展访问Open. GL1. Open. GL版本比较1 opengl的版本区别(在opengl官方文档中有详细说明)针对Opengl不同版本的升级是主要是扩展指令集。1. SGI推出了更为完善的Open. GL 1. Open. GL 1. 1的性能比1. Open. GL的调用,顶点数组的新特性,提高顶点位置、法线、颜色、色彩指数、纹理坐标、多边形边缘标识的传输速度,引入了新的纹理特性等等。1. ARB发布Open. GL 1. 3规范,它增加了立方纹理贴图、纹理环境、多重采样、纹理框架压缩等扩展指令,但是改进程度非常有限。1. ARB正式发布Open. GL 1. ARB公布Open. GL 1. 5规范。 Open. GL 1. 5内包含ARB制定的“正式扩展规格绘制语言”(Open. GL Shading Language v. Open. GL 2. 0版本的内核。 Open. GL 1. 5的变化还增加了顶点缓冲对象(可提高透视性能)、非乘方纹理(可提高纹理内存的使用效率)以及阴影功能、隐蔽查询功能等等。其主要内容包括l 顶点Buffer Object:进行顶点配列方式可以提高透视性能l Shadow功能:增加用来比较Shadow映射的函数l 隐蔽查询(QUERY):为提高Curling性能采用非同步隐蔽测试l 非乘方纹理(Texture):提高mipmap等纹理内存的使用效率l Open. GL Shading Language v. Open. GL 1. 0推出后的相当长的一段时间里,Open. GL唯一做的只是增加了一些扩展指令集,这些扩展指令是一些绘图功能,像是Clear. Coat、 Multisample、视频及绘图的整合工具(某些是通过Open. ML的努力而开发出来的,它本身属于Open. GL ARB扩展指令之一。去年 8月已经推出opengl. Open. GL 2. 0将在Open. GL 1. 3基础上进行修改扩充、但它将有下面五个方面的重大改进:①复杂的核心被彻底精简;②完全的硬件可编程能力;③改进的内存管理机制、支持高级像素处理;④扩展至数字媒体领域,使之跨越高端图形和多媒体范畴;⑤支持嵌入式图形应用。为了在获得强大功能的同时保持理想的兼容性,Open. GL 2. 0经历以下两个发展阶段:第一个阶段注重兼容能力和平滑过渡,为此,Open. GL 2. 0核心将在精简后的Open. GL 1. 3功能模块的基础上加上可完全兼容的新功能共同组成,这种做法在满足兼容性的同时,还可将原有Open. GL中数量众多、且相互纠缠不清的扩展指令进行彻底精简。第一阶段的任务只是为了过渡,而第二阶段才是Open. GL 2. 0的真正成熟期。此时,ARB将合成出一个“纯Open. GL 2. 0”内核,纯内核将包含更多新增加的“精简型API函数”,这些函数具有完全的可编程特性、结构简单高效、功能强大且应用灵活。除了完成这项任务外, ARB组织还得指导开发商抛弃繁琐的Open. GL 1. X、转用更具弹性的“纯Open. GL 2. 0”。2 Open. GL扩展(Open. GL Extensions)Open. GL 和Direct. 3D比较起来,最大的一个长处就是其扩展机制。硬件厂商开发出一个新功能,可以针对新功能开发Open. GL扩展,软件开发人员通过这个扩展就可以使用新的硬件功能。所以虽然显卡的发展速度比Open. GL版本更新速度快得多,但程序员仍然可以通过Open. GL使用最新的硬件功能。而Direct. D则没有扩展机制,硬件的新功能要等到微软发布新版Direct.
X后才可能支持。Open. GL扩展也不是没有缺点,正因为各个硬件厂商都可以开发自己的扩展,所以扩展的数目比较大,而且有点混乱,有些扩展实现的相同的功能,可因为是不同厂商开发的,接口却不一样,所以程序中为了实现这个功能,往往要为不同的显卡写不同的程序。这个问题在Open. GL 2. 0出来后可能会得到解决,Open. GL 2. 0的一个目标就是统一扩展,减少扩展数目。2. GL_ARB_multitexture第一段GL,用来表示针对Open. GL哪部分开发的扩展,有以下几个值:GL – 针对Open. GL核心的扩展WGL – 针对Windows平台的扩展GLX – 针对Unix / Linux平台的扩展GLU – 针对Open. GL Utility Library的扩展第二段ARB,用来表示是谁开发的这个扩展,常见以下几个值:ARB – 经Open. GL Architecture Review Board(Open. GL管理机构)正式核准的扩展,往往由厂商开发的扩展发展而来,如果同时存在厂商开发的扩展和ARB扩展,应该优先使用ARB扩展EXT – 被多个硬件厂商支持的扩展NV – n. VIDIA 公司开发的扩展ATI – ATI公司开发的扩展ATIX– ATI公司开发的实验性扩展SGI – Silicon Graphics(SGI)公司开发的扩展SGIX– Silicon Graphics(SGI)公司开发的实验性扩展第三段multitexture就是真正的扩展名了,如multitexture就是多重纹理扩展。2. Open. GL扩展要使用一个Open. GL扩展,首先必须检查显卡是否支持这个扩展,以下代码可以获取一个显卡支持的的Open. GL扩展:const char *str = gl. Get. String( GL_EXTENSIONS ); 函数返回一个字符串指针,这个字符串就是显卡所支持的所有扩展的扩展名,不同的扩展名之间用空格隔开,形如:"GL_ARB_imaging GL_ARB_multitexture GL_ARB_point_parameters ……"Open. GL扩展往往都会新增一些函数,在Windows平台上,这些函数不是通过. GL_ARB_point_parameters扩展为例看看怎么获得函数指针。首先要定义函数指针类型,typedef void (APIENTRY * PFNGLPOINTPARAMETERFARBPROC)(GLenum pname,GLfloat param); typedef void (APIENTRY * PFNGLPOINTPARAMETERFVARBPROC)(GLenum pname,const GLfloat *params); 这个工作SGI已经为我们做好,它提供了一个头文件glext. GL文件夹下面,然后在程序里面加上:#include < GL/glext. PFNGLPOINTPARAMETERFARBPROC gl. Point. Parameterf. ARB; PFNGLPOINTPARAMETERFVARBPROC gl. Point. Parameterfv. ARB; 再检查显卡是否支持GL_ARB_point_parameters扩展,其中is. Extension. Supported是自定义的一个函数,就是在gl. Get. String( GL_EXTENSIONS )返回的字符串里查找是否存在指定的扩展名:int has. Point. Params = is. Extension. Supported("GL_ARB_point_parameters"); 如果支持,就可以用wgl. Get. Proc. Address函数获取扩展函数的指针:if (has. Point. Params){gl. Point. Parameterf. ARB = (PFNGLPOINTPARAMETERFARBPROC)/wgl. Get. Proc. Address( "gl. Point. Parameterf. EXT" ); gl. Point. Parameterfv. ARB = (PFNGLPOINTPARAMETERFVARBPROC) /wgl. Get. Proc. Address( "gl. Point. Parameterfv. EXT" ); }最后就可以在程序里使用扩展函数:if (has. Point. Params){static GLfloat quadratic[3] = { 0. Point. Parameterfv. ARB(GL_DISTANCE_ATTENUATION_ARB, quadratic); gl. Point. Parameterf. ARB(GL_POINT_FADE_THRESHOLD_SIZE_ARB, 1. Get. Proc. Address函数访问一个不在标准Open. GL库中的扩展函数。如果该扩展函数存在当前的执行(implementation) 中,那么wgl. Get. Proc. Address返回一个用来访问该函数的函数指针。否则,wgl. Get. Proc. Address返回NULL.例如,要访问gl. Add. Swap. Hint. Rect. WIN扩展函数,如下调用wgl. Get. Proc. Address: // Get a pointer to the extension function. WINAPI *FNSWAPHINT)(GLint, GLint, GLsizei, GLsizei); fn. Swap. Hint = (FNSWAPHINT)wgl. Get. Proc. Address("gl. Add. Swap. Hint. Rect. WIN"); // Actual call to gl. Add. Swap. Hint. Rect. WIN. if (fn. Swap. Hint != NULL)(*fn. Swap. Hint)(0, 0, 1. WGL扩展gl. Get. String( GL_EXTENSIONS )取得的扩展字符串中并不包括针对Windows平台的WGL扩展,WGL扩展串要通过WGL_ARB_extensions_string扩展来获得,以下代码演示了如何获得WGL扩展串:定义WGL_ARB_extensions_string扩展新增函数wgl. Get. Extensions. String. ARB的函数指针类型,同样这个工作SGI已经为我们做好,只不过不在glext. APIENTRY * PFNWGLGETEXTENSIONSSTRINGARBPROC)(HDC hdc); 定义函数指针:PFNWGLGETEXTENSIONSSTRINGARBPROC wgl. Get. Extensions. String. ARB; 检查是否支持WGL_ARB_extensions_string扩展,如果不支持,表示这个显卡不支持WGL扩展,如果支持,则得到wgl. Get. Extensions. String. ARB函数的指针,并调用它得到WGL扩展串:int has. WGLext = is. Extension. Supported("WGL_ARB_extensions_string"); if (has. WGLext){wgl. Get. Extensions. String. ARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC) /wgl. Get. Proc. Address( "wgl. Get. Extensions. String. ARB" ); const char *wgl. Ext = wgl. Get. Extensions. String. ARB( hdc ); ……}2. Open. GL版本一些常用的Open. GL扩展会在新版的Open. GL中加到Open. GL核心中去,成为Open. GL标准的一部分,可以简化程序开发,程序员使用这些功能时不必做繁琐的扩展初始化工作。比如多重纹理功能,在Open. GL1. 2. 1加入到Open. GL核心中,以前要使用多重纹理,要先检查是否支持GL_ARB_multitexture扩展,然后初始化gl. Active. Texture. ARB等函数,很麻烦,而Open. GL1. 2后,则可以直接使用gl. Active. Texture函数。不过,这种简化只有Mac/Unix/Linux程序员才能享受到,在Windows平台上没有这么简单。微软为了维护Direct. D,对Open. GL 的支持很消极,其Open. GL实现仍然是1. 1。由于Windows上的Open. GL程序最终都会动态链接到微软的Open. GL3. 2. dll,可Open. GL3. 2. dll只支持Open. GL 1. 1,使我们不能直接使用新版Open. GL,仍然要用扩展访问Open. GL1. Open. GL扩展资料All About Open. GL Extensions :必读。讨论Open. GL扩展机制,讲述了如何阅读扩展官方说明书,并举了一些扩展的例子。Open. GL Extension Registry :由SGI维护,列出了目前公开的所有扩展及其官方说明书。Open. GL Hardware Registry :由Delphi. D. net维护,列出了目前几乎所有3. D加速卡的Open. GL硬件信息,包括其支持的扩展。当然,这里面列的扩展不能作为程序的依据,程序中要使用某个扩展,还是要先检查显卡是否支持。因为同样的显卡,如果驱动程序不同,支持的扩展也不相同,往往新的驱动程序会加入新的扩展,丢掉一些废弃的扩展。2. Open. GL硬件加速在Windows平台上,Open. GL驱动可能有三种模式:纯软件、MCD和ICD:纯软件模式:微软提供一个Open. GL的软件实现,所有渲染操作均由CPU完成,速度很慢。如果安装系统时使用Windows自带的显卡驱动程序,那么Open. GL程序就会运行在软件模式下。而且由于微软有自己的Direct. D,所以对Open. GL的支持很消极,它的Open. GL纯软件实现只支持Open. GL1. Open. GL的最新版本为1. 4. MCD(Mini Client Driver):MCD是早期微软在Windows NT上支持Open. GL时,为了简化驱动开发时使用的一个模型。在这个模型中,Open. GL渲染管线的变换、光照部分仍然由软件实现,而光栅化部分则由硬件厂商实现,因此只要硬件支持,MCD可以硬件加速光栅化部分。 MCD虽然可以简化驱动开发,但是功能限制太大,现在市面上的3. D加速卡均支持硬件变换和光照,MCD却不能利用这一特性,看上去MCD已经没有存在的价值ICD(Installable Client Driver):ICD是一个完整的Open. GL驱动模型,比MCD复杂得多。硬件厂商要实现完整的Open. GL渲染管线,如变换、光照、光栅化等,因此只要硬件支持,ICD可以硬件加速整个Open. GL渲染管线。我们通常说的Open. GL硬件加速就是指的通过ICD模型获得的硬件加速,而现在硬件厂商提供的Open. GL驱动程序也都是依照ICD模型开发的。主要硬件厂商的ICD已经可以支持Open. GL的最新版1. 4. Windows怎么实现Open. GL硬件加速呢? Open. GL3. Open. GL 1. 1纯软件实现,我们的程序都要动态链接到这个dll。如果安装3. D芯片厂商的驱动程序,会将一个不同名字的dll放到Windows系统目录下,比如在Windows 2. VIDIA Ge. Force. 2 MX的驱动程序,会在系统目录下放一个nvoglnt. VIDIA的Open. GL驱动),并在注册表中登记nvoglnt. Windows知道硬件加速Open. GL驱动的名字,以后运行Open. GL程序,Open. GL3. 2. Open. GL调用直接转到nvoglnt. Windows平台上,一个Open. GL程序是否使用硬件加速由三个因素决定,这三个因素缺一不可,否则程序都会运行于纯软件模式:是否有一块3. D加速卡是否安装了显卡厂商提供的最新的驱动程序,Windows自带的显卡驱动程序并不会提供Open. GL硬件加速能力指定的像素格式是否被显卡硬件所支持判断一种像素格式是否被显卡硬件所支持,可以用函数Describe. Pixel. Format取得该像素格式的数据,然后看结构体PIXELFORMATDESCRIPTOR中的dw. Flags的值,如果PFD_GENERIC_FORMAT被置1,并且PFD_GENERIC_ACCELERATED被置0,即(pfd. Flags & PFD_GENERIC_FORMAT) & & !(pfd. Flags & PFD_GENERIC_ACCELERATED)表明该像素格式不被显卡硬件支持,使用该像素格式的Open. GL程序将使用纯软件模式渲染PFD_GENERIC_FORMAT被置1,并且PFD_GENERIC_ACCELERATED被置1,即(pfd. Flags & PFD_GENERIC_FORMAT) & & (pfd. Flags & PFD_GENERIC_ACCELERATED)表明该像素格式被显卡硬件支持,并且程序使用MCD模式渲染PFD_GENERIC_FORMAT被置0,并且PFD_GENERIC_ACCELERATED被置0,!(pfd. Flags & PFD_GENERIC_FORMAT) & & !(pfd. Flags & PFD_GENERIC_ACCELERATED)表明该像素格式被显卡硬件支持,并且程序使用ICD模式渲染3 Open. GL Extension这个软件可以自动测试显卡对Open. Open. GL ES 2. 0 and EGL on desktop, updated. Following a surprizing amount of feedbacks, I have updated the entire post accordingly. Thanks for contributing! There is a lot of reasons for Open. GL ES 2. 0 on desktop but I especially like to picture it by "for the purpose of convergence". This includes computers, tablets and mobile phones but also the web through Web. GL which is pretty much a Javascript binding of Open. GL ES 2. 0. In practice we can imagine that it would be a great to be able to port directly a mobile phone game to a desktop platform and minimized code changes. We can also imagine authoring and prototyping GLSL shaders or even applications on desktop before using them on mobile devices. EGL, WGL and GLX? What's the way forward? When EGL was originally announced, it brought be a lot of hopes. API across all platforms to handle the Open. GL contexts. That was in 2. An early "leap of faith" hapenned when Sony announced that the PS3 would run Open. GL ES 1 + ES 2 level of extensions and EGL. Unfortunately, Open. GL ES 2 has basically never been used on the PS3, Apple created it's own flavour of EGL. EAGL) and only AMD exposes EGL on desktop. Open. GL ES 2. 0 on Windows 7. On AMD side, Open. GL ES 2 is brought to desktop thanks to EGL and a dedicated. SDK is provided. which makes it significantly different from using Open. GL on desktop. A dedicated Open. GL ES 2 DLL for the implementation is provided. I believe distributed with the AMD Catalyst drivers. On NVIDIA side, the strategy is different because Open. GL ES 2 is exposed through. The idea was to make Open. GL ES 2 an Open. GL "profile". When I first had a look at it, the implementation would expose all the Open. GL extensions which made me think something like. Not that joke all over again?!" and I didn't waste any time with it. However, things have changed because now when creating an Open. GL ES 2 context. only the Open. GL ES extensions are exposed and the drivers is even trying to report all the not ES compliant requests as errors. I expect this to be a challenging work in progress so once again report your bugs! A last option on Windows is Angle which brings support for both Open. GL ES 2. 0. and EGL 1. Windows by translating Open. GL calls to Direct. D 9 calls. It is used by both Firefox and Chrome on Windows. Angle might be the only way to get Open. GL ES 2 running on Intel hardware. There is no news from Intel about Open. GL ES 2 or EGL support but our experiences tell us that they are most likely going to be last at the party. Open. GL ES 2. 0 on Linux. It looks like that Mesa is currently providing the best implementation. Not only Mesa supports EGL 1. Open. GL, Open. GL ES, Open. GL ES 2 and even Open. VG. However, it's not clear to me whether it can load the proprierary implementations or not. At least, AMD provides EGL 1. Open. GL ES 2. 0 implementations through the its. On NVIDIA side, Open. GL ES 2. 0 is exposed by. GLX_EXT_create_context_es. Windows. The Linux world is turning its back on X. Wayland which uses exclusively. EGL making its support not only desirable but required by proprietary drivers to run their Open. GL ES 2. 0 or even an Open. GL implementation. Open. GL ES 2. 0 on Windows 8. Windows 8 x. 86 follows the same behavours than Windows 7 however Microsoft did a large cleaning of APIs on Windows 8 for ARM which implies currently no. WGL or EGL. The cleaning, or actually the not ported yet, is so drastic that even. XNA isn't supported on Windows 8 for ARM. Considering that Windows 8 for ARM target tablets and I guess ultra- book kind of laptop it seems unresonnable for Microsoft to avoid the. Adreno, Mali, Power. VR and Tegra chips which software stacks have mainly mature over the years with Open. GL ES 2. 0. In such case, implementing EGL sounds to me like the most reasonnable option for Microsoft. Another possibility would to use Angle on Windows 8 ARM to get the Open. GL support. Open. GL ES 2. 0 on Mac. OS X. Apple is definetely moving toward the convergence of Mac. OS X (renamed OS X for Mountain Lion) and i. OS. However, beside development tools there is no Open. GL ES 2. 0 on Mac. OS X. For EGL, Apple only supports it's own flavour, EAGL. EGL in Objective C with no access to the framebuffer as we much render to a colorbuffer. On the library point of view, only GLFW supports Open. GL ES 2 on desktop through the. WGL_EXT_create_context_es. GLX_EXT_create_context_es. EGL supports is on the todo list and I certainly hope it will include desktop support. Free. GLUT 2. 8. 0 released less than two months ago doesn't support Open. GL ES 2. in any way but I hacked it to add the ES2 profile approach.. It tooks literrally 1. Conclusions. So what the future of Open. GL ES on desktop? First of all, it mainly passed by Web. GL. because this is how real time graphics can reach everyone and not only people interested in games or specific graphics software. GLX and WGL looks nearly dead as the last version of GLX, GLX 1. Microsoft is certainly not going to move WGL forward. Do we really need updates of these APIs? On other end, the Khronos Group seems to be still actively working on EGL as. EGL is everywhere, is fast growing. Which direction do you think is the right one?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
September 2016
Categories |