@Override public void end () { program.end(); }
@Override public void afterGroups () { shader.end(); Gdx.gl.glDisable(GL20.GL_DEPTH_TEST); }
@Override public void end () { if (currentMesh != null) { currentMesh.unbind(program, tempArray.items); currentMesh = null; } program.end(); }
@Override public void afterGroups () { shader.end(); Gdx.gl.glDisable(GL20.GL_DEPTH_TEST); }
@Override public void end () { if (currentMesh != null) { currentMesh.unbind(program, tempArray.items); currentMesh = null; } program.end(); }
@Override public void end () { if (!drawing) throw new IllegalStateException("PolygonSpriteBatch.begin must be called before end."); if (vertexIndex > 0) flush(); lastTexture = null; drawing = false; GL20 gl = Gdx.gl; gl.glDepthMask(true); if (isBlendingEnabled()) gl.glDisable(GL20.GL_BLEND); if (customShader != null) customShader.end(); else shader.end(); }
@Override public void end () { if (!drawing) throw new IllegalStateException("SpriteBatch.begin must be called before end."); if (idx > 0) flush(); lastTexture = null; drawing = false; GL20 gl = Gdx.gl; gl.glDepthMask(true); if (isBlendingEnabled()) gl.glDisable(GL20.GL_BLEND); if (customShader != null) customShader.end(); else shader.end(); }
@Override public void end () { if (!drawing) throw new IllegalStateException("PolygonSpriteBatch.begin must be called before end."); if (vertexIndex > 0) flush(); lastTexture = null; drawing = false; GL20 gl = Gdx.gl; gl.glDepthMask(true); if (isBlendingEnabled()) gl.glDisable(GL20.GL_BLEND); if (customShader != null) customShader.end(); else shader.end(); }
@Override public void end () { if (!drawing) throw new IllegalStateException("SpriteBatch.begin must be called before end."); if (idx > 0) flush(); lastTexture = null; drawing = false; GL20 gl = Gdx.gl; gl.glDepthMask(true); if (isBlendingEnabled()) gl.glDisable(GL20.GL_BLEND); if (customShader != null) customShader.end(); else shader.end(); }
/** Completes rendering for this SpriteCache. */ public void end () { if (!drawing) throw new IllegalStateException("begin must be called before end."); drawing = false; shader.end(); GL20 gl = Gdx.gl20; gl.glDepthMask(true); if (customShader != null) mesh.unbind(customShader); else mesh.unbind(shader); }
/** Completes rendering for this SpriteCache. */ public void end () { if (!drawing) throw new IllegalStateException("begin must be called before end."); drawing = false; shader.end(); GL20 gl = Gdx.gl20; gl.glDepthMask(true); if (customShader != null) mesh.unbind(customShader); else mesh.unbind(shader); }
public void flush () { if (numVertices == 0) return; shader.begin(); shader.setUniformMatrix("u_projModelView", projModelView); for (int i = 0; i < numTexCoords; i++) shader.setUniformi(shaderUniformNames[i], i); mesh.setVertices(vertices, 0, vertexIdx); mesh.render(shader, primitiveType); shader.end(); numSetTexCoords = 0; vertexIdx = 0; numVertices = 0; }
public void flush () { if (numVertices == 0) return; shader.begin(); shader.setUniformMatrix("u_projModelView", projModelView); for (int i = 0; i < numTexCoords; i++) shader.setUniformi(shaderUniformNames[i], i); mesh.setVertices(vertices, 0, vertexIdx); mesh.render(shader, primitiveType); shader.end(); numSetTexCoords = 0; vertexIdx = 0; numVertices = 0; }
@Override public void render () { Gdx.gl20.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT); shader.begin(); mesh.render(shader, GL20.GL_TRIANGLES); shader.end(); } }
public void render () { Gdx.gl20.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT); Gdx.gl20.glActiveTexture(GL20.GL_TEXTURE0); texture.bind(); Gdx.gl20.glActiveTexture(GL20.GL_TEXTURE1); texture2.bind(); shader.begin(); shader.setUniformi("s_texture", 0); shader.setUniformi("s_texture2", 1); mesh.render(shader, GL20.GL_TRIANGLES); shader.end(); }
@Override public void render () { // System.out.println( "render"); Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); Gdx.gl.glEnable(GL20.GL_TEXTURE_2D); shader.begin(); shader.setUniformi("u_texture", 0); texture.bind(); vbo.bind(shader); ibo.bind(); Gdx.gl20.glDrawElements(GL20.GL_TRIANGLES, 3, GL20.GL_UNSIGNED_SHORT, 0); ibo.unbind(); vbo.unbind(shader); shader.end(); }
public void render () { Gdx.gl20.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT); Gdx.gl20.glActiveTexture(GL20.GL_TEXTURE0); texture.bind(); shader.begin(); shader.setUniformf("s_texture", 0); Gdx.gl20.glTexParameteri(GL20.GL_TEXTURE_2D, GL20.GL_TEXTURE_MIN_FILTER, GL20.GL_NEAREST); shader.setUniformf("u_offset", -0.6f); mesh.render(shader, GL20.GL_TRIANGLES); Gdx.gl20.glTexParameteri(GL20.GL_TEXTURE_2D, GL20.GL_TEXTURE_MIN_FILTER, GL20.GL_LINEAR_MIPMAP_LINEAR); shader.setUniformf("u_offset", 0.6f); mesh.render(shader, GL20.GL_TRIANGLES); shader.end(); } }
@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 render () { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); Gdx.gl.glEnable(GL20.GL_TEXTURE_2D); camera.update(); currTexture = hwMipMap.isChecked() ? textureHW : textureSW; currTexture.bind(); currTexture.setFilter(TextureFilter.valueOf(minFilter.getSelected()), TextureFilter.valueOf(magFilter.getSelected())); shader.begin(); shader.setUniformMatrix("u_projTrans", camera.combined); shader.setUniformi("s_texture", 0); mesh.render(shader, GL20.GL_TRIANGLE_FAN); shader.end(); ui.act(); ui.draw(); }
@Override public void render () { GL20 gl = Gdx.gl20; gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClearColor(0.7f, 0, 0, 1); gl.glClear(GL20.GL_COLOR_BUFFER_BIT); gl.glEnable(GL20.GL_TEXTURE_2D); shader.begin(); shader.setUniformi("u_texture", 0); texture.bind(); vbo.bind(shader); indices.bind(); gl.glDrawElements(GL20.GL_TRIANGLES, 3, GL20.GL_UNSIGNED_SHORT, indices.getBuffer().position()); indices.unbind(); vbo.unbind(shader); shader.end(); }