安卓+ GL ES 2.0多色code样? [英] Android + GL ES 2.0 multi-colored code sample?
问题描述
几年前,我学到了一点了OpenGL(2.0版)。基本的例子都非常方便。人们可以有一些批处理命令(如 glVertex [...] 的)。
Years ago I learned a bit of OpenGL (version 2.0). The basic examples were all very easy. One could draw a colored triangle with a few batch commands (such as glVertex[...]).
现在我了解,这OpenGL ES 2.0的 德precates 这些命令的用法。所有的例子我觉得这包含自定义着色器,写一些着色器语言。虽然这可能是伟大的编写高定制的高性能的应用程序,它不能帮助,当你开始学习GL ES 2.0了很多。
Now I get to know, that OpenGL ES 2.0 deprecates the usage of such commands. All examples which I find contain custom shaders, written in some shader language. While it might be great for writing high-customizable high-performance apps, it doesn't help a lot when you start learning GL ES 2.0.
长话短说:请提供链接或$ C $最简单的的Android GL ES 2.0 的应用程序,它会绘制多种颜色的三角形C(和什么也不做)
Long story short: please provide link or code of the most simple Android GL ES 2.0 app which would draw a multi-colored triangle (and do nothing else).
感谢您!
推荐答案
的固定功能管线的API(glVertex等)在OpenGL ES不允许2.0+。
The fixed-function pipeline APIs (glVertex, et al) are not allowed in OpenGL ES 2.0+.
下面是一个链接到一个多彩色三角形渲染的样品,使用OpenGL ES 2.0: http://www.badadev.com/ OpenGL的ES-2-0-ON-巴达 - 着色器和 - 计划/
Here's a link to a multi-colored triangle rendering sample, using OpenGL ES 2.0: http://www.badadev.com/opengl-es-2-0-on-bada-shaders-and-programs/
从什么简单的世界你好的人区分上面的教程是稍微复杂一些的顶点着色器,以及如何顶点颜色传递给着色器。
What differentiates the tutorial above from simpler 'hello world' ones is the slightly more complex vertex shader and how vertex colors are passed to the shader.
如果您正在使用Android NDK,一个很好的出发点是HELLO-GL2的样品,用它。
If you are working with the Android NDK, a good starting point is the 'hello-gl2' sample that comes with it.
这篇关于安卓+ GL ES 2.0多色code样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!