當前位置: 首頁>>代碼示例>>Java>>正文


Java GL20.glDisableVertexAttribArray方法代碼示例

本文整理匯總了Java中org.lwjgl.opengl.GL20.glDisableVertexAttribArray方法的典型用法代碼示例。如果您正苦於以下問題:Java GL20.glDisableVertexAttribArray方法的具體用法?Java GL20.glDisableVertexAttribArray怎麽用?Java GL20.glDisableVertexAttribArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.lwjgl.opengl.GL20的用法示例。


在下文中一共展示了GL20.glDisableVertexAttribArray方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: unbindTexturedModel

import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
private void unbindTexturedModel() {
	MasterRenderer.enableCulling();
	GL20.glDisableVertexAttribArray(0);
	GL20.glDisableVertexAttribArray(1);
	GL20.glDisableVertexAttribArray(2);
	GL30.glBindVertexArray(0);
}
 
開發者ID:marcioz98,項目名稱:MRCEngine,代碼行數:8,代碼來源:EntityRenderer.java

示例2: 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

示例3: unbindTexturedModel

import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
private void unbindTexturedModel() {
    MasterRenderer.enableCulling();
    GL20.glDisableVertexAttribArray(0);
    GL20.glDisableVertexAttribArray(1);
    GL20.glDisableVertexAttribArray(2);
    GL30.glBindVertexArray(0);
}
 
開發者ID:Biacode,項目名稱:bia-engine,代碼行數:8,代碼來源:EntityRenderer.java

示例4: draw

import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public void draw(){
	GL30.glBindVertexArray(vao);
	GL20.glEnableVertexAttribArray(0);
	GL20.glEnableVertexAttribArray(1);
	
	GL11.glDrawElements(GL11.GL_TRIANGLES, 6, GL11.GL_UNSIGNED_INT, 0);
	
	GL20.glDisableVertexAttribArray(0);
	GL20.glDisableVertexAttribArray(1);
	GL30.glBindVertexArray(vao);
}
 
開發者ID:tek256,項目名稱:LD38,代碼行數:12,代碼來源:Quad.java

示例5: postRenderChunkLayer

import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public static void postRenderChunkLayer(BlockRenderLayer blockLayerIn)
{
    if (OpenGlHelper.useVbo())
    {
        GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY);
        GL20.glDisableVertexAttribArray(Shaders.midTexCoordAttrib);
        GL20.glDisableVertexAttribArray(Shaders.tangentAttrib);
        GL20.glDisableVertexAttribArray(Shaders.entityAttrib);
    }

    if (Shaders.isRenderBackFace(blockLayerIn))
    {
        GlStateManager.enableCull();
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:16,代碼來源:ShadersRender.java

示例6: 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

示例7: postRenderChunkLayer

import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public static void postRenderChunkLayer()
{
    if (OpenGlHelper.useVbo())
    {
        GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY);
        GL20.glDisableVertexAttribArray(Shaders.midTexCoordAttrib);
        GL20.glDisableVertexAttribArray(Shaders.tangentAttrib);
        GL20.glDisableVertexAttribArray(Shaders.entityAttrib);
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:11,代碼來源:ShadersRender.java

示例8: unbind

import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public void unbind()
{
	for(int i = 0; i < this.vertexBuffers.length; ++i)
	{
		if (this.vertexBuffers[i] != null)
		{
			GL20.glDisableVertexAttribArray(i);
		}
	}

	GL30.glBindVertexArray(0);
}
 
開發者ID:andykuo1,項目名稱:candlelight,代碼行數:13,代碼來源:Mesh.java

示例9: runShader

import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public static void runShader() {
	Minecraft mc = Minecraft.getMinecraft();
	
	//TODO remove
	if (Keyboard.isKeyDown(Keyboard.KEY_NUMPAD5)) {
		destroyShader();
		createShader();
	}
	
	//Use shader program
	GL20.glUseProgram(shader.getShaderProgram());
	
	//TODO third person view
	Entity entity = mc.getRenderViewEntity();
	float partialTicks = mc.getRenderPartialTicks();
	double entityPosX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks;
       double entityPosY = entity.lastTickPosY + entity.getEyeHeight() + (entity.posY - entity.lastTickPosY) * (double)partialTicks;
       double entityPosZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)partialTicks;
       float fov = (float) Math.toRadians(mc.entityRenderer.getFOVModifier(partialTicks, true));
	
	//Set uniform values
	int texUniform = GL20.glGetUniformLocation(shader.getShaderProgram(), "tex");
	GL20.glUniform1i(texUniform, 0);
	int cameraPosUniform = GL20.glGetUniformLocation(shader.getShaderProgram(), "cameraPos");
	GL20.glUniform3f(cameraPosUniform, (float)entityPosX%16, (float)entityPosY%16, (float)entityPosZ%16);
	int cameraDirUniform = GL20.glGetUniformLocation(shader.getShaderProgram(), "cameraDir");
	GL20.glUniform3f(cameraDirUniform, -(float)Math.toRadians(entity.rotationPitch), (float)Math.toRadians(180+entity.rotationYaw), 0);
	int fovyUniform = GL20.glGetUniformLocation(shader.getShaderProgram(), "fovy");
	GL20.glUniform1f(fovyUniform, fov);
	int fovxUniform = GL20.glGetUniformLocation(shader.getShaderProgram(), "fovx");
	GL20.glUniform1f(fovxUniform, fov*Display.getWidth()/(float)Display.getHeight());
	int sphericalUniform = GL20.glGetUniformLocation(shader.getShaderProgram(), "spherical");
	GL20.glUniform1i(sphericalUniform, RayTracerSettings.spherical ? 1 : 0);
	int stereoscopicUniform = GL20.glGetUniformLocation(shader.getShaderProgram(), "stereoscopic3d");
	GL20.glUniform1i(stereoscopicUniform, RayTracerSettings.stereoscopic ? 1 : 0);
	int eyeWidthUniform = GL20.glGetUniformLocation(shader.getShaderProgram(), "eyeWidth");
	GL20.glUniform1f(eyeWidthUniform, 0.063f); //TODO input eyeWidth option
	
	if (!pauseRendering) {
		if (worldLoader == null) {
			worldLoader = new WorldLoader();
		}
		if (worldLoader.dimension != mc.world.provider.getDimension()) {
			worldLoader.dimension = mc.world.provider.getDimension();
		}
		worldLoader.updateWorld(entityPosX, entityPosY, entityPosZ, shader);

		//Setup view
		GL11.glMatrixMode(GL11.GL_PROJECTION);
		GL11.glPushMatrix();
		GL11.glLoadIdentity();
		GL11.glOrtho(-1, 1, -1, 1, -1, 1);
		GL11.glMatrixMode(GL11.GL_MODELVIEW);
		GL11.glPushMatrix();
		GL11.glLoadIdentity();

		//Bind vbo and texture
		GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, shader.getVbo());
		GL20.glEnableVertexAttribArray(0);
		GL20.glVertexAttribPointer(0, 2, GL11.GL_BYTE, false, 0, 0L);
		GL11.glBindTexture(GL11.GL_TEXTURE_2D, 8);

		//Render
		GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, 6);

		//Reset vbo and texture
		GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);
		GL20.glDisableVertexAttribArray(0);
		GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);

		//Reset view
		GL11.glMatrixMode(GL11.GL_PROJECTION);
		GL11.glPopMatrix();
		GL11.glMatrixMode(GL11.GL_MODELVIEW);
		GL11.glPopMatrix();
	}
	
	//Stop using shader program
	GL20.glUseProgram(0);
}
 
開發者ID:18107,項目名稱:MC-Ray-Tracer,代碼行數:81,代碼來源:RenderUtil.java

示例10: unbind

import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public void unbind(int... attributes){
	for (int i : attributes) {
		GL20.glDisableVertexAttribArray(i);
	}
	unbind();
}
 
開發者ID:TheThinMatrix,項目名稱:OcclusionQueries,代碼行數:7,代碼來源:Vao.java

示例11: unbindTexturedModel

import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
private void unbindTexturedModel() {
    GL20.glDisableVertexAttribArray(0);
    GL20.glDisableVertexAttribArray(1);
    GL20.glDisableVertexAttribArray(2);
    GL30.glBindVertexArray(0);
}
 
開發者ID:Biacode,項目名稱:bia-engine,代碼行數:7,代碼來源:TerrainRenderer.java

示例12: disableAttribs

import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public void disableAttribs(int... attribs) {
	for (int i : attribs) {
		GL20.glDisableVertexAttribArray(i);
	}
}
 
開發者ID:TheThinMatrix,項目名稱:LowPolyWater,代碼行數:6,代碼來源:Vao.java

示例13: unbindTexturedModel

import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
private void unbindTexturedModel() {
	GL20.glDisableVertexAttribArray(0);
	GL20.glDisableVertexAttribArray(1);
	GL20.glDisableVertexAttribArray(2);
	GL30.glBindVertexArray(0);
}
 
開發者ID:DevipriyaSarkar,項目名稱:Terrain,代碼行數:7,代碼來源:TerrainRenderer.java

示例14: render

import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public static final void render() {

		shader.start();

		Renderer.blendFunction(BlendFunction.NONE);

		for (final Chunk chunk : Chunk.CHUNKS) {

			if (chunk.model == null || !chunk.render) continue;

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

			shader.loadTransformationMatrix(MatrixCreation.createTransformationMatrix(new Vec3(chunk.x * Chunk.H_SIZE, 0, chunk.z * Chunk.H_SIZE), new Vec3(), new Vec3(1, 1, 1)));
			GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, chunk.model.vertexCount);

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

		}

		shader.stop();

	}
 
開發者ID:ASasseCreations,項目名稱:Voxel_Game,代碼行數:31,代碼來源:ChunkRenderer.java

示例15: end

import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public static final void end() {

		if (HandModel.MODEL == null) return;

		Texture.unbind(0);

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

		GL30.glBindVertexArray(0);

		GL11.glEnable(GL11.GL_DEPTH_TEST);

	}
 
開發者ID:ASasseCreations,項目名稱:Voxel_Game,代碼行數:16,代碼來源:HandRenderer.java


注:本文中的org.lwjgl.opengl.GL20.glDisableVertexAttribArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。