Angle
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
- Visual Studio Community 2013
- Required to build ANGLE on Windows and for the packaged Windows 8.1 SDK.
- depot_tools
- Required to generate projects and build files, contribute patches, run the unit tests or build the shader compiler on non-Windows systems.
- 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 build, src, samples and tests directories. The projects can be regenerated by executing gclient runhooks
Building ANGLE
- Open one of the ANGLE Visual Studio solution files (see DevSetup#Getting_the_source).
- Select Build -> Configuration Manager
- In the "Active solution configuration:" drop down, select the desired configuration (eg. Release), and close the Configuration Manager.
- 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:
- 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.
- 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.
- 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.
- Copy libEGL.dll and libGLESv2.dll from the build output directory (see DevSetup#Building_ANGLE) into your application folder.
- 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:
- ShInitialize() initializes the translator library and must be called only once from each process using the translator.
- ShContructCompiler() creates a translator object for vertex or fragment shader.
- ShCompile() translates the given shader.
- ShDestruct() destroys the given translator.
- ShFinalize() shuts down the translator library and must be called only once from each process using the translator.
Angle的更多相关文章
- cvBox2D和RotatedRect中返回的角度angle详解
本文为作者原创,未经允许不得转载: 原文由作者发表在博客园: http://www.cnblogs.com/panxiaochun/p/5478555.html 关于cvBox2D和RotatedRe ...
- Rotate bitmap by real angle
tl;dr; Use GDI+ SetWorldTransform With WinAPI's SetWorldTransform you can transform the space of dev ...
- Body joints angle using Kinect
http://stackoverflow.com/questions/12608734/body-joints-angle-using-kinect-checking-time-interval?rq ...
- Vector2.Angle 的 bug
获取角度 ,官方提供了 Vector2.Angle 来得值,他的值是在 0 ,180之间 原始代码是 public static float Angle(Vector3 from, Vector3 ...
- 偏流角(Draft Angle)在等距螺旋中的作用
劳动改变人,思维改变世界.我们可以接着聊螺旋线了. 在飞行程序设计中,偏流角(Draft Angle简写为DA)通常指得是受侧风影响航向偏移的最大角度.用速度向量来表示时,是图1中的三角形关系: 图1 ...
- 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 ...
- WorldWind源码剖析系列:角度类Angle
PluginSDK中的角度结构体Angle类图如下所示. 角度结构体主要定义了一个弧度表示角度值的字段:double Radians.还有几个表示角度最大值.最小值.非数值和零角度等字段.定义了一个D ...
- Codeforces 820B - Mister B and Angle in Polygon
820B - Mister B and Angle in Polygon 思路: 由于正多边形以某个顶点分成的三角形后以这个点为顶点的角都相等,所以可以确定两个点为相邻点,只要再找一个点就够了. 证明 ...
- 【数学】【CF1096C】 Polygon for the Angle
Description 给定一个角度 \(\theta\),请你寻找一个正 \(n\) 边型,满足在这个正 \(n\) 边型上找三个顶点 \(A,B,C\) (可以不相邻),使得 \(\angle A ...
随机推荐
- JAVA常用设计模式整理
设计模式:一个程序员对设计模式的理解:“不懂”为什么要把很简单的东西搞得那么复杂.后来随着软件开发经验的增加才开始明白我所看到的“复杂”恰恰就是设计模式的精髓所在,我所理解的“简单”就是一把钥匙开一把 ...
- iOS UDID和UUID详解
这篇是普及知识来了,纯属消遣时间,有需要的可以遛一遛. UDID的全名为 Unique Device Identifier :设备唯一标识符.从名称上也可以看出,UDID这个东西是和设备有关的,而且是 ...
- Gitbook安装
Gitbook安装 Gitbook是从NMP安装的,命令行: $ npm install gitbook -g 安装完之后,你可以检验下是否安装成功: $ gitbook -V 0.4.2 如果你看到 ...
- Redis实战之征服 Redis + Jedis + Spring (一)
Redis + Jedis + Spring (一)—— 配置&常规操作(GET SET DEL)接着需要快速的调研下基于Spring框架下的Redis操作. 相关链接: Redis实战 Re ...
- 【转】linux中的cut/tr/join/split/xargs命令
1. cut命令 cut命令用于从文件或者标准输入中读取内容并截取每一行的特定部分并送到标准输出. 截取的方式有三种:一是按照字符位置,二是按照字节位置,三是使用一个分隔符将一行分割成多个field, ...
- Java连接MYSQL【转载】
这篇文章主要以MySQL为例讲下Java如何连接到数据库的. 当然,首先要安装有JDK(一般是JDK1.5.X).然后安装MySQL,这些都比较简单,具体过程就不说了.配置好这两个环境后,下载JDBC ...
- BZOJ 2241: [SDOI2011]打地鼠 暴力
2241: [SDOI2011]打地鼠 Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://www.lydsy.com/JudgeOnline/pro ...
- [MODx] 6. Cache '!' with login package
1. Install login package. 2. Create a Template called 'login': [[!Login? &loginResourceId=`13` / ...
- Java解析XML汇总(DOM/SAX/JDOM/DOM4j/XPath)
[目录] 一.[基础知识——扫盲] 二.[DOM.SAX.JDOM.DOM4j简单使用介绍] 三.[性能测试] 四.[对比] 五.[小插曲XPath] 六.[补充] 关键字:Java解析xml.解析x ...
- android学习日记03--常用控件tabSpec/tabHost
常用控件7.TabSpec和TabHost 比较常用的控件,感觉手机QQ的整体布局就是这个,只不过tab放在底部而已.TabSpec相当于浏览器的分页,而TabHost就相当于分页的集合TabSpec ...