@Override public void glDepthFunc (int func) { calls++; gl20.glDepthFunc(func); check(); }
@Override public void glDepthFunc (int func) { calls++; gl20.glDepthFunc(func); check(); }
public void setDepthTest (final int depthFunction, final float depthRangeNear, final float depthRangeFar) { final boolean wasEnabled = depthFunc != 0; final boolean enabled = depthFunction != 0; if (depthFunc != depthFunction) { depthFunc = depthFunction; if (enabled) { Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthFunc(depthFunction); } else Gdx.gl.glDisable(GL20.GL_DEPTH_TEST); } if (enabled) { if (!wasEnabled || depthFunc != depthFunction) Gdx.gl.glDepthFunc(depthFunc = depthFunction); if (!wasEnabled || this.depthRangeNear != depthRangeNear || this.depthRangeFar != depthRangeFar) Gdx.gl.glDepthRangef(this.depthRangeNear = depthRangeNear, this.depthRangeFar = depthRangeFar); } }
public void setDepthTest (final int depthFunction, final float depthRangeNear, final float depthRangeFar) { final boolean wasEnabled = depthFunc != 0; final boolean enabled = depthFunction != 0; if (depthFunc != depthFunction) { depthFunc = depthFunction; if (enabled) { Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthFunc(depthFunction); } else Gdx.gl.glDisable(GL20.GL_DEPTH_TEST); } if (enabled) { if (!wasEnabled || depthFunc != depthFunction) Gdx.gl.glDepthFunc(depthFunc = depthFunction); if (!wasEnabled || this.depthRangeNear != depthRangeNear || this.depthRangeFar != depthRangeFar) Gdx.gl.glDepthRangef(this.depthRangeNear = depthRangeNear, this.depthRangeFar = depthRangeFar); } }
@Override public void render () { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthFunc(GL20.GL_LEQUAL); Gdx.gl.glCullFace(GL20.GL_BACK); modelView.translate(10f, 0, 10f).rotate(0, 1f, 0, 2f * Gdx.graphics.getDeltaTime()).translate(-10f, 0, -10f); cameraController.update(); textureArray.bind(); shaderProgram.begin(); shaderProgram.setUniformi("u_textureArray", 0); shaderProgram.setUniformMatrix("u_projViewTrans", camera.combined); shaderProgram.setUniformMatrix("u_modelView", modelView); terrain.render(shaderProgram, GL20.GL_TRIANGLES); shaderProgram.end(); }
@Override public void create () { Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthFunc(GL20.GL_LESS); egg = new Texture(Gdx.files.internal("data/egg.png")); egg.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear); egg.setWrap(Texture.TextureWrap.ClampToEdge, Texture.TextureWrap.ClampToEdge); wheel = new Texture(Gdx.files.internal("data/wheel.png")); wheel.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear); wheel.setWrap(Texture.TextureWrap.ClampToEdge, Texture.TextureWrap.ClampToEdge); w = Gdx.graphics.getWidth() / 0.8f; h = Gdx.graphics.getHeight() / 0.8f; for (int i = 0; i < INITIAL_RENDERED; i++) { toRender.add(makeDecal()); } cam = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.near = 0.1f; cam.far = 10f; cam.position.set(0, 0, 0.1f); cam.direction.set(0, 0, -1f); batch = new DecalBatch(new CameraGroupStrategy(cam)); Gdx.gl.glClearColor(1, 1, 0, 1); }
@Override public void glDepthFunc (int func) { calls++; gl20.glDepthFunc(func); check(); }
public void setDepthTest (final int depthFunction, final float depthRangeNear, final float depthRangeFar) { final boolean wasEnabled = depthFunc != 0; final boolean enabled = depthFunction != 0; if (depthFunc != depthFunction) { depthFunc = depthFunction; if (enabled) { Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthFunc(depthFunction); } else Gdx.gl.glDisable(GL20.GL_DEPTH_TEST); } if (enabled) { if (!wasEnabled || depthFunc != depthFunction) Gdx.gl.glDepthFunc(depthFunc = depthFunction); if (!wasEnabled || this.depthRangeNear != depthRangeNear || this.depthRangeFar != depthRangeFar) Gdx.gl.glDepthRangef(this.depthRangeNear = depthRangeNear, this.depthRangeFar = depthRangeFar); } }
Gdx.gl.glDepthFunc(GL20.GL_LESS); Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); Gdx.gl.glDepthFunc(GL20.GL_EQUAL); } else { spriteBatch.begin();
public void updateNormalDepthMap () { gl.glCullFace(GL20.GL_BACK); gl.glFrontFace(GL20.GL_CCW); gl.glEnable(GL20.GL_CULL_FACE); gl.glDisable(GL20.GL_BLEND); gl.glEnable(GL20.GL_DEPTH_TEST); gl.glDepthFunc(GL20.GL_LESS); gl.glDepthMask(true); setSsaoScale(DefaultSsaoScale); updateSsaoPlanes(); normalDepthMap.begin(); { gl.glClearDepthf(1f); gl.glClearColor(0, 0, 0, 1); gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); // renderAllMeshes(true); renderTilemapPlane(); renderCars(true); renderWalls(true); // if (staticMeshes.size() > 0) { // gl.glEnable(GL20.GL_DEPTH_TEST); // gl.glDepthFunc(GL20.GL_LESS); // // renderOrthographicAlignedModels(staticMeshes, true); // } renderTrees(true); } normalDepthMap.end(); }
gl.glDepthFunc(GL20.GL_LESS); worldRenderer.renderCars(false); gl.glDepthFunc(GL20.GL_LESS); worldRenderer.renderWalls(false);