Search in sources :

Example 1 with WaterTile

use of com.chrisali.javaflightsim.lwjgl.water.WaterTile in project j6dof-flight-sim by chris-ali.

the class WaterRenderer method render.

public void render(List<WaterTile> water, Camera camera) {
    prepareRender(camera);
    for (WaterTile tile : water) {
        Matrix4f modelMatrix = RenderingUtilities.createTransformationMatrix(new Vector3f(tile.getX(), tile.getHeight(), tile.getZ()), 0, 0, 0, WaterTile.TILE_SIZE);
        shader.loadModelMatrix(modelMatrix);
        shader.loadFog(fogDensity, fogGradient);
        shader.loadSkyColor(MasterRenderer.getSkyColor().x, MasterRenderer.getSkyColor().y, MasterRenderer.getSkyColor().z);
        shader.connectTextures();
        GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, quad.getVertexCount());
    }
    unbind();
}
Also used : Matrix4f(org.lwjgl.util.vector.Matrix4f) Vector3f(org.lwjgl.util.vector.Vector3f) WaterTile(com.chrisali.javaflightsim.lwjgl.water.WaterTile)

Aggregations

WaterTile (com.chrisali.javaflightsim.lwjgl.water.WaterTile)1 Matrix4f (org.lwjgl.util.vector.Matrix4f)1 Vector3f (org.lwjgl.util.vector.Vector3f)1