public SkyboxRenderer(SkyboxShader _shader, Matrix4 projectionMatrix) { start = Settings.GetSetting(Settings.ConfigSettings.SKYBOX_FILE_PREFIX); cube = Loader.LoadToVAO(VERTICES, 3); skyboxTextureID = Loader.LoadCubeMap(TEXTURES_FILES, start); shader = _shader; shader.Start(); shader.LoadProjectionMatrix(projectionMatrix); shader.Stop(); }
public void Render(Camera camera) { MasterRenderer.DisableCulling(); shader.Start(); shader.LoadViewMatrix(camera.GetViewMatrix()); shader.LoadTransformationMatrix(camera.gameObject.transform.TransformationMatrixTranslation()); GL.BindVertexArray(cube.vaoID); GL.EnableVertexAttribArray(0); GL.ActiveTexture(TextureUnit.Texture0); GL.BindTexture(TextureTarget.TextureCubeMap, skyboxTextureID); GL.DrawArrays(PrimitiveType.Triangles, 0, cube.vertexCount); GL.DisableVertexAttribArray(0); GL.BindVertexArray(0); shader.Stop(); MasterRenderer.EnableCulling(); }