当前位置: 首页>>代码示例>>Java>>正文


Java LensFlare类代码示例

本文整理汇总了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);
    //}
}
 
开发者ID:BitMastro,项目名称:PortalLW,代码行数:76,代码来源:LensFlarePlugin.java

示例2: addLensFlare

import rajawali.extras.LensFlare; //导入依赖的package包/类
public void addLensFlare(LensFlare lensFlare) {
    mLensFlares.add(lensFlare);
}
 
开发者ID:BitMastro,项目名称:PortalLW,代码行数:4,代码来源:LensFlarePlugin.java

示例3: removeLensFlare

import rajawali.extras.LensFlare; //导入依赖的package包/类
public boolean removeLensFlare(LensFlare lensFlare) {
    return mLensFlares.remove(lensFlare);
}
 
开发者ID:BitMastro,项目名称:PortalLW,代码行数:4,代码来源:LensFlarePlugin.java

示例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);
	//}
}
 
开发者ID:takyonxxx,项目名称:IRobot-Android,代码行数:68,代码来源:LensFlarePlugin.java

示例5: addLensFlare

import rajawali.extras.LensFlare; //导入依赖的package包/类
public void addLensFlare(LensFlare lensFlare) {
	mLensFlares.add(lensFlare);
}
 
开发者ID:takyonxxx,项目名称:IRobot-Android,代码行数:4,代码来源:LensFlarePlugin.java

示例6: removeLensFlare

import rajawali.extras.LensFlare; //导入依赖的package包/类
public boolean removeLensFlare(LensFlare lensFlare) {
	return mLensFlares.remove(lensFlare);
}
 
开发者ID:takyonxxx,项目名称:IRobot-Android,代码行数:4,代码来源:LensFlarePlugin.java

示例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);
	//}
}
 
开发者ID:OpsLabJPL,项目名称:MarsImagesAndroid,代码行数:64,代码来源:LensFlarePlugin.java


注:本文中的rajawali.extras.LensFlare类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。