Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Sample Android app demonstrating OpenGL-ES 2.0 shader programs

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 jni at least the shader programs compile without errors... July 20, 2012
Octocat-spinner-32 res
Octocat-spinner-32 src
Octocat-spinner-32 .gitignore create project July 20, 2012
Octocat-spinner-32 AndroidManifest.xml
Octocat-spinner-32 INSTALL correct explanation June 19, 2013
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 build.xml
Octocat-spinner-32 project.properties
README
GLES 2.0 Sample is a sample Android application that does 3D animation
using OpenGL-ES 2.0 (available with Android 2.2 and later). The 2.0
version of OpenGL-ES throws away the traditional OpenGL fixed-function
pipeline (built-in transformation matrix, lighting and materials
functions) in favour of shader programs that you must completely
specify yourself. Google's Java sample code that comes with the
Android SDK includes only the most trivial example of how to write
such shaders; hopefully this sample will be a slightly more
interesting one to learn from and build on.

The source code includes the following Java utility classes:
  * BaseRenderer: simplifies some aspects of implementing a
    GLSurfaceView.Renderer class.
  * BundledSavedState: generic class for easier implementation of
    save/restore instance state in a custom View
  * GeomBuilder: basic management of 3D object geometry with choice of
    wireframe or shaded rendering, allowing customization of the
    vertex shader program to implement materials, lighting etc
  * GLUseful: useful OpenGL-related stuff, including error-checking
    and management of shader programs
  * GLTextureView: displays a texture on a planar rectangle in OpenGL
  * GLBitmapView: takes an image rendered via a Canvas to an offscreen
    Bitmap and displays it as a texture via GLTextureView
  * Lathe: uses GeomBuilder to construct objects with rotational
    symmetry
  * Mat4f: functional operations on matrices representing 3D
    homogeneous coordinates
  * PaintBuilder: convenient construction of Paint objects by chaining
    setup calls
  * Rotation: manipulation of rotation transformations based on quaternions
  * Vec3f: functional operations on vectors representing 3D coordinates
and the following C utility code:
  * gl_useful.c -- contains an alternative to glGetShaderInfoLog which
    actually works.

When the animation is running, tap the view to bring up a dialog that
allows a choice between shaded and wireframe rendering modes.

Contents:
    README -- this file
    INSTALL -- build/installation instructions
    jni/ -- C sources for the Android app
    src/ -- Java sources for the Android app, split into
        src/lib/ -- reusable classes as listed above
        src/app/ -- classes specific to this example app
    res/ -- resources for the Android app
    AndroidManifest.xml, build.xml, *.properties -- for driving
        Google's Android build tools (note that you will have to
        provide a couple more of these--see INSTALL for details)
    LICENSE -- licence (Apache 2.0, same as Google's sample code)

Lawrence D'Oliveiro <ldo@geek-central.gen.nz>
Something went wrong with that request. Please try again.