public override void Load() { m_ImGuiDriver = new ImGuiDriver(); m_ImGuiDriver.Initalise(GraphicsDevice, m_ResourceManager); camera = new GameCamera(new Vector3(40, 40, 40), new Vector3(80, 80, 0), 55, -20); m_QuadBatch = new QuadBatch(); var cubeShader = m_ResourceManager.LoadShaderFromFile("v.cube.glsl", "f.cube.glsl"); var skyboxShader = m_ResourceManager.LoadShaderFromFile("v.skybox.glsl", "f.skybox.glsl"); var terrainShader = m_ResourceManager.LoadShaderFromFile("v.terrain.glsl", "f.terrain.glsl"); var waterShader = m_ResourceManager.LoadShaderFromFile("v.water.glsl", "f.water.glsl"); // Load Textures { m_AwesomeFace = m_ResourceManager.LoadTexture2d("awesomeface.png"); m_Texture = m_ResourceManager.LoadTexture2d("texture1.png"); //m_Default = m_ResourceManager.LoadTexture2d("default.png"); } // Load Terrain { var heightMapData = HeightMapData.LoadHeightmapData("Resources/Textures/Heightmaps/1.png"); var model = ModelLoader.CreateTerrain(heightMapData); var terrainVAO = m_ResourceManager.LoadVAO(model.Verts, model.Indicies, VertexPositionColorTextureNormal.Stride, VertexPositionColorTextureNormal.AttributeLengths, VertexPositionColorTextureNormal.AttributeOffsets); m_TerrainRenderObject = new Terrain(terrainShader.ShaderProgramId, terrainVAO.VaoId, terrainVAO.VertexCount); } // Create Water { var model = ModelLoader.CreatePlane(1024, 1024, 12.2f); var waterVAO = m_ResourceManager.LoadVAO(model.Verts, model.Indicies, VertexPositionColorTextureNormal.Stride, VertexPositionColorTextureNormal.AttributeLengths, VertexPositionColorTextureNormal.AttributeOffsets); m_WaterRenderObject = new Water(waterShader.ShaderProgramId, waterVAO.VaoId, waterVAO.VertexCount); } // Create Bunny { var bunnyVerts = ModelLoader.LoadObj("Resources/Models/bunny.obj"); var bunnyVAO = m_ResourceManager.LoadVAO(bunnyVerts.Verts, bunnyVerts.Indicies, VertexPositionColorTextureNormal.Stride, VertexPositionColorTextureNormal.AttributeLengths, VertexPositionColorTextureNormal.AttributeOffsets); m_BunnyRenderObject = new Bunny(terrainShader.ShaderProgramId, bunnyVAO.VaoId, bunnyVAO.VertexCount); } // Create Cube { Maploader mp = new Maploader(); mp.Load(); var verts = Geometry.CreateCube(); var m_CubeVAO = m_ResourceManager.LoadNonIndexedVAO(verts, VertexPositionColorTexture.Stride, VertexPositionColorTexture.AttributeLengths, VertexPositionColorTexture.AttributeOffsets); m_Cube = new Cube[Maploader.width * Maploader.height]; for (int i = 0; i < Maploader.width * Maploader.height; i++) { m_Cube[i] = new Cube(cubeShader.ShaderProgramId, m_CubeVAO.VaoId, m_CubeVAO.VertexCount); m_Cube[i].i = i; m_Cube[i].TextureIdA = m_AwesomeFace.TextureId; m_Cube[i].TextureIdB = m_Texture.TextureId; } int k = 0; for (int i = 0; i < Maploader.width; i++) { for (int j = 0; j < Maploader.height; j++) { var height = (float)mp.cubes[i, j]; height /= 2.0f; if (height < 0) { height = -100; // Temp } height += 20; m_Cube[k].Position = new Vector3(i, height, j); k++; } } } // Create Skyubox { var verts = Geometry.CreateSkyBoxVerticies(); var skyboxVAO = m_ResourceManager.LoadNonIndexedVAO(verts, VertexPosition.Stride, VertexPosition.AttributeLengths, VertexPosition.AttributeOffsets); var cubeMap = m_ResourceManager.LoadCubeMap("Skybox/front.png", "Skybox/back.png", "Skybox/bottom.png", "Skybox/top.png", "Skybox/left.png", "Skybox/right.png"); m_SkyBoxRenderObject = new SkyBox(skyboxShader.ShaderProgramId, skyboxVAO.VaoId, skyboxVAO.VertexCount, cubeMap.TextureId); } // Load Font { m_FontAriel = m_ResourceManager.LoadTextureFont("ariel.fnt"); } renderTarget = RenderTarget.Create(GameWindow.ScreenWidth, GameWindow.ScreenHeight); // TODO This should be the size of the screen quad = new ScreenSpaceQuad(); quad.Create(); }