Пример #1
0
 public void Render(List <JWaterTile> waterTiles, JCamera camera, JLight light)
 {
     PrepareRender(camera, light);
     foreach (JWaterTile tile in waterTiles)
     {
         Matrix4 modelMatrix = JMathUtils.createTransformationMatrix(new Vector3(tile.X, tile.Height, tile.Z), 0, 0, 0, JWaterTile.TILE_SIZE);
         WaterShader.LoadModelMatrix(modelMatrix);
         GL.DrawArrays(PrimitiveType.Triangles, 0, WaterQuad.vertexCount);
     }
     Unbind();
 }
        private void LoadModelMatrix(JPerlinTerrain terrain)
        {
            Matrix4 transformationMatrix = JMathUtils.createTransformationMatrix(new Vector3(terrain.X, 0, terrain.Z), 0, 0, 0, 1);

            TerrainShader.LoadTransformationMatrix(transformationMatrix);
        }