本文整理汇总了Java中rajawali.extras.LensFlare类的典型用法代码示例。如果您正苦于以下问题:Java LensFlare类的具体用法?Java LensFlare怎么用?Java LensFlare使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LensFlare类属于rajawali.extras包,在下文中一共展示了LensFlare类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import rajawali.extras.LensFlare; //导入依赖的package包/类
@Override
protected void init() {
mLensFlares = new Stack<LensFlare>();
int[] maxVertexTextureImageUnits = new int[1];
GLES20.glGetIntegerv(GLES20.GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, maxVertexTextureImageUnits, 0);
mVertexTextureSupported = maxVertexTextureImageUnits[0] != 0;
int i = 0, j = 0;
int numVertices = 8;
float[] vertices = new float[numVertices];
float[] textureCoords = new float[numVertices];
float[] normals = new float[numVertices * 3];
float[] colors = new float[numVertices * 4];
int[] indices = new int[6];
int vertexCount = 0;
int texCoordCount = 0;
// Create a quad with vertices at (-1, -1), (1, -1), (1, 1), (-1, 1).
vertices[vertexCount++] = -1;
vertices[vertexCount++] = -1;
vertices[vertexCount++] = 1;
vertices[vertexCount++] = -1;
vertices[vertexCount++] = 1;
vertices[vertexCount++] = 1;
vertices[vertexCount++] = -1;
vertices[vertexCount++] = 1;
// Each vertex normals are facing upwards on the Y-axis.
for (j = 0; j < numVertices; j += 3) {
normals[j] = 0;
normals[j + 1] = 1;
normals[j + 2] = 0;
}
// Texture (UV) coordinates are at (0, 0), (1, 0), (1, 1), (0, 1).
textureCoords[texCoordCount++] = 0;
textureCoords[texCoordCount++] = 0;
textureCoords[texCoordCount++] = 1;
textureCoords[texCoordCount++] = 0;
textureCoords[texCoordCount++] = 1;
textureCoords[texCoordCount++] = 1;
textureCoords[texCoordCount++] = 0;
textureCoords[texCoordCount++] = 1;
// Draw the vertices in the index order of 0 -> 1 -> 2 -> 0 -> 2 -> 3.
indices[i++] = 0;
indices[i++] = 1;
indices[i++] = 2;
indices[i++] = 0;
indices[i++] = 2;
indices[i++] = 3;
// Just default to yellow.
for (i = 0; i < colors.length; i += 4) {
colors[i] = 1.0f;
colors[i + 1] = 1.0f;
colors[i + 2] = 0.0f;
colors[i + 3] = 1.0f;
}
// Set geometry data.
setData(vertices, normals, textureCoords, colors, indices);
// Set up lookup textures.
mMapTexture = mRenderer.getTextureManager().addTexture(new ByteBuffer[0], null, 16, 16, TextureType.LOOKUP, Config.RGB_565, false, false, WrapType.CLAMP, FilterType.NEAREST);
mOcclusionMapTexture = mRenderer.getTextureManager().addTexture(new ByteBuffer[0], null, 16, 16, TextureType.LOOKUP, Config.ARGB_8888, false, false, WrapType.CLAMP, FilterType.NEAREST);
// Set up shader program.
// Currently vertex texture shader causes problems on Adreno 320 GPUs.
//if (mVertexTextureSupported) {
// setShaders(mVShaderVertexTexture, mFShaderVertexTexture);
//} else {
setShaders(mVShaderNoVertexTexture, mFShaderNoVertexTexture);
//}
}
示例2: addLensFlare
import rajawali.extras.LensFlare; //导入依赖的package包/类
public void addLensFlare(LensFlare lensFlare) {
mLensFlares.add(lensFlare);
}
示例3: removeLensFlare
import rajawali.extras.LensFlare; //导入依赖的package包/类
public boolean removeLensFlare(LensFlare lensFlare) {
return mLensFlares.remove(lensFlare);
}
示例4: init
import rajawali.extras.LensFlare; //导入依赖的package包/类
@Override
protected void init() {
mLensFlares = new Stack<LensFlare>();
int[] maxVertexTextureImageUnits = new int[1];
GLES20.glGetIntegerv(GLES20.GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, maxVertexTextureImageUnits, 0);
mVertexTextureSupported = maxVertexTextureImageUnits[0] != 0;
int i = 0, j = 0;
int numVertices = 8;
float[] vertices = new float[numVertices];
float[] textureCoords = new float[numVertices];
float[] normals = new float[numVertices * 3];
float[] colors = new float[numVertices * 4];
int[] indices = new int[6];
int vertexCount = 0;
int texCoordCount = 0;
// Create a quad with vertices at (-1, -1), (1, -1), (1, 1), (-1, 1).
vertices[vertexCount++] = -1; vertices[vertexCount++] = -1;
vertices[vertexCount++] = 1; vertices[vertexCount++] = -1;
vertices[vertexCount++] = 1; vertices[vertexCount++] = 1;
vertices[vertexCount++] = -1; vertices[vertexCount++] = 1;
// Each vertex normals are facing upwards on the Y-axis.
for (j = 0; j < numVertices; j+=3) {
normals[j] = 0;
normals[j+1] = 1;
normals[j+2] = 0;
}
// Texture (UV) coordinates are at (0, 0), (1, 0), (1, 1), (0, 1).
textureCoords[texCoordCount++] = 0; textureCoords[texCoordCount++] = 0;
textureCoords[texCoordCount++] = 1; textureCoords[texCoordCount++] = 0;
textureCoords[texCoordCount++] = 1; textureCoords[texCoordCount++] = 1;
textureCoords[texCoordCount++] = 0; textureCoords[texCoordCount++] = 1;
// Draw the vertices in the index order of 0 -> 1 -> 2 -> 0 -> 2 -> 3.
indices[i++] = 0; indices[i++] = 1; indices[i++] = 2;
indices[i++] = 0; indices[i++] = 2; indices[i++] = 3;
// Just default to yellow.
for (i = 0; i < colors.length; i+=4) {
colors[i] = 1.0f;
colors[i+1] = 1.0f;
colors[i+2] = 0.0f;
colors[i+3] = 1.0f;
}
// Set geometry data.
setData(vertices, normals, textureCoords, colors, indices);
// TODO: deal with this
/*
// Set up lookup textures.
mMapTexture = new TextureConfig(TextureType.LOOKUP);
mMapTexture.setBuffers(new ByteBuffer[0]);
mMapTexture = mRenderer.getTextureManager().addTexture(new ByteBuffer[0], null, 16, 16, TextureType.LOOKUP, Config.RGB_565, false, false, WrapType.CLAMP, FilterType.NEAREST);
mOcclusionMapTexture = mRenderer.getTextureManager().addTexture(new ByteBuffer[0], null, 16, 16, TextureType.LOOKUP, Config.ARGB_8888, false, false, WrapType.CLAMP, FilterType.NEAREST);
*/
// Set up shader program.
// Currently vertex texture shader causes problems on Adreno 320 GPUs.
//if (mVertexTextureSupported) {
// setShaders(mVShaderVertexTexture, mFShaderVertexTexture);
//} else {
setShaders(mVShaderNoVertexTexture, mFShaderNoVertexTexture);
//}
}
示例5: addLensFlare
import rajawali.extras.LensFlare; //导入依赖的package包/类
public void addLensFlare(LensFlare lensFlare) {
mLensFlares.add(lensFlare);
}
示例6: removeLensFlare
import rajawali.extras.LensFlare; //导入依赖的package包/类
public boolean removeLensFlare(LensFlare lensFlare) {
return mLensFlares.remove(lensFlare);
}
示例7: init
import rajawali.extras.LensFlare; //导入依赖的package包/类
@Override
protected void init() {
mLensFlares = new Stack<LensFlare>();
int[] maxVertexTextureImageUnits = new int[1];
GLES20.glGetIntegerv(GLES20.GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, maxVertexTextureImageUnits, 0);
mVertexTextureSupported = maxVertexTextureImageUnits[0] != 0;
int i = 0, j = 0;
int numVertices = 8;
float[] vertices = new float[numVertices];
float[] textureCoords = new float[numVertices];
float[] normals = new float[numVertices * 3];
float[] colors = new float[numVertices * 4];
int[] indices = new int[6];
int vertexCount = 0;
int texCoordCount = 0;
// Create a quad with vertices at (-1, -1), (1, -1), (1, 1), (-1, 1).
vertices[vertexCount++] = -1; vertices[vertexCount++] = -1;
vertices[vertexCount++] = 1; vertices[vertexCount++] = -1;
vertices[vertexCount++] = 1; vertices[vertexCount++] = 1;
vertices[vertexCount++] = -1; vertices[vertexCount++] = 1;
// Each vertex normals are facing upwards on the Y-axis.
for (j = 0; j < numVertices; j+=3) {
normals[j] = 0;
normals[j+1] = 1;
normals[j+2] = 0;
}
// Texture (UV) coordinates are at (0, 0), (1, 0), (1, 1), (0, 1).
textureCoords[texCoordCount++] = 0; textureCoords[texCoordCount++] = 0;
textureCoords[texCoordCount++] = 1; textureCoords[texCoordCount++] = 0;
textureCoords[texCoordCount++] = 1; textureCoords[texCoordCount++] = 1;
textureCoords[texCoordCount++] = 0; textureCoords[texCoordCount++] = 1;
// Draw the vertices in the index order of 0 -> 1 -> 2 -> 0 -> 2 -> 3.
indices[i++] = 0; indices[i++] = 1; indices[i++] = 2;
indices[i++] = 0; indices[i++] = 2; indices[i++] = 3;
// Just default to yellow.
for (i = 0; i < colors.length; i+=4) {
colors[i] = 1.0f;
colors[i+1] = 1.0f;
colors[i+2] = 0.0f;
colors[i+3] = 1.0f;
}
// Set geometry data.
setData(vertices, normals, textureCoords, colors, indices);
// Set up lookup textures.
mMapTexture = mRenderer.getTextureManager().addTexture(new ByteBuffer[0], null, 16, 16, TextureType.LOOKUP, Config.RGB_565, false, false, WrapType.CLAMP, FilterType.NEAREST);
mOcclusionMapTexture = mRenderer.getTextureManager().addTexture(new ByteBuffer[0], null, 16, 16, TextureType.LOOKUP, Config.ARGB_8888, false, false, WrapType.CLAMP, FilterType.NEAREST);
// Set up shader program.
// Currently vertex texture shader causes problems on Adreno 320 GPUs.
//if (mVertexTextureSupported) {
// setShaders(mVShaderVertexTexture, mFShaderVertexTexture);
//} else {
setShaders(mVShaderNoVertexTexture, mFShaderNoVertexTexture);
//}
}