List of usage examples for com.badlogic.gdx.graphics GL20 GL_DEPTH_TEST
int GL_DEPTH_TEST
To view the source code for com.badlogic.gdx.graphics GL20 GL_DEPTH_TEST.
Click Source Link
From source file:airfoil.Main.java
License:Open Source License
@Override public void render() { if (this.alive) { GLCommon gl = Gdx.gl;/*ww w . j a va 2 s. co m*/ gl.glViewport(0, 0, this.width, this.height); gl.glClearColor(ColorClear.r, ColorClear.g, ColorClear.b, ColorClear.a); gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glEnable(GL20.GL_DEPTH_TEST); gl.glDepthFunc(GL20.GL_LESS); /* */ this.renderMeshLines(this.database.getMesh(this.geometry)); } }
From source file:com.badlogic.invaders.Renderer.java
License:Apache License
public void render(Simulation simulation, float delta) { // We explicitly require GL10, otherwise we could've used the GLCommon // interface via Gdx.gl GL20 gl = Gdx.gl;// w ww .j av a 2 s .co m gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); renderBackground(); gl.glEnable(GL20.GL_DEPTH_TEST); gl.glEnable(GL20.GL_CULL_FACE); setProjectionAndCamera(simulation.ship); modelBatch.begin(camera); modelBatch.render(simulation.explosions); if (!simulation.ship.isExploding) modelBatch.render(simulation.ship, lights); modelBatch.render(simulation.invaders, lights); modelBatch.render(simulation.blocks); modelBatch.render(simulation.shots); modelBatch.end(); gl.glDisable(GL20.GL_CULL_FACE); gl.glDisable(GL20.GL_DEPTH_TEST); spriteBatch.setProjectionMatrix(viewMatrix); spriteBatch.begin(); if (simulation.ship.lives != lastLives || simulation.score != lastScore || simulation.wave != lastWave) { status = "lives: " + simulation.ship.lives + " wave: " + simulation.wave + " score: " + simulation.score; lastLives = simulation.ship.lives; lastScore = simulation.score; lastWave = simulation.wave; } spriteBatch.enableBlending(); font.draw(spriteBatch, status, 0, 320); spriteBatch.end(); invaderAngle += delta * 90; if (invaderAngle > 360) invaderAngle -= 360; }
From source file:com.blastedstudios.ledge.ui.postprocessing.PostProcessor.java
License:Apache License
/** Stops capturing the scene and apply the effect chain, if there is one. If the specified output framebuffer is NULL, then the * rendering will be performed to screen. */ public void render(FrameBuffer dest) { captureEnd();/*from w ww . j av a 2 s . c om*/ if (!hasCaptured) { return; } // Array<PostProcessorEffect> items = manager.items; Array<PostProcessorEffect> items = enabledEffects; int count = items.size; if (count > 0) { Gdx.gl.glDisable(GL20.GL_CULL_FACE); Gdx.gl.glDisable(GL20.GL_DEPTH_TEST); // render effects chain, [0,n-1] if (count > 1) { for (int i = 0; i < count - 1; i++) { PostProcessorEffect e = items.get(i); composite.capture(); { e.render(composite.getSourceBuffer(), composite.getResultBuffer()); } } // complete composite.end(); } if (listener != null && dest == null) { listener.beforeRenderToScreen(); } // render with null dest (to screen) items.get(count - 1).render(composite.getResultBuffer(), dest); // ensure default texture unit #0 is active Gdx.gl.glActiveTexture(GL20.GL_TEXTURE0); } else { Log.log("PostProcessor", "No post-processor effects enabled, aborting render"); } }
From source file:com.cyphercove.doublehelix.ParticleGroupStrategy.java
License:Apache License
@Override public void beforeGroups() { Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthMask(false); }
From source file:com.cyphercove.doublehelix.ParticleGroupStrategy.java
License:Apache License
@Override public void beforeBillboardGroups() { Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthMask(false); }
From source file:com.cyphercove.doublehelix.ParticleGroupStrategy.java
License:Apache License
@Override public void afterGroups() { Gdx.gl.glDisable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthMask(true); }
From source file:com.cyphercove.doublehelix.ParticleGroupStrategy.java
License:Apache License
@Override public void afterBillboardGroups() { Gdx.gl.glDisable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthMask(true); }
From source file:com.lum.scram.postprocessing.PostProcessor.java
License:Apache License
/** Stops capturing the scene and apply the effect chain, if there is one. If the specified output framebuffer is NULL, then the * rendering will be performed to screen. */ public void render(FrameBuffer dest) { captureEnd();/*from w ww . j av a 2 s . co m*/ if (!hasCaptured) { return; } // Array<PostProcessorEffect> items = manager.items; Array<PostProcessorEffect> items = enabledEffects; int count = items.size; if (count > 0) { Gdx.gl.glDisable(GL20.GL_CULL_FACE); Gdx.gl.glDisable(GL20.GL_DEPTH_TEST); // render effects chain, [0,n-1] if (count > 1) { for (int i = 0; i < count - 1; i++) { PostProcessorEffect e = items.get(i); composite.capture(); { e.render(composite.getSourceBuffer(), composite.getResultBuffer()); } } // complete composite.end(); } if (listener != null && dest == null) { listener.beforeRenderToScreen(); } // render with null dest (to screen) items.get(count - 1).render(composite.getResultBuffer(), dest); // ensure default texture unit #0 is active Gdx.gl.glActiveTexture(GL20.GL_TEXTURE0); } else { Gdx.app.log("PostProcessor", "No post-processor effects enabled, aborting render"); } }
From source file:com.lyeeedar.Graphics.ParticleEffects.ParticleEmitter.java
License:Open Source License
public static void begin(Camera cam) { Gdx.gl.glEnable(GL20.GL_BLEND);/*from ww w . ja v a2s. com*/ Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthMask(false); shader.begin(); shader.setUniformMatrix("u_pv", cam.combined); }
From source file:com.lyeeedar.Roguelike3D.Graphics.Models.SkyBox.java
License:Open Source License
public void render(Camera cam) { Gdx.gl.glDisable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthMask(false);//from ww w .j a v a 2s . c o m Gdx.gl.glDisable(GL20.GL_CULL_FACE); Gdx.gl20.glActiveTexture(SKYBOX_TEXTURE_ACTIVE_UNIT); Gdx.gl20.glBindTexture(GL20.GL_TEXTURE_CUBE_MAP, textureId); shader.begin(); shader.setUniformMatrix("u_pv", cam.combined); shader.setUniformf("u_pos", cam.position); shader.setUniformi("u_texture", 0); mesh.render(shader, GL20.GL_TRIANGLE_STRIP); shader.end(); Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthMask(true); Gdx.gl.glEnable(GL20.GL_CULL_FACE); }