Graphics Programs Reference
In-Depth Information
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D,
GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_REPEAT);
GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, img1, 0);
// load the 2nd texture
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D,
_textureId2);
InputStream is2 =
_context.getResources().openRawResource(R.drawable.brick2);
Bitmap img2;
try {
img2 = BitmapFactory.decodeStream(is2);
} finally {
try {
is2.close();
} catch(IOException e) {
// e.printStackTrace();
}
}
GLES20.glPixelStorei(GLES20.GL_UNPACK_ALIGNMENT, 1);
GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST); //
GL_LINEAR
GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D,
GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_REPEAT);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D,
GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_REPEAT);
GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, img2, 0);
Lighting Effects Using Shader Programs
OpenGL ES 1.1 provides built-in lighting models to compute the lighting equations
for various types of light source (point light, spot light, and so on). However, in ES
2.0, you must do all the math necessary to perform lighting effects. For this, you must
Search WWH ::




Custom Search