public void render() { // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0); // Restore state glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); glBindVertexArray(0); }
public void render() { // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0); // Restore state glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); glBindVertexArray(0); }
private void initRender() { Texture texture = material.getTexture(); if (texture != null) { // Activate firs texture bank glActiveTexture(GL_TEXTURE0); // Bind the texture glBindTexture(GL_TEXTURE_2D, texture.getId()); } // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); }
private void initRender() { Texture texture = material.getTexture(); if (texture != null) { // Activate firs texture bank glActiveTexture(GL_TEXTURE0); // Bind the texture glBindTexture(GL_TEXTURE_2D, texture.getId()); } // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); }
private void initRender() { Texture texture = material.getTexture(); if (texture != null) { // Activate firs texture bank glActiveTexture(GL_TEXTURE0); // Bind the texture glBindTexture(GL_TEXTURE_2D, texture.getId()); } // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); }
private void initRender() { Texture texture = material.getTexture(); if (texture != null) { // Activate firs texture bank glActiveTexture(GL_TEXTURE0); // Bind the texture glBindTexture(GL_TEXTURE_2D, texture.getId()); } // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); }
public void render() { // Activate firs texture bank glActiveTexture(GL_TEXTURE0); // Bind the texture glBindTexture(GL_TEXTURE_2D, texture.getId()); // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0); // Restore state glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); glBindVertexArray(0); }
public void render() { // Activate firs texture bank glActiveTexture(GL_TEXTURE0); // Bind the texture glBindTexture(GL_TEXTURE_2D, texture.getId()); // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0); // Restore state glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); glBindVertexArray(0); }
private void initRender() { Texture texture = material.getTexture(); if (texture != null) { // Activate first texture bank glActiveTexture(GL_TEXTURE0); // Bind the texture glBindTexture(GL_TEXTURE_2D, texture.getId()); } Texture normalMap = material.getNormalMap(); if ( normalMap != null ) { // Activate first texture bank glActiveTexture(GL_TEXTURE1); // Bind the texture glBindTexture(GL_TEXTURE_2D, normalMap.getId()); } // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); }
private void initRender() { Texture texture = material.getTexture(); if (texture != null) { // Activate first texture bank glActiveTexture(GL_TEXTURE0); // Bind the texture glBindTexture(GL_TEXTURE_2D, texture.getId()); } Texture normalMap = material.getNormalMap(); if ( normalMap != null ) { // Activate first texture bank glActiveTexture(GL_TEXTURE1); // Bind the texture glBindTexture(GL_TEXTURE_2D, normalMap.getId()); } // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); }
public void render(Window window, Mesh mesh) { clear(); if (window.isResized()) { glViewport(0, 0, window.getWidth(), window.getHeight()); window.setResized(false); } shaderProgram.bind(); // Draw the mesh glBindVertexArray(mesh.getVaoId()); glEnableVertexAttribArray(0); glDrawElements(GL_TRIANGLES, mesh.getVertexCount(), GL_UNSIGNED_INT, 0); // Restore state glDisableVertexAttribArray(0); glBindVertexArray(0); shaderProgram.unbind(); }
public void render() { if (texture != null) { // Activate firs texture bank glActiveTexture(GL_TEXTURE0); // Bind the texture glBindTexture(GL_TEXTURE_2D, texture.getId()); } // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0); // Restore state glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); glDisableVertexAttribArray(2); glBindVertexArray(0); glBindTexture(GL_TEXTURE_2D, 0); }
public void render() { Texture texture = material.getTexture(); if (texture != null) { // Activate firs texture bank glActiveTexture(GL_TEXTURE0); // Bind the texture glBindTexture(GL_TEXTURE_2D, texture.getId()); } // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0); // Restore state glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); glDisableVertexAttribArray(2); glBindVertexArray(0); glBindTexture(GL_TEXTURE_2D, 0); }
public void render() { Texture texture = material.getTexture(); if (texture != null) { // Activate firs texture bank glActiveTexture(GL_TEXTURE0); // Bind the texture glBindTexture(GL_TEXTURE_2D, texture.getId()); } // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0); // Restore state glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); glDisableVertexAttribArray(2); glBindVertexArray(0); glBindTexture(GL_TEXTURE_2D, 0); }
public void render() { Texture texture = material.getTexture(); if (texture != null) { // Activate firs texture bank glActiveTexture(GL_TEXTURE0); // Bind the texture glBindTexture(GL_TEXTURE_2D, texture.getId()); } // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0); // Restore state glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); glDisableVertexAttribArray(2); glBindVertexArray(0); glBindTexture(GL_TEXTURE_2D, 0); }
public void render() { Texture texture = material.getTexture(); if (texture != null) { // Activate firs texture bank glActiveTexture(GL_TEXTURE0); // Bind the texture glBindTexture(GL_TEXTURE_2D, texture.getId()); } // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0); // Restore state glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); glDisableVertexAttribArray(2); glBindVertexArray(0); glBindTexture(GL_TEXTURE_2D, 0); }
public void render() { Texture texture = material.getTexture(); if (texture != null) { // Activate firs texture bank glActiveTexture(GL_TEXTURE0); // Bind the texture glBindTexture(GL_TEXTURE_2D, texture.getId()); } // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0); // Restore state glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); glDisableVertexAttribArray(2); glBindVertexArray(0); glBindTexture(GL_TEXTURE_2D, 0); }
public void render(Window window, Mesh mesh) { clear(); if ( window.isResized() ) { glViewport(0, 0, window.getWidth(), window.getHeight()); window.setResized(false); } shaderProgram.bind(); // Draw the mesh glBindVertexArray(mesh.getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glDrawElements(GL_TRIANGLES, mesh.getVertexCount(), GL_UNSIGNED_INT, 0); // Restore state glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); glBindVertexArray(0); shaderProgram.unbind(); }
public void render() { Texture texture = material.getTexture(); if (texture != null) { // Activate firs texture bank glActiveTexture(GL_TEXTURE0); // Bind the texture glBindTexture(GL_TEXTURE_2D, texture.getId()); } // Draw the mesh glBindVertexArray(getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0); // Restore state glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); glDisableVertexAttribArray(2); glBindVertexArray(0); glBindTexture(GL_TEXTURE_2D, 0); }
public void render(Window window, Mesh mesh) { clear(); if ( window.isResized() ) { glViewport(0, 0, window.getWidth(), window.getHeight()); window.setResized(false); } shaderProgram.bind(); shaderProgram.setUniform("projectionMatrix", projectionMatrix); // Draw the mesh glBindVertexArray(mesh.getVaoId()); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glDrawElements(GL_TRIANGLES, mesh.getVertexCount(), GL_UNSIGNED_INT, 0); // Restore state glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); glBindVertexArray(0); shaderProgram.unbind(); }