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


Java GL20.glEnableVertexAttribArray方法代码示例

本文整理汇总了Java中org.lwjgl.opengl.GL20.glEnableVertexAttribArray方法的典型用法代码示例。如果您正苦于以下问题:Java GL20.glEnableVertexAttribArray方法的具体用法?Java GL20.glEnableVertexAttribArray怎么用?Java GL20.glEnableVertexAttribArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lwjgl.opengl.GL20的用法示例。


在下文中一共展示了GL20.glEnableVertexAttribArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepareTexturedModel

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
private void prepareTexturedModel(final TexturedModel model) {
    GL30.glBindVertexArray(model.getRawModel().getVaoId());
    GL20.glEnableVertexAttribArray(0);
    GL20.glEnableVertexAttribArray(1);
    GL20.glEnableVertexAttribArray(2);
    if (model.getTexture().isHasTransparency()) {
        MasterRenderer.disableCulling();
    }
    shader.loadFakeLightingVariable(model.getTexture().isUseFakeLighting());
    shader.loadShineVariables(
            model.getTexture().getShineDamper(),
            model.getTexture().getReflectivity()
    );
    GL13.glActiveTexture(GL13.GL_TEXTURE0);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getTextureId());
}
 
开发者ID:Biacode,项目名称:bia-engine,代码行数:17,代码来源:EntityRenderer.java

示例2: render

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public static final void render(final Vec3 position, final float scale) {

		shader.start();

		GL30.glBindVertexArray(model.id);
		GL20.glEnableVertexAttribArray(0);
		GL20.glEnableVertexAttribArray(1);
		GL20.glEnableVertexAttribArray(2);

		shader.loadTransformationMatrix(MatrixCreation.createTransformationMatrix(position, new Vec3(), new Vec3(scale, 1, scale)));
		GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, model.vertexCount);

		GL20.glDisableVertexAttribArray(0);
		GL20.glDisableVertexAttribArray(1);
		GL20.glDisableVertexAttribArray(2);
		GL30.glBindVertexArray(0);

		shader.stop();

	}
 
开发者ID:ASasseCreations,项目名称:Voxel_Game,代码行数:21,代码来源:CloudRenderer.java

示例3: preRenderChunkLayer

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public static void preRenderChunkLayer(BlockRenderLayer blockLayerIn)
{
    if (Shaders.isRenderBackFace(blockLayerIn))
    {
        GlStateManager.disableCull();
    }

    if (OpenGlHelper.useVbo())
    {
        GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
        GL20.glEnableVertexAttribArray(Shaders.midTexCoordAttrib);
        GL20.glEnableVertexAttribArray(Shaders.tangentAttrib);
        GL20.glEnableVertexAttribArray(Shaders.entityAttrib);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:16,代码来源:ShadersRender.java

示例4: prepareTerrain

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
private void prepareTerrain(Terrain terrain) {
		RawModel rawModel = terrain.getModel();
		GL30.glBindVertexArray(rawModel.getVaoID());
		GL20.glEnableVertexAttribArray(0);
		GL20.glEnableVertexAttribArray(1);
		GL20.glEnableVertexAttribArray(2);
		bindTextures(terrain);
		shader.loadShineVariables(1, 0);
}
 
开发者ID:marcioz98,项目名称:MRCEngine,代码行数:10,代码来源:TerrainRenderer.java

示例5: prepareTerrain

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
private void prepareTerrain(final Terrain terrain) {
    GL30.glBindVertexArray(terrain.getModel().getVaoId());
    GL20.glEnableVertexAttribArray(0);
    GL20.glEnableVertexAttribArray(1);
    GL20.glEnableVertexAttribArray(2);
    shader.loadShineVariables(
            terrain.getTexture().getShineDamper(),
            terrain.getTexture().getReflectivity()
    );
    GL13.glActiveTexture(GL13.GL_TEXTURE0);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, terrain.getTexture().getTextureId());
}
 
开发者ID:Biacode,项目名称:bia-engine,代码行数:13,代码来源:TerrainRenderer.java

示例6: bind

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
/**
 * Start using vertex array
 */
public void bind(){
	glBindVertexArray(vaoId);
	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indicesId);
	GL20.glEnableVertexAttribArray(0);
	GL20.glEnableVertexAttribArray(1);
	GL20.glEnableVertexAttribArray(2);
}
 
开发者ID:tacocat,项目名称:lambda,代码行数:11,代码来源:VertexArrayObject.java

示例7: prepareTexturedModel

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
private void prepareTexturedModel(TexturedModel model) {
	RawModel rawModel = model.getRawModel();
	GL30.glBindVertexArray(rawModel.getVaoID());
	GL20.glEnableVertexAttribArray(0);	// position coordinates
	GL20.glEnableVertexAttribArray(1);	// texture coordinates
	GL20.glEnableVertexAttribArray(2);	// normal coordinates 
	ModelTexture texture = model.getTexture();
	shader.loadShineVariable(texture.getShineDamper(), texture.getReflectivity());
	GL13.glActiveTexture(GL13.GL_TEXTURE0);	// activate texture bank - where sampler function will sample
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getID());
}
 
开发者ID:DevipriyaSarkar,项目名称:Terrain,代码行数:12,代码来源:EntityRenderer.java

示例8: drawArrays

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public static void drawArrays(int drawMode, int first, int count, VertexBuffer wrr)
{
    if (count != 0)
    {
        VertexFormat vertexformat = wrr.getVertexFormat();
        int i = vertexformat.getNextOffset();

        if (i == 56)
        {
            ByteBuffer bytebuffer = wrr.getByteBuffer();
            bytebuffer.position(32);
            GL20.glVertexAttribPointer(Shaders.midTexCoordAttrib, 2, GL11.GL_FLOAT, false, i, bytebuffer);
            bytebuffer.position(40);
            GL20.glVertexAttribPointer(Shaders.tangentAttrib, 4, GL11.GL_SHORT, false, i, bytebuffer);
            bytebuffer.position(48);
            GL20.glVertexAttribPointer(Shaders.entityAttrib, 3, GL11.GL_SHORT, false, i, bytebuffer);
            bytebuffer.position(0);
            GL20.glEnableVertexAttribArray(Shaders.midTexCoordAttrib);
            GL20.glEnableVertexAttribArray(Shaders.tangentAttrib);
            GL20.glEnableVertexAttribArray(Shaders.entityAttrib);
            GL11.glDrawArrays(drawMode, first, count);
            GL20.glDisableVertexAttribArray(Shaders.midTexCoordAttrib);
            GL20.glDisableVertexAttribArray(Shaders.tangentAttrib);
            GL20.glDisableVertexAttribArray(Shaders.entityAttrib);
        }
        else
        {
            GL11.glDrawArrays(drawMode, first, count);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:32,代码来源:SVertexBuilder.java

示例9: prepareTerrain

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
private void prepareTerrain(Terrain terrain) {
	RawModel rawModel = terrain.getModel();
	GL30.glBindVertexArray(rawModel.getVaoID());
	GL20.glEnableVertexAttribArray(0);
	GL20.glEnableVertexAttribArray(1);
	GL20.glEnableVertexAttribArray(2);
	ModelTexture texture = terrain.getTexture();
	shader.loadshineVariable(texture.getShineDamper(), texture.getReflectivity());
	GL13.glActiveTexture(GL13.GL_TEXTURE0);
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture.getID());
}
 
开发者ID:DevipriyaSarkar,项目名称:Terrain,代码行数:12,代码来源:TerrainRenderer.java

示例10: prepareTerrain

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
/**
 * Binds texture for shaders and rendering
 * @param terrain - terrain containing the texture.
 */
private void prepareTerrain(Terrain terrain) {
    RawModel rawModel = terrain.getModel();
    GL30.glBindVertexArray(rawModel.getVaoID());
    GL20.glEnableVertexAttribArray(0);
    GL20.glEnableVertexAttribArray(1);
    GL20.glEnableVertexAttribArray(2);

    bindTextures(terrain);
    UniformList.terrainShineDamper.loadData(1);
    UniformList.terrainReflectivity.loadData(0);
}
 
开发者ID:Essentria,项目名称:Elgin-Plant-Game,代码行数:16,代码来源:TerrainRenderer.java

示例11: drawArrays

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public static void drawArrays(int drawMode, int first, int count, WorldRenderer wrr)
{
    if (count != 0)
    {
        VertexFormat vertexformat = wrr.getVertexFormat();
        int i = vertexformat.getNextOffset();

        if (i == 56)
        {
            ByteBuffer bytebuffer = wrr.getByteBuffer();
            bytebuffer.position(32);
            GL20.glVertexAttribPointer(Shaders.midTexCoordAttrib, 2, GL11.GL_FLOAT, false, i, bytebuffer);
            bytebuffer.position(40);
            GL20.glVertexAttribPointer(Shaders.tangentAttrib, 4, GL11.GL_SHORT, false, i, bytebuffer);
            bytebuffer.position(48);
            GL20.glVertexAttribPointer(Shaders.entityAttrib, 3, GL11.GL_SHORT, false, i, bytebuffer);
            bytebuffer.position(0);
            GL20.glEnableVertexAttribArray(Shaders.midTexCoordAttrib);
            GL20.glEnableVertexAttribArray(Shaders.tangentAttrib);
            GL20.glEnableVertexAttribArray(Shaders.entityAttrib);
            GL11.glDrawArrays(drawMode, first, count);
            GL20.glDisableVertexAttribArray(Shaders.midTexCoordAttrib);
            GL20.glDisableVertexAttribArray(Shaders.tangentAttrib);
            GL20.glDisableVertexAttribArray(Shaders.entityAttrib);
        }
        else
        {
            GL11.glDrawArrays(drawMode, first, count);
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:32,代码来源:SVertexBuilder.java

示例12: preRenderChunkLayer

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public static void preRenderChunkLayer()
{
    if (OpenGlHelper.useVbo())
    {
        GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
        GL20.glEnableVertexAttribArray(Shaders.midTexCoordAttrib);
        GL20.glEnableVertexAttribArray(Shaders.tangentAttrib);
        GL20.glEnableVertexAttribArray(Shaders.entityAttrib);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:11,代码来源:ShadersRender.java

示例13: bind

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public void bind()
{
	GL30.glBindVertexArray(this.handle);

	for(int i = 0; i < this.vertexBuffers.length; ++i)
	{
		if (this.vertexBuffers[i] != null)
		{
			GL20.glEnableVertexAttribArray(i);
		}
	}
}
 
开发者ID:andykuo1,项目名称:candlelight,代码行数:13,代码来源:Mesh.java

示例14: bind

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public void bind(int... attributes){
	bind();
	for (int i : attributes) {
		GL20.glEnableVertexAttribArray(i);
	}
}
 
开发者ID:TheThinMatrix,项目名称:OpenGL-Animation,代码行数:7,代码来源:Vao.java

示例15: enableAttributes

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
/**
    * Enables all the stored attributes
    */
   protected void enableAttributes() {
for (int i = 0; i < attributes; i++)
    GL20.glEnableVertexAttribArray(i);
   }
 
开发者ID:camilne,项目名称:open-world,代码行数:8,代码来源:VAO.java


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