從未停止!OpenGL的版本歷史和發展


由於本文的內容過長,在Chrome瀏覽器下可能不能完全顯示,建議使用IE或者FireFox閱讀本文。

來源請註明,本文永久地址爲http://www.cnblogs.com/vertexshader/articles/2917540.html

OpenGL®作爲業界最爲廣泛使用的2D和3D圖形接口標準,應用在成千上萬的各式各樣的計算機的程序中。從初期的嶄露頭角,到與Direct3D激烈競爭,後經歷黯淡被Khronos接手又發揚光大,已經歷經波折發展了20年。由於過去的黯淡,至今甚至仍有人站在錯誤的時間角度認爲它是落後的——它從未停止它前進的步伐,這篇文章就來簡述OpenGL的版本歷史和發展。

 

OpenGL 1.0

發佈時間: 1992年1月

OpenGL的最早版本OpenGL 1.0由Mark Segal和Kurt Akeley發佈於1992年1月。從這之後,OpenGL每隔一段時間都會發佈一個新版本的規範,這些規範定義了一些顯卡必須支持的新擴展。這就決定了OpenGL的每個版本其實就是由各個擴展組成的,當硬件的驅動全部支持相應的擴展的時候,相應的OpenGL版本就被支持了。

 

OpenGL 1.1

發佈時間:1997年1月

擴展

特性增加

GL_EXT_vertex_array

 Vertex arrays

GL_EXT_polygon_offset

Polygon offset

GL_EXT_blend_logic_op

 Logical operation

GL_EXT_texture

 Internal texture formats, texture proxy, and texture env

GL_EXT_copy_texture

GL_EXT_subtexture

 Copy texture and subtexture from framebuffer

GL_EXT_texture_object

 Texture object

 

時隔5年OpenGL才發佈新的版本OpenGL 1.1,而Direct3D的出現(尤其是紅色警戒的大賣)使得OpenGL感覺到了壓力。頂點數組(Vertex arrays)的出現取代了glVertex*這類立即模式繪圖函數,多個數據可以被一個函數調用繪製了,降低了調用函數帶來的CPU循環開銷;polygon offset解決了z-fighting和stitching的問題;在pre-fragment operation開始支持邏輯操作(logic operation);紋理方面開始支持紋理代理(texture proxy)和紋理環境映射(texture environment),以及從幀緩衝(frameuffer)複製像素至texture或者subtexture;紋理對象(texture object)的出現改變了過去只能使用顯示錶(display list)來靜態地使用紋理的方法,現在紋理和參數(texture parameter)能被改變了。

OpenGL 1.2

發佈時間:1998年3月16日

 

擴展

特性

GL_EXT_texture3D

Three-dimensional texture 

GL_EXT_bgra

BGR or BGRA pixel format

GL_EXT_packed_pixels

 Packed pixel formats

GL_EXT_rescale_normal

 Normal rescaling

GL_EXT_separate_specular_color

 Separate specular color

GL_SGIS_texture_edge_clamp

 Texture coordinate edge clamping

GL_SGIS_texture_lod

 Texture LOD control

GL_EXT_draw_range_elements

 Vertex array draw element range

 這個版本的OpenGL開始支持可以用於體渲染(volume rendering)和體紋理(solid texture)的texture 3D;BGRA和BGA的出現主要是爲了兼容某些平臺和硬件;包裝像素(pack pixel)的出現使得像素可以在不同的對象之間進行像素傳輸(pixel transfer),這也就是像素緩衝對象(pixel buffer object)的前身;GL_SGIS_texture_edge_clamp擴展的出現將texture coordinate規範在[0,1]這個區間;GL_SGIS_Texture_lod擴展則帶來了重要的MipMap技術,可以通過對紋理參數(texture parameter)的控制來完成對MipMap的控制。

 

OpenGL 1.2.1

發佈時間:1998年10月14日

 這個版本的OpenGL沒有什麼重大的改變,但是專門介紹了ARB擴展的概念。ARB擴展是經過OpenGL ARB認證的擴展,這樣的擴展將被廣泛地實現。

 

OpenGL 1.3

發佈時間:2001年8月14日

擴展

特性增加

GL_ARB_texture_compression

 compressed texture format

GL_ARB_texture_cube_map

 texture cube

GL_ARB_multisample

 MSAA(multisample anti-aliasing

GL_ARB_multitexture(removed)

 multi-texture

GL_ARB_texture_env_add

GL_ARB_texture_env_combine

GL_ARB_texture_env_dot3

Texture add env mode, texture combine env mode, texture dot3 env mode

GL_ARB_texture_border_clamp

 Texture border clamp

GL_ARB_transpose_matrix

 transpose matrix 

這個版本開始支持壓縮紋理(compressed texture),可以有效地減少存儲和帶寬的壓力,現在廣泛的應用於各種對存儲大小和帶寬敏感的手持設備上;立方體紋理(texture cube)的出現主要用於在天空盒(skybox)、動態反射(dynamic reflection)等技術上;而multisample的出現讓OpenGL可以支持紋理和Framebuffer的MSAA抗鋸齒技術,代替了過去在光柵化狀態(rasterizer state)中趨近無用的抗鋸齒設置。

 

OpenGL 1.4

發佈版本:2002年7月24日

擴展

特性增加

GL_SGIS_generate_mipmap

 Automatic mipmap generation

GL_NV_blend_square

 Blend squaring

GL_ARB_depth_texture

GL_ARB_shadow

 Depth texture adn shadows

GL_EXT_fog_coord

 Fog coordinate

GL_EXT_multi_draw_arrays

 Multi draw arrays

GL_ARB_point_parameters

 Point parameters

GL_EXT_secondary_color

 Secondary color

GL_EXT_blend_func_separate

 Separate blend functions

GL_EXT_stencil_wrap

 Stencil warp

GL_ARB_texture_env_crossbar

 Texture crossbar env mode

GL_ARB_texture_mirrored_repeat

 Texture mirrored repeat

GL_ARB_window_pos

 Window raster position

這個版本開始支持紋理自動生成Mipmap; 以及關於point光柵化的parameter。

 

OpenGL 1.5

發佈時間:2003年7月29日

 

擴展

特性增加

GL_ARB_vertex_buffer_object

 Buffer object

GL_ARB_occlusion_query

 Occlusion query

GL_EXT_shadow_funcs

 Shadow functions

 這個版本出現了緩衝對象(buffer object),徹底取代了過去的頂點數組(vertex array)和立即模式,頂點數據可以從客戶端內存(client's memory)上傳到服務端內存(server's memory)了;同時添加了非常重要的遮擋查詢(occlusion query)。

 

OpenGL 2.0

發佈時間:2004年9月7日

 

擴展

特性增加

GL_ARB_shading_language_100

GL_ARB_shader_objects

GL_ARB_vertex_shader

GL_ARB_fragment_shader

 OpenGL Shading Language 1.00

GL_ARB_draw_buffers

 Multiple render targets

GL_ARB_texture_non_power_of_two

 Non-power-of-two textures

GL_ARB_point_sprite

 Point sprites

GL_EXT_blend_equation_separate

GL_EXT_stencil_two_side

 Separate stencil

 OpenGL終於有了自己的着色語言(shading language),ARB選擇了3Dlabs的Dave設計的着色語言成爲OpenGL原生的着色語言,同時OpenGL也開始有了頂點着色器(vertex shader)和片元着色器(fragment shader),導致這個階段的OpenGL出現了固定管線和可編程管線並存的情況;OpenGL的片元着色器輸出(fragment shader output)現在也可以輸出到幀緩衝(framebuffer)的多個渲染目標(render target)上去了;同時OpenGL的紋理也不再有2^n大小的限制。

 

OpenGL 2.1

發佈時間:2006年7月2日

 

擴展

特性增加

GL_ARB_pixel_buffer_object

 Pixel buffer objects

GL_EXT_texture_sRGB

 sRGB textures

這個版本增加了像素緩衝對象(pxiel buffer object),用來更快地像素傳輸(pixel tansfer)的工作,支持將像素從紋理對象(texture object)和幀緩衝對象(framebuffer object)包裝到(pack)像素緩衝對象(pixel buffer object),或者從像素緩衝對象解包裝到紋理對象和幀緩衝對象,另外像素緩衝對象也可以像普通的緩衝對象(buffer object)一樣被映射(map)更新數據,通過DMA的方式更加快地傳輸紋理;同時支持sRGB格式的紋理對象。

 

代號Longs Peak和OpenGL 3.0爭議

 在OpenGL 3.0發佈之前,這個版本的代號叫做Longs Peak,包含了很多大量修改OpenGL的工作方式以及根本性改變API的調用方式等內容。2008年8月11日OpenGL 3.0發佈,這個版本的OpenGL開始分core profile和compatibility profile,並且Khronos Group希望只支持core profile,這個革新性的規範引起一片譁然,許多廠商明確表示不會接受這個建議,並表示會繼續支持許多被劃入compatibility profile的擴展,迫於壓力compatibility profile被改爲是可選的。OpenGL 3.0的出現改變了過去OpenGL一定會向下兼容的特性,在一定程度上簡化了API的臃腫以及增加了API的靈活度。

 

OpenGL 3.0

發佈日期:2008年8月11日

擴展

特性增加

GL_EXT_gpu_shader4

 New functions for shading language

GL_EXT_framebuffer_object

 Framebuffer objects, along with blitting, multisample renderbuffer objects, and packed depth/stencil image formats

GL_EXT_framebuffer_blit

 Framebuffer blit

GL_ARB_texture_float

GL_ARB_color_buffer_float

GL_NV_depth_buffer_float

GL_EXT_packed_float

GL_EXT_texture_shared_exponent

 Floating-point color and depth internal formats for textures and render buffers

GL_EXT_texture_compression_rgtc

 Red-Green texture compression

GL_EXT_transform_feedback

 Transform feedback

GL_APPLE_vertex_array_object

 Vertex array objects

GL_NV_conditional_render

 Conditional rendering

GL_EXT_texture_integer

Intergral image formats

 這個版本的OpenGL變化非常的大,開始分core profile和compatibility profile,core profile擴展的實現決定了所支持的OpenGL版本。下面列出這個版本之後可能會被棄用的很多特性:

  • Application-generated object names
  • Color index mode
  • Shading language 1.10 and 1.20
  • Begin/End primitive specification
  • Edge flags
  • Fixed function vertex processing
  • Client-side vertex arrays
  • Rectangles
  • Current raster position
  • Two-sided color selection
  • Non-sprite points
  • Wide linee and line strip
  • Quadrilateral and polygon primitives
  • Sepatate polygon draw mode
  • Polygon stripple
  • Pixel transger modes and operations
  • Pixel drawing
  • Bitmaps
  • Legacy OpenGL 1.0 pixel formats
  • Legacy pixel formats
  • Depth texture mode
  • Texture wrap mode CLAMP
  • Texture borders
  • Automatic mipmap generation
  • Fixed function fragment processing
  • Alpha test
  • Accumulation buffers
  • Context framebuffer size queries
  • Evaluators
  • Selection and feedback mode
  • Display lists
  • Hints
  • Attribute stacks
  • Unified extension string

這個版本正式把幀緩衝對象(framebuffer object)劃入core profile,現在OpenGL也具有離線的幀緩衝了,就像Direct3D的output-merger stage專門管理render target和接收fragment shader的輸出;增加了許多GLSL的函數,尤其是texture方面的;幀緩衝對象之間可以互相拷貝像素到持有的不同的render target,是性能上的提升;增加了浮點型和整型的texture和depth的image format;另外也增加了RGTC這個自帶的紋理壓縮模式;最爲重要的增加就是transform feedback,數據可以經過vertex shader和geometry shader之後,又輸出回buffer而不經過rasterization以及之後的階段,在物理和粒子的計算上面非常的有用;增加的vertex array object方便管理buffer object以及vertex attrib pointer和其開啓/關閉狀態,不必每次在渲染前都要設置一遍了;增加了重要的條件渲染(conditional rendering)。

 

OpenGL 3.1

發佈日期:2009年3月24日

擴展

特性增加

GL_ARB_draw_instanced

 Instanced rendering

GL_ARB_copy_buffer

 Data copying between buffer objects

GL_ARB_texture_buffer_object

 Buffer texture

GL_ARB_texture_rectangle

 Rectangle texture

GL_ARB_uniform_buffer_object

 Uniform buffer object

GL_NV_primitive_restart

 Primitive restart

有了Instanced rendering,減輕了同類物體繪製所佔有的帶寬壓力;Copy buffer的出現,是讓數據在client端進行拷貝,也是一種性能的優化;Buffer texture其實是讓buffer object像texture那樣被訪問,在某些特殊的場合有意想不到的用途;不得不談的就是uniform buffer object,過去OpenGL上傳uniform數據需要靠glUniform*的函數進行上傳,而OpenGL每個函數的調用所消耗的CPU循環都非常的大,頻繁地調用glUniform*會帶來很大的性能問題,而且到後期這些單個的uniform也會被保存至OpenGL管理的default uniform buffer中,現在開放了uniform buffer object,通過map/unmap更新數據,函數調用開銷明顯地減少。

 

OpenGL 3.2

發佈日期:2009年8月3日

擴展

特性增加

GL_ARB_geometry_shader4

 Geometry shaders, input/output interface block

GL_ARB_sync

 Fence sync objects

GL_ARB_vertex_array_bgra

 D3D compatible color vertex component ordering

GL_ARB_draw_elements_base_vertex

 Draw command allowing modification of the base vertex index

GL_ARB_seamless_cube_map

 Seamless cube map filtering

GL_ARB_texture_multisample

 Multisampled textures andd texture samplers for specific sample locations

GL_ARB_fragment_coord_conventions

 Shader fragment coordinate conventions control

GL_ARB_provoking_vertex

 Provoking vertex control

GL_ARB_depth_clamp

 Fragment depth clamping

這個版本最重磅的支持就是幾何着色器(geometry shader), 可以用來生成新的圖元類型(點、線和三角形),後期重要的tessellation等技術都會使用到它;還有一個就是Texture正式支持multisample,可以作爲render target來進行framebuffer object上的抗鋸齒,而不是經過的WGL_ARB_multisample和GLX_ARB_multisample進行窗口的抗鋸齒。

 

OpenGL 3.3

發佈日期:2010年3月11日

擴展

特性增加

GL_ARB_blend_func_extended

 Dual-source blending

GL_ARB_explicit_attrib_location

 Shader-defined locationfor attributes and fragment shader outputs

GL_ARB_occlusion_query2

 Simple boolean occlusion query

GL_ARB_sampler_objects

 Sampler objects

GL_ARB_texture_swizzle

 Texture swizzle

GL_ARB_timer_query

 Timer queries

GL_ARB_instanced_arrays

 Instanced arrays

GL_ARB_texture_rgb10_a2ui

GL_ARB_vertex_type_2_10_10_10_rev

 new texture format for unsigned_10_10_10_2 and new vertex attributes for 2_10_10_10

這個版本是shader model 4.0的OpenGL的最終版本,這個版本改變了程序需要查詢輸入變量(attribute)的location的方式,可以像HLSL指定semantic一樣在shader裏指定layout,減少了相應API的調用;同時將texture object和sampler state解耦,增加了sampler object,sampler object也可以綁定到ACTIVE_TEXTURE上了。 

 

OpenGL 4.0

發佈日期:2010年3月11日

擴展

特性增加

GL_ARB_tessellation_shader

 Tessellation control and evaluation shaders

GL_ARB_texture_query_lod

GL_ARB_gpu_shader5

GL_ARB_gpu_shader_fp64

GL_ARB_texture_gather

GL_ARB_shader_subroutine

 OpenGL Shading Language 4.00

GL_ARB_sample_shading

 Request minimum number of fragment inputs

GL_ARB_draw_buffers_blend

 Individual blend equations for each color output

GL_ARB_draw_indirect

 Draw instanced arrays indirect

GL_ARB_transform_feedback2

GL_ARB_transform_feedback3

 Transform feedback objects and multiple feedback stream output

這個版本和OpenGL 3.3同時發佈,增加了令人興奮的Tessellation Shader;Shader Language 4.00的subroutine提供了在運行時刻不需要切換着色器或者是重新編譯或者使用if判斷選擇不同功能的方法,降低了切換着色器程序所帶來的巨大開銷(切換着色器的CPU循環消耗真的非常的驚人);另外GL_ARB_draw_buffers_blend讓fragment shader輸出的每條buffer都可以完成各自的pre-fragment operaion,而不是像過去那樣每條都完成相同的pre-fragment operation;GL_ARB_transform_feedback2和GL_ARB_transform_feedback3提供了transform feedback object,以及transform feedback相關的控制(比如pause之類),也把transform feedback當做一個對象來進行處理。 

 

OpenGL 4.1

發佈日期:2010年7月26日

擴展

特性增加

GL_ARB_ES2_compatibility

 Pulling missing functionality from OpenGL ES 2.0 into OpenGL

GL_ARB_get_program_binary

 Query and load a binary blob for program objects

GL_ARB_separate_shader_objects

 Ability to bind programs individually to programmable stages

GL_ARB_viewport_array

 Multiple viewports for the same rendering surface, or one per surface

GL_ARB_shader_precision

 Documents precision requirements for several FP operaions

GL_ARB_vertex_attrib_64bit

Provoids 64-bit floating-point component vertex shader inputs

這個版本把OpenGL ES的一些功能劃入core profile的範圍,一方面反映出了OpenGL ES巨大的成功;GL_ARB_get_program_binary提供了可以將shader事先編譯好序列化進入二進制文件,避免了運行時進行編譯的方法;這個版本也提供了64位的浮點型輸入變量,提升了數據精度。 

 

OpenGL 4.2

發佈日期:2011年8月8日

擴展

特性增加

GL_ARB_base_instance

 Allows instanced rendering with a starting instance value

GL_ARB_compressed_texture_pixel_storage

 Allows for sub-rectangle selections when transferring compressed texture data

GL_ARB_conservative_depth

 Allos querying of the aligment for pointers returned from buffer object mapping operations

GL_ARB_internalformat_query

 Allows the user to detect the maximum number of samples possible for a particular image format and texture type

GL_ARB_map_buffer_alignment

 Allows querying of the alignment for pointers returned from buffer object mapping operations

GL_ARB_shading_language_420pack

 Allows the setting of Uniform Buffer Object and sampler binding points directly from GLSL, among many other small changes

GL__ARB_texture_storage

 Allows texture objects to have immutable storage, and allocating all mipmap levels and images in one call. The storage becomes immutable, but the contents of the storage are not

GL_ARB_transform_feedback_instanced

 Allows instanced rendering of data written by transform feedback operations

GL_ARB_shader_atomic_counters

 Allows atomically incrementing/decrementing and fetching of buffer object memory locations from shaders

GL_ARB_shader_image_load_store

 Allows shaders to read and write images, with few but difficult restrictions

GL_ARB_texture_compression_bptc

 Allows the use of certain advanced compression formats

 這個版本比較好的改動就是現在也支持Compressed pixel format transfer了,而過去這是不允許的;另外提供了immutable texture,可以調用一次API創建texture object而不是像過去一樣要頻繁地調用API;還有一個就是GL_ARB_texture_compression_bptc,以及compatibility profile的GL_EXT_texture_compression_s3tc,讓OpenGL開始支持所有的Block Compression格式。

 

OpenGL 4.3

發佈日期:2012年8月6日

擴展

特性增加

GL_ARB_arrays_of_arrays

 GLSL multidimensional arrays

GL_ARB_clear_buffer_object

 Clear Buffer Objects to specific values, ala memset

GL_ARB_compute_shader

 Arbitrary Compute Shaders

GL_ARB_copy_image

 Arbitrary image copying

GL_KHR_debug/GL_ARB_debug_output

 Debug messaging

GL_ARB_ES3_compatibility

 Compatibility with OpenGL ES 3.0

GL_ARB_explicit_uniform_location

 Specifying uniform locations in a shader

GL_ARB_framebuffer_no_attachments

 Rendering to a Framebuffer Object that has no attachments

GL_ARB_internalformat_query2

 Generalized queries for information about Image Formats

GL_ARB_invalidate_subdata

 Texture, buffer object, and framebuffer invalidation

GL_ARB_multi_draw_indirect

 Issuing multiple indirect rendering commands from a single drawing command

GL_ARB_program_interface_query

 Improved API for getting info about program object interfaces

GL_ARB_shader_storage_buffer_object

 Buffer object read-write access from shader, via a uniform-block style mechanism

GL_ARB_shader_image_size

Get size of images from GLSL

GL_ARB_stencil_texturing

 Accessing the stencil values from a depth/stencil texture

GL_ARB_fragment_layer_viewport

 Layer and viewport indices available from the fragment shader

GL_ARB_texture_query_levels

 GLSL can detect the available mipmap pyramid of a sampler or image

GL_ARB_texture_storage_multisample

 Immutable storage for multisample textures

GL_ARB_texture_view

 The ability to create a new texture, with a new internal format, that references an existing texture's storage

GL_ARB_vertex_attrib_binding

 Separation of vertex format from buffer object

GL_ARB_robust_buffer_access_behavior

GL_ARB_robustness_isolation

WGL_ARB_robustness_isolation

GLX_ARB_robustness_isolation

 More robustness of API

這個版本最重要的增加就是可以用於並行計算的compute shader;GL_ARB_explicit_uniform_location提供了uniform也能在GLSL中像HLSL指定semantic一樣指定layout的方法,這個版本的OpenGL的vertex shader input和fragment shader output,以及uniform現在都能在shader中指定layout了;把OpenGL ES 3的某些功能加入了OpenGL core profile;增加了texture view的概念,用來共享已經創建紋理的內容;另外加入的debug messaging幫助程序猿更好的調試OpenGL。
 
OpenGL 4.4
發佈日期:2013年7月23日

擴展

特性增加

GL_ARB_buffer_storage

 Allows buffer objects to have immutable storage, and allocating all data in one call.

GL_ARB_clear_texture

 Clear texture Objects to specific values.

GL_ARB_enhanced_layouts

 Add more functionality to layout qualifiers in OpenGL Shading Language.

GL_ARB_multi_bind

 Allowing applications to bind or unbind a set of objects in one call.

GL_ARB_query_buffer_object

Introduces a mechanism whereby the result of a query object may be retrieved into a buffer object instead of client memory.

GL_ARB_texture_mirror_clamp_to_edge

 Extends the set of texture warp mdes to include an additional mode that effectively uses a texture map twice as large as the original image in which the additional half of the new image is a mirror image of the original image.

GL_ARB_texture_stencil8

Accept STENCIL_INDEX8 as a texture internal format.

GL_ARB_vertex_type_10f_11f_11f_rev

New vertex attribute data format.

GL_ARB_bindless_texture

 Shader can access texture objects by handles directly.

 GL_ARB_compute_variable_group_size

 Allows application to write generic compute shader that operate on work groups with arbitrary dimensions.

 GL_ARB_indirect_parameters

 Add "parameter buffer" which is a target allowing buffers to store parameters for certain drawing commands.

GL_ARB_seamless_cube_texture_per_texture

Allow a implementation to provide a per-texture setting for enabling seamless sampling from cube maps.

GL_ARB_shader_draw_parameters

Add a built-in variable gl_DrawID in OpenGL Shading Language.

GL_ARB_shader_group_vote

Add new built-in functions to compute the cmpoite of a set of boolean conditions across a group of shader invocations.

GL_ARB_sparase_texture

Allows the separation of the graphics processors address space from the requirement that all textures must be physically backed.

 
這個版本的重要擴展就是GL_ARB_sparase_texture(GL_AMD_sparase_texture),提供了tiled texture來減少mipmap所帶來的巨大開銷,Direct3D 11.2也“借鑑”了這個擴展;另外GL_ARB_texture_bindless提供了Shader可以直接通過handle來訪問texture object的方法,取消了texture unit,沒有必要每次渲染的時候都將要綁定的資源綁定到texture unit了,減少了很多OpenGL的函數調用;GL_ARB_enhanced_layout允許uniform block內部指定layout,相當於Direct3D的registry;GL_ARB_buffer_object也提供了單個draw call完成創建buffer object的方法。
 
總結
從發展歷程上看,OpenGL 1.0~OpenGL 1.5是經典的固定管線時代;OpenGL 2.0~OpenGL 2.1是固定管線和可編程管線並存的時代;OpenGL 3.0~OpenGL 4.x開始是可編程管線崛起的時代。在出現可編程管線的那個時代,OpenGL因爲OpenGL ARB的臃腫而一度落後,取而代之的是Khronos Group管理的精簡的OpenGL ES流行;最後ARB決定將OpenGL的接力棒交給Khronos Group,在之後的幾年內,OpenGL重新煥發了活力,推陳出新至今。另外在移動設備上免授權費用的OpenGL ES的勝利,在一方面上也促進了桌面版的OpenGL重新回到主流地位,現在先進的OpenGL已經受到各個廠家的重視,Nvidia和AMD等顯卡製造商都爭相發佈相關的OpenGL驅動;在遊戲開發方面,因爲其良好的可移植性,不同的平臺、不同的主流引擎都會有OpenGL的實現。

 

附錄

OpenGL 4.4 pipeline

 

Q&A:

Q:OpenGL已經落伍了,更新的也非常的慢,再努力幾年也趕不上技術雄厚的Direct3D。

A:近幾年Khronos Group接手OpenGL之後,發展速度迅猛,新版本的OpenGL已經更新到了OpenGL 4.4,其功能略超過Direct3D 11,且被Nvidia和AMD主流顯卡全面支持;值得注意的是有96.8%手持設備都只使用桌面OpenGL的子集OpenGL ES作爲他們的圖形編程接口;許多家用遊戲機也使用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檢測相應的擴展是否被支持;你也可以下載OpenGL Extensions Viewer直觀的查看支持的OpenGL的特性和擴展,這個軟件也有多個平臺的版本。

 

Q:感覺OpenGL的文檔都太不詳細了,我在搜索引擎裏搜索的結果都很令人失望。

A:詳細的OpenGL文檔都在其官網裏:①OpenGL Registry裏面有上百個OpenGL擴展的文檔;②OpenGL Reference Page裏面有各個函數的使用方法;③OpenGL Reference Card能幫助你宏觀地瞭解OpenGL的所有主要函數;④OpenGL Specification其實是擴展文檔的集合,不過也是非常的詳細和有用。

 

Q:什麼是Core Profile和Compatibility Profile?

A:在OpenGL的發展歷程中,總是兼顧向下兼容的特性,但是到了一定的程度之後,這些舊有的OpenGL API不再適應時代的需要,還有一些擴展並不是驅動一定要實現的擴展,這些被統一劃入可選的Compatibility Profile;而由OpenGL規範規定必須支持的擴展,則是Core Profile,想要支持先進的OpenGL,相應的Core Profile擴展必須被實現。

 

Q:有什麼好的入門書籍可以介紹嗎?

A:《OpenGL Superbible》和《OpenGL Shading Language Cookbook》以及《OpenGL Insights》都非常的不錯。

 

Q:OpenGL如何進行Debug,DirectX的PIX真的很好用呢。

A:現在支持GLSL和OpenGL跟步調試的只有Nvidia的Nsight,只支持Nvidia的顯卡;其他的基本都是track,不支持GLSL的跟步調試,比如AMD的GPUPerfClient以及gDEBugger。還有AMD的GPU ShaderAnalyzer也非常的不錯,能看到相應的GLSL彙編代碼。

 

Q:OpenGL有多少引擎支持呢!

A:基本主流的引擎都會在上層抽象一層,然後都有用OpenGL和Direct3D分別實現的模塊;絕大部分的主流引擎都留有了OpenGL的實現。

 

Q:網上很多Tutorias都很老了,Nehe也落伍了,有沒有比較好的Tutorias呢?

A:當然有!看看這個

 

Q:學OpenGL來錢快不快?

A:建議去新XX學廚師。

發佈了9 篇原創文章 · 獲贊 3 · 訪問量 8萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章