分享
 
 
 

Direct3D vs. OpenGL: A Comparison

王朝other·作者佚名  2006-01-08
窄屏简体版  字體: |||超大  

Direct3D vs. OpenGL: A Comparison

Summary

This page is an informal attempt to summarize the main differences between SGI's OpenGL and Microsoft's Direct3D. First, each API is summarized in an attempt to bring a balanced presentation of the two APIs. Then a feature comparison is made between the capabilities of OpenGL and Direct3D.

Unless otherwise noted, "OpenGL" refers to the OpenGL 1.2 core with no extensions and "Direct3D" refers to Direct3D8, the Direct3D interface in DirectX 8. When a difference between Direct3D7 and Direct3D8 is noteworthy, version numbers are given.

Intended Audience

This document assumes that the reader is familiar with the architecture of a traditional 3D graphics pipeline as commonly used with scanline rendering techniques. For more information on such architectures, the reader is encouraged to consult a 3D graphics text such as "3D Computer Graphics" by Alan Watt and Mark Watt. This is only one book of many 3D graphics books, the interested reader is encouraged to browse a good technical bookstore and find one that speaks to them most effectively.

SGI's OpenGL

SGI's OpenGL is a procedural 3D graphics API, the successor to Iris GL which originated in the unix workstation market. Iris GL is the graphics API used on a succession of 3D graphics workstations designed and built by Silicon Graphics, Inc.

"OpenGL" is a trademark of the OpenGL Architectural Review Board (ARB). The ARB controls the definition of OpenGL through control of the specification by which an implementation may call itself "OpenGL". The specification is an English prose document with associated mathematics that define the semantics of the API. The ARB also governs a suite of conformance tests that serve as a validation suite for an implementation.

The ARB was formed in 1992 and functions under a set of bylaws to revise and oversee the specification of the API.

OpenGL defines a state machine that controls the rendering pipeline. State machine attributes are modified through procedure calls and vertices defining graphic primitives are specified to the pipeline through procedure calls.

Only the OpenGL 1.2 core is considered in this document, not extensions.

Microsoft's Direct3D

Microsoft's Direct3D is a COM based 3D graphics API originating in a third-party 3D graphics API for x86 architectures. Microsoft acquired the technology in 1996 and has been offering the API as a component of its DirectX technology. Direct3D contains an immediate-mode interface and a strctured hierarchical scene graph interface called retained mode. Only the immediate-mode interface is considered in this document.

Microsoft defines the Direct3D API through its COM interfaces, and the semantics are defined by the the help files and sample code accompanying the software development kit provided by Microsoft.

Direct3D first appeared in DirectX 3 with execute buffers as its display paradigm. All subsequent releases, beginning with DirectX 5 (there was no DirectX 4), replaced execute buffers with a more traditional graphics primitive display paradigm.

Feature Comparison

OpenGL and Direct3D both expose a traditional graphics rendering pipeline. This basic pipeline design has been present since the earliest days of computer graphics and has been enhanced and extended over the years as hardware has become more capable, but the fundamental paradigm has not changed.

Vertices are described to the pipeline as a bundle of data consisting of coordinates in space defining the vertex's location and associated per-vertex data. A graphics primitive is described to the pipeline as an ordered set of vertices. How vertices are combined into various primitives -- generally points, lines and triangles -- is defined by the particular API.

Rather than provide an exhaustive list of features where both OpenGL and Direct3D provide the same feature, I will list the differences.

Feature

OpenGL 1.2 Core

Direct3D 7

Direct3D 8

System Mechanics

Operating System Support

Windows (9x, NT, 2000), MacOS, BeOS, *nix, others

Windows (9x, 2000, CE) [12]

Windows (9x, 2000) [12]

API Definition Control

OpenGL ARB

Microsoft

Microsoft

API Specification

OpenGL Specification [10]

SDK/DDK Documentation and DDK Reference

SDK Documentation

API Mechanism

includes and libraries

COM

COM

Software Emulation of Unaccelerated Features [4]

Yes

No

No [11]

Extension Mechanism [5]

Yes

No

Yes

Source Implementation Available [6]

Yes

Yes

No

Modeling

Fixed-Function Vertex Blending

No

Yes

Yes

Programmable Vertex Blending

No

No

Yes

Parametric Curve Primitives

Yes

No

Yes

Parametric Surface Primitives

Yes

No

Yes

Hierarchical Display Lists

Yes

No [8]

No [8]

Rendering

Two-sided Lighting

Yes

No [1]

No [1]

Point Size Rendering Attributes [9]

Yes

No

Yes

Line Width Rendering Attributes [9]

Yes

No

No

Programmable Pixel Shading

No [14]

No

Yes

Triadic Texture Blending Operations

No

No

Yes

Cube Environment Mapping

No

Yes

Yes

Volume Textures

Yes

No

Yes

Multitexture Cascade

No [13]

Yes

Yes

Texture Temporary Result Register

No

No

Yes

Mirror Texture Addressing

No

Yes

Yes

Texture "Wrapping"

No

Yes

Yes

Range-Based Fog

No

Yes

Yes

Bump Mapping

No

Yes

Yes

Modulate 2X Texture Blend

No

Yes

Yes

Modulate 4X Texture Blend

No

Yes

Yes

Add Signed Texture Blend

No

Yes

Yes

Frame Buffer

Hardware Independent Z Buffer Access

Yes

No [2]

No [2]

Full-Screen Antialiasing

Yes

Yes

Yes

Motion Blur

Yes

No

Yes

Depth of Field

Yes

No

Yes

Accumulation Buffers

Yes

No

No [7]

Miscellaneous

Picking Support

Yes

No [3]

No [3]

Multiple Monitor Support

No

Yes

Yes

Stereo Rendering

Yes

Yes

No

Notes:

Two-sided lighting can be emulated by an application that desires two-sided polygon surfaces. First, the application sets the pipeline to cull back facing polygons and draws the front side of all two-sided polygons. Next, the pipeline is set to cull front facing polygons and the application draws the back side of all two-sided polygons.

Access to the Z buffer is provided, but the values stored in the Z buffer are hardware dependent.

Picking can be done entirely in the application by traversing its own data structures.

OpenGL provides software emulation when hardware cannot accomodate the requested feature to guarantee that a rendering feature will exist. Direct3D exposes extensive information about hardware capabilities and lets the application determine how to obtain the requested feature.

OpenGL provides an extension mechanism for an implementation to expose additional features not yet adopted by the ARB. Direct3D7 has one implementation with no extension mechanism. Direct3D8 has one implementation and provides support for pluggable software devices.

An open source sample implementation of OpenGL is available. Microsoft's Windows 2000 DDK (driver development kit) contains the reference rasterizer for Direct3D 7.

Multisampling is provided Direct3D8, but not as an accumulation buffer. This allows Direct3D8 to perform full-screen antialiasing, depth of field and motion blur effects without providing an accumulation buffer.

Hierarchical display lists are not provided by Direct3D, but Direct3D does provide storage for polygon vertices and vertex indices to avoid data copying. These are flat array-like storages consisting only of geometry data and no state changes. State changes may be aggregated into state blocks for efficient transmission to the device. Neither state blocks, nor index buffers nor vertex buffers are hierarchical.

Point and line width attributes can be emulated by drawing textured triangles (for points) or quadrilaterals (for lines) when the size of the point or line is significant. This also provides the application with more control over the exact rendering of these large points and thick lines. This additional control over rendering may be important for OpenGL applications even though OpenGL provides point and line rendering attributes.

OpenGL's specification, while still being an English prose specification, is more rigorously defined than Direct3D.

Direct3D8 provides software emulation for vertex processing (blending, vertex shaders, fixed-function vertex processing, etc.), but not for pixel processing (pixel shaders, multitexturing, etc.).

Windows NT 4 only supports DirectX 3.

Multitexture cascade is provided in OpenGL 1.2 through an ARB extension. While still an extension and not part of the official 1.2 core, it is expected to be widely implemented as it is a "standard" extension and not a vendor extension.

Programmable pixel shading is provided by some vendors in OGL through the register combiner vendor extension.

In several aspects, a comparison between OpenGL and Direct3D is similar to a comparison between OpenGL and PEX. Many of the same differences exist for Direct3D.

Last modified: May 2001

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有