这是一个Android上的OpenGL ES 2.0 学习工程,我会不断地补充sample,并在关键代码处附上中英文注释。
This is a OpenGL 2.0 learning project for Android, and I will continue to code and commit samples and write chinese and english commets for some import code.
在我的掘金上,我会发布相关的Android OpenGL ES 2.0教学文章,包括每个例子的对应的讲解文章,以及一些其它知识,欢迎关注:https://juejin.im/user/5afabe81f265da0b7b361036/posts
I will publish some Android OpenGL ES 2.0 learning articles on my juejin, including the articles related to every samples in this project, and other knowledge. Welcome! Link: https://juejin.im/user/5afabe81f265da0b7b361036/posts
目前工程中有6个例子:
Now, this project contains 6 samples.
-
SampleHelloWorld
一个简单的Hello World例子,渲染一个三角形
A simple Hello World, render a triangle.
-
Sample2Triangles
渲染2个三角形。通过一次传递6个顶点,我们可以一次渲染2个三角形。
A simple of Rendering 2 triangles. We can render 2 triangles at a time by setting 6 vertices.
-
SampleVertexShader
这是一个使用vertex shader做顶点变换的例子,例子中将演示平移、缩放和旋转变换
This sample demonstrates how to do vertex translation,scale and rotation using vertex shader.
-
SampleFragmentShader
这是一个利用fragment shader渲染彩色三角形例子
This is a sample of using fragment shader to render a colorful triangle
-
SampleDrawMode
这是一个演示
GL_TRIANGLES
、GL_TRIANGLE_STRIP
和GL_TRIANGLE_FAN
三种绘制模式例子This sample demonstrates three commonly used draw modes,
GL_TRIANGLES
、GL_TRIANGLE_STRIP
andGL_TRIANGLE_FAN
-
SampleTexture
这是使用纹理的例子
This sample demonstrates how to use texture