1 What is Angle.

The goal of ANGLE is to allow Windows users to seamlessly run WebGL and other OpenGL ES content by translating OpenGL ES API calls to DirectX 9 or DirectX 11 API calls.

ANGLE is a conformant implementation of the OpenGL ES 2.0 specification that is hardware‐accelerated via Direct3D. ANGLE v1.0.772 was certified compliant by passing the ES 2.0.3 conformance tests in October 2011. ANGLE also provides an implementation of the EGL 1.4 specification. Work on ANGLE's OpenGL ES 3.0 implementation is currently in progress, but should not be considered stable.

ANGLE is used as the default WebGL backend for both Google Chrome and Mozilla Firefox on Windows platforms. Chrome uses ANGLE for all graphics rendering on Windows, including the accelerated Canvas2D implementation and the Native Client sandbox environment.

Portions of the ANGLE shader compiler are used as a shader validator and translator by WebGL implementations across multiple platforms. It is used on Mac OS X, Linux, and in mobile variants of the browsers. Having one shader validator helps to ensure that a consistent set of GLSL ES shaders are accepted across browsers and platforms. The shader translator can be used to translate shaders to other shading languages, and to optionally apply shader modifications to work around bugs or quirks in the native graphics drivers. The translator targets Desktop GLSL, Direct3D HLSL, and even ESSL for native GLES2 platforms.

2 Related project.

3 How to install.

Version Control

ANGLE uses git for version control. If you are not familiar with git, helpful documentation can be found at http://git-scm.com/documentation

Required Tools

  1. Visual Studio Community 2013
    • Required to build ANGLE on Windows and for the packaged Windows 8.1 SDK.
  2. depot_tools
    • Required to generate projects and build files, contribute patches, run the unit tests or build the shader compiler on non-Windows systems.
  3. Bison, flex, and patch (optional)
    • This is only required if you need to modify GLSL ES grammar files (glslang.l and glslang.y under src/compiler/translator).
    • All packages are available as part of cygwin or gnuwin32 distribution on Windows.

Application Development with ANGLE

This sections describes how to use ANGLE to build an OpenGL ES application.

Getting the source

Set the following environment variables as needed:

  • GYP_GENERATORS to msvs (other options include ninja and make)
  • GYP_DEFINES to windows_sdk_path=YOUR_WIN_SDK_INSTALL_DIR if you did not install the Windows 8.1 SDK in the default location.
  • GYP_MSVS_VERSION to 2013 (or 2013e for Express editions of MSVS)

Download the ANGLE source by running the following commands:

mkdir angle
cd angle
gclient config --name . --unmanaged https://chromium.googlesource.com/angle/angle.git
gclient sync
git checkout master

The generated visual studio project files will be located in the buildsrcsamples and tests directories. The projects can be regenerated by executing gclient runhooks

Building ANGLE

  1. Open one of the ANGLE Visual Studio solution files (see DevSetup#Getting_the_source).
  2. Select Build -> Configuration Manager
  3. In the "Active solution configuration:" drop down, select the desired configuration (eg. Release), and close the Configuration Manager.
  4. Select Build -> Build Solution.

Once the build completes, the output directory for your selected configuration (eg. Release_Win32, located next to the solution file) will contain the required libraries and dlls to build and run an OpenGL ES 2.0 application.

Choosing a D3D Backend

ANGLE can use either a backing renderer which uses D3D11 on systems where it is available, or a D3D9-only renderer.

ANGLE provides an EGL extension called EGL_ANGLE_platform_angle which allows uers to select which renderer to use at EGL initialization time by calling eglGetPlatformDisplayEXT with special enums. Details of the extension can be found in it's specification inextensions/ANGLE_platform_angle.txt and extensions/ANGLE_platform_angle_d3d.txt and examples of it's use can be seen in the ANGLE samples and tests, particularly util/EGLWindow.cpp.

By default, ANGLE will use a D3D9 renderer. To change the default:

  1. Open src/libANGLE/renderer/Renderer.cpp

   2.  Locate the definition of ANGLE_DEFAULT_D3D11 near the head of the file, and ensure it is set to 1.

4 How to use.

  1. Configure your build environment to have access to the include folder to provide access to the standard Khronos EGL and GLES2 header files.
    • For Visual C++
      • Right-click your project in the Solution Explorer, and select Properties.
      • Under the Configuration Properties branch, click C/C++.
      • Add the relative path to the Khronos EGL and GLES2 header files to Additional Include Directories.
  2. Configure your build environment to have access to libEGL.lib and libGLESv2.lib found in the build output directory (seeDevSetup#Building_ANGLE).
    • For Visual C++
      • Right-click your project in the Solution Explorer, and select Properties.
      • Under the Configuration Properties branch, open the Linker branch and click Input.
      • Add the relative paths to both the libEGL.lib file and libGLESv2.lib file to Additional Dependencies, separated by a semicolon.
  3. Copy libEGL.dll and libGLESv2.dll from the build output directory (see DevSetup#Building_ANGLE) into your application folder.
  4. Code your application to the Khronos OpenGL ES 2.0 and EGL 1.4 APIs

GLSL ES to GLSL Translator

In addition to OpenGL ES 2.0 and EGL 1.4 libraries, ANGLE also provides a GLSL ES to GLSL translator. This is useful for implementing OpenGL ES emulators on top of desktop OpenGL.

Getting the source

The translator code is fully independent of the rest of ANGLE code and resides in src/compiler. It is cross-platform and build files for operating systems other than Windows can be generated by following the Generating project files steps above.

Usage

The basic usage is shown in essl_to_glsl sample under samples/translator. To translate a GLSL ES shader, following functions need to be called in the same order:

  1. ShInitialize() initializes the translator library and must be called only once from each process using the translator.
  2. ShContructCompiler() creates a translator object for vertex or fragment shader.
  3. ShCompile() translates the given shader.
  4. ShDestruct() destroys the given translator.
  5. ShFinalize() shuts down the translator library and must be called only once from each process using the translator.

Angle的更多相关文章

  1. cvBox2D和RotatedRect中返回的角度angle详解

    本文为作者原创,未经允许不得转载: 原文由作者发表在博客园: http://www.cnblogs.com/panxiaochun/p/5478555.html 关于cvBox2D和RotatedRe ...

  2. Rotate bitmap by real angle

    tl;dr; Use GDI+ SetWorldTransform With WinAPI's SetWorldTransform you can transform the space of dev ...

  3. Body joints angle using Kinect

    http://stackoverflow.com/questions/12608734/body-joints-angle-using-kinect-checking-time-interval?rq ...

  4. Vector2.Angle 的 bug

    获取角度 ,官方提供了 Vector2.Angle 来得值,他的值是在 0  ,180之间 原始代码是 public static float Angle(Vector3 from, Vector3 ...

  5. 偏流角(Draft Angle)在等距螺旋中的作用

    劳动改变人,思维改变世界.我们可以接着聊螺旋线了. 在飞行程序设计中,偏流角(Draft Angle简写为DA)通常指得是受侧风影响航向偏移的最大角度.用速度向量来表示时,是图1中的三角形关系: 图1 ...

  6. codeforces820B Mister B and Angle in Polygon 2017-06-28 09:42 123人阅读 评论(0) 收藏

    B. Mister B and Angle in Polygon time limit per test 2 seconds memory limit per test 256 megabytes i ...

  7. WorldWind源码剖析系列:角度类Angle

    PluginSDK中的角度结构体Angle类图如下所示. 角度结构体主要定义了一个弧度表示角度值的字段:double Radians.还有几个表示角度最大值.最小值.非数值和零角度等字段.定义了一个D ...

  8. Codeforces 820B - Mister B and Angle in Polygon

    820B - Mister B and Angle in Polygon 思路: 由于正多边形以某个顶点分成的三角形后以这个点为顶点的角都相等,所以可以确定两个点为相邻点,只要再找一个点就够了. 证明 ...

  9. 【数学】【CF1096C】 Polygon for the Angle

    Description 给定一个角度 \(\theta\),请你寻找一个正 \(n\) 边型,满足在这个正 \(n\) 边型上找三个顶点 \(A,B,C\) (可以不相邻),使得 \(\angle A ...

随机推荐

  1. cocos2d-x中本地推送消息

    作者:HU 转载请注明,原文链接:http://www.cnblogs.com/xioapingguo/p/4038277.html  IOS下很简单: 添加一条推送 void PushNotific ...

  2. 网络防火墙实战-基于pfsense(1)

    pfSense是一个免费的,开源的FreeBSD作为防火墙和路由器专为使用自定义版本.除了 是一个功能强大的,灵活的防火墙和路由平台,它包括一个长长的清单相关的功能,并允许进一步的扩展包,不添加膨胀和 ...

  3. SICP 习题 (1.14)解题总结

    SICP 习题 1.14要求计算出过程count-change的增长阶.count-change是书中1.2.2节讲解的用于计算零钱找换方案的过程. 要解答习题1.14,首先你需要理解count-ch ...

  4. ios开发——实用技术篇Swift&Swift调用C、C++、Object

    Swift调用C.C++.Object 1.Swift调用C语言a,首先在项目中添加 CFile 文件命名为CHello,同时产生桥梁文件. b,创建之后的项目结构 b,在CHello.h文件中编写接 ...

  5. WebService 设计总结

    接触过非常多电商的WebService,有种一看就蛋疼的设计,今天要从这个反例说一说 WebService 的设计. [WebMethod] public string QueryOrderDetai ...

  6. CodeMachine Debugger Extension DLL

    http://www.codemachine.com/downloads.html http://www.codemachine.com/tool_cmkd.html#stack

  7. [Effective C++ --010]令赋值操作符返回一个reference to *this

    差不多最经典的就是这个了: x = y = z = ; 解读为: x = (y = ( z = )); 如果没有返回值,上述代码就不能通过编译. 其实看到标题就差不多明白这一条了,但是为什么连续赋值时 ...

  8. Mantis 安装与配置

    1. 适用范围 a. 本文介绍基于 Windows 下的缺陷管理平台 Mantis. 2. 软件准备 a. 下载 EasyPHP:http://www.easyphp.org/easyphp-devs ...

  9. 多台Linux服务器SSH相互访问无需密码--转

    一.环境配置 1.系统:CentOS release 5.6   IP:192.168.4.200   主机名:JW01 2.系统:CentOS release 5.9   IP:192.168.4. ...

  10. Service的启动与停止、绑定与解绑

    ---恢复内容开始--- Service的意义就在于当软件停止之后还可以在背景中进行运行,换句话也就是说,比如一个音乐播放器,当我们退出音乐播放器的时候,还是希望它在背景中运行,也就是一直播放着音乐, ...