private void prepareTerrain(Terrain terrain) { RawModel model = terrain.getModel(); GL30.glBindVertexArray(model.getVaoID()); GL20.glEnableVertexAttribArray(0); GL20.glEnableVertexAttribArray(1); GL20.glEnableVertexAttribArray(2); bindTextures(terrain); shader.loadShineVariables(1, 0); }
public void render(List<Terrain> terrains, Matrix4f toShadowSpace) { shader.loadToShadowSpaceMatrix(toShadowSpace); for (Terrain t : terrains) { prepareTerrain(t); loadModelMatrix(t); GL11.glDrawElements( GL11.GL_TRIANGLES, t.getModel().getVertexCount(), GL11.GL_UNSIGNED_INT, 0); unbindShtuffs(); } }
private void loadModelMatrix(Terrain terrain) { Matrix4f transfomation = Maths.createTransformationMatrix( new Vector3f(terrain.getX(), 0, terrain.getZ()), 0, 0, 0, 1); shader.loadTransformationMatrix(transfomation); }