├── app ├── .gitignore ├── src │ ├── main │ │ ├── assets │ │ │ ├── vr │ │ │ │ ├── 360sp.jpg │ │ │ │ ├── skysphere.frag │ │ │ │ └── skysphere.vert │ │ │ ├── 3dres │ │ │ │ ├── eye1.png │ │ │ │ ├── mouth1.png │ │ │ │ ├── pikagen.png │ │ │ │ ├── Char_Patrick.png │ │ │ │ ├── obj.frag │ │ │ │ ├── pikachu.mtl │ │ │ │ ├── patrick.mtl │ │ │ │ ├── obj2.frag │ │ │ │ ├── obj.vert │ │ │ │ └── obj2.vert │ │ │ ├── etczip │ │ │ │ └── cc.zip │ │ │ ├── lookup │ │ │ │ ├── purity.png │ │ │ │ ├── amatorka.png │ │ │ │ ├── highkey.png │ │ │ │ ├── lookup.vert │ │ │ │ └── lookup.frag │ │ │ ├── texture │ │ │ │ └── fengj.png │ │ │ ├── vary │ │ │ │ ├── fragment.sh │ │ │ │ └── vertex.sh │ │ │ ├── fshader │ │ │ │ ├── Cone.sh │ │ │ │ ├── Texture.sh │ │ │ │ ├── BallWithLight.sh │ │ │ │ └── Beauty.sh │ │ │ ├── vshader │ │ │ │ ├── SingleColor.sh │ │ │ │ ├── ImageDefault.sh │ │ │ │ ├── Texture.sh │ │ │ │ ├── Cone.sh │ │ │ │ ├── Ball.sh │ │ │ │ └── BallWithLight.sh │ │ │ ├── light │ │ │ │ ├── light.frag │ │ │ │ └── light.vert │ │ │ ├── shader │ │ │ │ ├── base_fragment.sh │ │ │ │ ├── pkm_mul.vert │ │ │ │ ├── base_vertex.sh │ │ │ │ ├── oes │ │ │ │ │ ├── default_vertex.sh │ │ │ │ │ └── default_fragment.sh │ │ │ │ ├── oes_base_fragment.sh │ │ │ │ ├── color │ │ │ │ │ └── gray_fragment.frag │ │ │ │ ├── pkm_mul.frag │ │ │ │ ├── oes_base_vertex.sh │ │ │ │ └── beauty │ │ │ │ │ ├── beauty.vert │ │ │ │ │ └── beauty.frag │ │ │ ├── filter │ │ │ │ ├── default_fragment.sh │ │ │ │ ├── default_vertex.sh │ │ │ │ ├── fugu_fragment.sh │ │ │ │ ├── half_color_vertex.sh │ │ │ │ ├── color_fragment.sh │ │ │ │ └── half_color_fragment.sh │ │ │ └── camera │ │ │ │ ├── camera_fragment.sh │ │ │ │ └── camera_vertex.sh │ │ ├── ic_launcher-web.png │ │ ├── res │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── bg.jpg │ │ │ │ ├── src.png │ │ │ │ ├── logo.png │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── btn_camera_all.png │ │ │ │ └── btn_camera_all_click.png │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── layout │ │ │ │ ├── activity_vary.xml │ │ │ │ ├── glview.xml │ │ │ │ ├── titlebar.xml │ │ │ │ ├── activity_opengl.xml │ │ │ │ ├── activity_camera.xml │ │ │ │ ├── activity_obj.xml │ │ │ │ ├── activity_picture.xml │ │ │ │ ├── item_button.xml │ │ │ │ ├── item_text.xml │ │ │ │ ├── activity_list.xml │ │ │ │ ├── item_choose.xml │ │ │ │ ├── activity_ani.xml │ │ │ │ ├── activity_egl_back_env.xml │ │ │ │ ├── activity_zip.xml │ │ │ │ ├── activity_fbo.xml │ │ │ │ ├── activity_fglview.xml │ │ │ │ ├── activity_camera2.xml │ │ │ │ ├── activity_camera3.xml │ │ │ │ ├── activity_light.xml │ │ │ │ ├── activity_blend.xml │ │ │ │ └── activity_main.xml │ │ │ ├── drawable │ │ │ │ ├── btn_shutter_background.xml │ │ │ │ └── btn_bg.xml │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── styles.xml │ │ │ │ ├── colors.xml │ │ │ │ └── strings.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── menu │ │ │ │ └── menu_filter.xml │ │ ├── java │ │ │ └── edu │ │ │ │ └── wuwang │ │ │ │ └── opengl │ │ │ │ ├── camera │ │ │ │ ├── FrameCallback.java │ │ │ │ ├── Renderer.java │ │ │ │ ├── IAiyaCamera.java │ │ │ │ ├── ICamera.java │ │ │ │ ├── Camera3Activity.java │ │ │ │ ├── CameraActivity.java │ │ │ │ ├── CameraView.java │ │ │ │ ├── TextureFilter.java │ │ │ │ └── CameraDrawer.java │ │ │ │ ├── egl │ │ │ │ ├── GlError.java │ │ │ │ ├── GLES20BackEnv.java │ │ │ │ └── EGLBackEnvActivity.java │ │ │ │ ├── BaseActivity.java │ │ │ │ ├── etc │ │ │ │ ├── StateChangeListener.java │ │ │ │ ├── ZipActivity.java │ │ │ │ └── ZipAniView.java │ │ │ │ ├── filter │ │ │ │ ├── NoFilter.java │ │ │ │ ├── GrayFilter.java │ │ │ │ ├── OesFilter.java │ │ │ │ ├── CameraFilter.java │ │ │ │ ├── LookupFilter.java │ │ │ │ ├── Beauty.java │ │ │ │ └── WaterMarkFilter.java │ │ │ │ ├── render │ │ │ │ ├── Shape.java │ │ │ │ ├── FGLView.java │ │ │ │ ├── FGLRender.java │ │ │ │ ├── FGLViewActivity.java │ │ │ │ ├── Cone.java │ │ │ │ ├── Triangle.java │ │ │ │ ├── Cylinder.java │ │ │ │ ├── BallWithLight.java │ │ │ │ ├── Ball.java │ │ │ │ └── TriangleWithCamera.java │ │ │ │ ├── blend │ │ │ │ └── SquareRelativeLayout.java │ │ │ │ ├── obj │ │ │ │ ├── MtlInfo.java │ │ │ │ ├── ObjLoadActivity.java │ │ │ │ ├── ObjLoadActivity2.java │ │ │ │ ├── Obj3D.java │ │ │ │ ├── ObjFilter.java │ │ │ │ └── ObjFilter2.java │ │ │ │ ├── vary │ │ │ │ ├── VaryActivity.java │ │ │ │ ├── VaryRender.java │ │ │ │ └── Cube.java │ │ │ │ ├── image │ │ │ │ ├── filter │ │ │ │ │ ├── ContrastColorFilter.java │ │ │ │ │ └── ColorFilter.java │ │ │ │ ├── SGLView.java │ │ │ │ ├── SGLRender.java │ │ │ │ └── SGLViewActivity.java │ │ │ │ ├── vr │ │ │ │ ├── MatrixHelper.java │ │ │ │ └── VrContextActivity.java │ │ │ │ ├── utils │ │ │ │ ├── PermissionUtils.java │ │ │ │ ├── VaryTools.java │ │ │ │ ├── EasyGlUtils.java │ │ │ │ └── ShaderUtils.java │ │ │ │ ├── MainActivity.java │ │ │ │ └── ChooseActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── edu │ │ │ └── wuwang │ │ │ └── opengl │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── edu │ │ └── wuwang │ │ └── opengl │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── ken.md ├── .idea ├── copyright │ └── profiles_settings.xml ├── vcs.xml ├── runConfigurations.xml ├── modules.xml ├── gradle.xml ├── compiler.xml ├── misc.xml └── encodings.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── README.md └── gradlew.bat /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /ken.md: -------------------------------------------------------------------------------- 1 | 1. ETC1 将Alpha与RGB合并为一张图片时候,图片拉升滤波采样会导致边界颜色错误 -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/assets/vr/360sp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/assets/vr/360sp.jpg -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/assets/3dres/eye1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/assets/3dres/eye1.png -------------------------------------------------------------------------------- /app/src/main/assets/etczip/cc.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/assets/etczip/cc.zip -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/assets/3dres/mouth1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/assets/3dres/mouth1.png -------------------------------------------------------------------------------- /app/src/main/assets/3dres/pikagen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/assets/3dres/pikagen.png -------------------------------------------------------------------------------- /app/src/main/assets/lookup/purity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/assets/lookup/purity.png -------------------------------------------------------------------------------- /app/src/main/assets/texture/fengj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/assets/texture/fengj.png -------------------------------------------------------------------------------- /app/src/main/assets/vary/fragment.sh: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | varying vec4 vColor; 3 | void main() { 4 | gl_FragColor =vColor; 5 | } -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/res/mipmap-xhdpi/bg.jpg -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/src.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/res/mipmap-xhdpi/src.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /app/src/main/assets/fshader/Cone.sh: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | varying vec4 vColor; 3 | 4 | void main(){ 5 | gl_FragColor=vColor; 6 | } -------------------------------------------------------------------------------- /app/src/main/assets/lookup/amatorka.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/assets/lookup/amatorka.png -------------------------------------------------------------------------------- /app/src/main/assets/lookup/highkey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/assets/lookup/highkey.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/res/mipmap-xhdpi/logo.png -------------------------------------------------------------------------------- /app/src/main/assets/3dres/Char_Patrick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/assets/3dres/Char_Patrick.png -------------------------------------------------------------------------------- /app/src/main/assets/vshader/SingleColor.sh: -------------------------------------------------------------------------------- 1 | uniform mat4 vMatrix; 2 | attribute vec4 vPosition; 3 | 4 | void main(){ 5 | gl_Position=vPosition; 6 | } -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/btn_camera_all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/res/mipmap-xhdpi/btn_camera_all.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/btn_camera_all_click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doggycoder/AndroidOpenGLDemo/HEAD/app/src/main/res/mipmap-xhdpi/btn_camera_all_click.png -------------------------------------------------------------------------------- /app/src/main/assets/light/light.frag: -------------------------------------------------------------------------------- 1 | precision highp float; 2 | 3 | //uniform sampler2D uTexture; 4 | varying vec4 vColor; 5 | 6 | void main(){ 7 | gl_FragColor=vColor; 8 | } -------------------------------------------------------------------------------- /app/src/main/assets/fshader/Texture.sh: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying vec2 vCoord; 4 | uniform sampler2D vTexture; 5 | void main() 6 | { 7 | gl_FragColor = texture2D(vTexture, vCoord); 8 | } -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/assets/vshader/ImageDefault.sh: -------------------------------------------------------------------------------- 1 | attribute vec4 vPosition; 2 | attribute vec2 aCoord; 3 | 4 | varying vec2 vCoord; 5 | 6 | void main(){ 7 | gl_Position = vPosition; 8 | vCoord = aCoord; 9 | } -------------------------------------------------------------------------------- /app/src/main/assets/vary/vertex.sh: -------------------------------------------------------------------------------- 1 | attribute vec4 vPosition; 2 | uniform mat4 vMatrix; 3 | varying vec4 vColor; 4 | attribute vec4 aColor; 5 | void main() { 6 | gl_Position = vMatrix*vPosition; 7 | vColor=aColor; 8 | } -------------------------------------------------------------------------------- /app/src/main/assets/shader/base_fragment.sh: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | varying vec2 textureCoordinate; 3 | uniform sampler2D vTexture; 4 | void main() { 5 | gl_FragColor = texture2D( vTexture, textureCoordinate ); 6 | } -------------------------------------------------------------------------------- /app/src/main/assets/vshader/Texture.sh: -------------------------------------------------------------------------------- 1 | uniform mat4 vMatrix; 2 | 3 | attribute vec4 vPosition; 4 | attribute vec2 aCoord; 5 | varying vec2 vCoord; 6 | void main(){ 7 | gl_Position = vPosition; 8 | vCoord = aCoord; 9 | } -------------------------------------------------------------------------------- /app/src/main/assets/vr/skysphere.frag: -------------------------------------------------------------------------------- 1 | precision highp float; 2 | 3 | uniform sampler2D uTexture; 4 | varying vec2 vCoordinate; 5 | 6 | void main(){ 7 | vec4 color=texture2D(uTexture,vCoordinate); 8 | gl_FragColor=color; 9 | } -------------------------------------------------------------------------------- /app/src/main/assets/shader/pkm_mul.vert: -------------------------------------------------------------------------------- 1 | attribute vec4 vPosition; 2 | attribute vec2 vCoord; 3 | varying vec2 aCoord; 4 | uniform mat4 vMatrix; 5 | 6 | void main(){ 7 | aCoord = vCoord; 8 | gl_Position = vMatrix*vPosition; 9 | } -------------------------------------------------------------------------------- /app/src/main/java/edu/wuwang/opengl/camera/FrameCallback.java: -------------------------------------------------------------------------------- 1 | package edu.wuwang.opengl.camera; 2 | 3 | /** 4 | * Description: 5 | */ 6 | public interface FrameCallback { 7 | 8 | void onFrame(byte[] bytes, long time); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/assets/filter/default_fragment.sh: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | 3 | uniform sampler2D vTexture; 4 | uniform int vIsHalf; 5 | 6 | varying vec2 aCoordinate; 7 | 8 | void main(){ 9 | gl_FragColor=texture2D(vTexture,aCoordinate); 10 | } -------------------------------------------------------------------------------- /app/src/main/assets/fshader/BallWithLight.sh: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | varying vec4 vDiffuse;//接收从顶点着色器过来的散射光分量 3 | void main(){ 4 | vec4 finalColor=vec4(1.0); 5 | //给此片元颜色值 6 | gl_FragColor=finalColor*vDiffuse+finalColor*vec4(0.15,0.15,0.15,1.0); 7 | } -------------------------------------------------------------------------------- /app/src/main/assets/filter/default_vertex.sh: -------------------------------------------------------------------------------- 1 | attribute vec4 vPosition; 2 | attribute vec2 vCoordinate; 3 | uniform mat4 vMatrix; 4 | 5 | varying vec2 aCoordinate; 6 | 7 | void main(){ 8 | gl_Position=vMatrix*vPosition; 9 | aCoordinate=vCoordinate; 10 | } -------------------------------------------------------------------------------- /app/src/main/assets/lookup/lookup.vert: -------------------------------------------------------------------------------- 1 | attribute vec4 vPosition; 2 | attribute vec2 vCoord; 3 | uniform mat4 vMatrix; 4 | 5 | varying vec2 textureCoordinate; 6 | 7 | void main(){ 8 | gl_Position = vMatrix*vPosition; 9 | textureCoordinate = vCoord; 10 | } -------------------------------------------------------------------------------- /app/src/main/assets/shader/base_vertex.sh: -------------------------------------------------------------------------------- 1 | attribute vec4 vPosition; 2 | attribute vec2 vCoord; 3 | uniform mat4 vMatrix; 4 | 5 | varying vec2 textureCoordinate; 6 | 7 | void main(){ 8 | gl_Position = vMatrix*vPosition; 9 | textureCoordinate = vCoord; 10 | } -------------------------------------------------------------------------------- /app/src/main/assets/shader/oes/default_vertex.sh: -------------------------------------------------------------------------------- 1 | attribute vec4 vPosition; 2 | attribute vec2 vCoordinate; 3 | uniform mat4 vMatrix; 4 | 5 | varying vec2 aCoordinate; 6 | 7 | void main(){ 8 | gl_Position=vMatrix*vPosition; 9 | aCoordinate=vCoordinate; 10 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_vary.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/assets/camera/camera_fragment.sh: -------------------------------------------------------------------------------- 1 | #extension GL_OES_EGL_image_external : require 2 | precision mediump float; 3 | varying vec2 textureCoordinate; 4 | uniform samplerExternalOES s_texture; 5 | void main() { 6 | gl_FragColor = texture2D( s_texture, textureCoordinate ); 7 | } -------------------------------------------------------------------------------- /app/src/main/assets/shader/oes_base_fragment.sh: -------------------------------------------------------------------------------- 1 | #extension GL_OES_EGL_image_external : require 2 | precision mediump float; 3 | varying vec2 textureCoordinate; 4 | uniform samplerExternalOES vTexture; 5 | void main() { 6 | gl_FragColor = texture2D( vTexture, textureCoordinate ); 7 | } -------------------------------------------------------------------------------- /app/src/main/assets/shader/oes/default_fragment.sh: -------------------------------------------------------------------------------- 1 | #extension GL_OES_EGL_image_external : require 2 | precision mediump float; 3 | varying vec2 textureCoordinate; 4 | uniform samplerExternalOES vTexture; 5 | void main() { 6 | gl_FragColor = texture2D( vTexture, textureCoordinate ); 7 | } -------------------------------------------------------------------------------- /app/src/main/assets/camera/camera_vertex.sh: -------------------------------------------------------------------------------- 1 | attribute vec4 vPosition; 2 | uniform mat4 vMatrix; 3 | attribute vec2 inputTextureCoordinate; 4 | varying vec2 textureCoordinate; 5 | 6 | void main(){ 7 | gl_Position = vMatrix*vPosition; 8 | textureCoordinate = inputTextureCoordinate; 9 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/assets/shader/color/gray_fragment.frag: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | varying vec2 textureCoordinate; 3 | uniform sampler2D vTexture; 4 | void main() { 5 | vec4 color=texture2D( vTexture, textureCoordinate); 6 | float rgb=color.g; 7 | vec4 c=vec4(rgb,rgb,rgb,color.a); 8 | gl_FragColor = c; 9 | } -------------------------------------------------------------------------------- /app/src/main/assets/shader/pkm_mul.frag: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | varying vec2 aCoord; 3 | uniform sampler2D vTexture; 4 | uniform sampler2D vTextureAlpha; 5 | 6 | void main() { 7 | vec4 color=texture2D( vTexture, aCoord); 8 | color.a=texture2D(vTextureAlpha,aCoord).r; 9 | gl_FragColor = color; 10 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/glview.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /app/src/main/assets/3dres/obj.frag: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | varying vec2 textureCoordinate; 3 | uniform sampler2D vTexture; 4 | varying vec4 vDiffuse;//接收从顶点着色器过来的散射光分量 5 | void main() { 6 | vec4 finalColor=vec4(1.0); 7 | //给此片元颜色值 8 | gl_FragColor=finalColor*vDiffuse+finalColor*vec4(0.15,0.15,0.15,1.0); 9 | } -------------------------------------------------------------------------------- /app/src/main/assets/shader/oes_base_vertex.sh: -------------------------------------------------------------------------------- 1 | attribute vec4 vPosition; 2 | attribute vec2 vCoord; 3 | uniform mat4 vMatrix; 4 | uniform mat4 vCoordMatrix; 5 | varying vec2 textureCoordinate; 6 | 7 | void main(){ 8 | gl_Position = vMatrix*vPosition; 9 | textureCoordinate = (vCoordMatrix*vec4(vCoord,0,1)).xy; 10 | } -------------------------------------------------------------------------------- /app/src/main/assets/vshader/Cone.sh: -------------------------------------------------------------------------------- 1 | uniform mat4 vMatrix; 2 | varying vec4 vColor; 3 | attribute vec4 vPosition; 4 | 5 | void main(){ 6 | gl_Position=vMatrix*vPosition; 7 | if(vPosition.z!=0.0){ 8 | vColor=vec4(0.0,0.0,0.0,1.0); 9 | }else{ 10 | vColor=vec4(0.9,0.9,0.9,1.0); 11 | } 12 | } -------------------------------------------------------------------------------- /app/src/main/assets/filter/fugu_fragment.sh: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | 3 | uniform sampler2D vTexture; 4 | 5 | varying vec2 aCoordinate; 6 | 7 | void main(){ 8 | vec4 nColor=texture2D(vTexture,aCoordinate); 9 | float c=nColor.r*0.299+nColor.g*0.587+nColor.b*0.114; 10 | gl_FragColor=vec4(c,c,c,nColor.a); 11 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_shutter_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/assets/vshader/Ball.sh: -------------------------------------------------------------------------------- 1 | uniform mat4 vMatrix; 2 | varying vec4 vColor; 3 | attribute vec4 vPosition; 4 | 5 | void main(){ 6 | gl_Position=vMatrix*vPosition; 7 | float color; 8 | if(vPosition.z>0.0){ 9 | color=vPosition.z; 10 | }else{ 11 | color=-vPosition.z; 12 | } 13 | vColor=vec4(color,color,color,1.0); 14 | } -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | 10dp 7 | 16sp 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/assets/filter/half_color_vertex.sh: -------------------------------------------------------------------------------- 1 | attribute vec4 vPosition; 2 | attribute vec2 vCoordinate; 3 | uniform mat4 vMatrix; 4 | 5 | varying vec2 aCoordinate; 6 | varying vec4 aPos; 7 | varying vec4 gPosition; 8 | 9 | void main(){ 10 | gl_Position=vMatrix*vPosition; 11 | aPos=vPosition; 12 | aCoordinate=vCoordinate; 13 | gPosition=vMatrix*vPosition; 14 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/assets/vr/skysphere.vert: -------------------------------------------------------------------------------- 1 | uniform mat4 uProjMatrix; 2 | uniform mat4 uViewMatrix; 3 | uniform mat4 uModelMatrix; 4 | uniform mat4 uRotateMatrix; 5 | 6 | attribute vec3 aPosition; 7 | attribute vec2 aCoordinate; 8 | 9 | varying vec2 vCoordinate; 10 | 11 | void main(){ 12 | gl_Position=uProjMatrix*uRotateMatrix*uViewMatrix*uModelMatrix*vec4(aPosition,1); 13 | vCoordinate=aCoordinate; 14 | } -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/test/java/edu/wuwang/opengl/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package edu.wuwang.opengl; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/titlebar.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /app/src/main/java/edu/wuwang/opengl/camera/Renderer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Renderer.java 4 | * 5 | * Created by Wuwang on 2017/3/3 6 | * Copyright © 2016年 深圳哎吖科技. All rights reserved. 7 | */ 8 | package edu.wuwang.opengl.camera; 9 | 10 | import android.opengl.GLSurfaceView; 11 | 12 | /** 13 | * Description: 14 | */ 15 | public interface Renderer extends GLSurfaceView.Renderer { 16 | 17 | void onDestroy(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_opengl.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_camera.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | -------------------------------------------------------------------------------- /app/src/androidTest/java/edu/wuwang/opengl/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package edu.wuwang.opengl; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_obj.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_picture.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 |