mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
add graphics/core/Model
This commit is contained in:
parent
916d1c1408
commit
6ba38ee167
5 changed files with 112 additions and 5 deletions
|
|
@ -32,6 +32,7 @@
|
|||
#include "../core/PostProcessing.hpp"
|
||||
#include "../core/Shader.hpp"
|
||||
#include "../core/Texture.hpp"
|
||||
#include "../core/Model.hpp"
|
||||
|
||||
#include <assert.h>
|
||||
#include <GL/glew.h>
|
||||
|
|
@ -49,7 +50,7 @@ WorldRenderer::WorldRenderer(Engine* engine, LevelFrontend* frontend, Player* pl
|
|||
player(player),
|
||||
frustumCulling(std::make_unique<Frustum>()),
|
||||
lineBatch(std::make_unique<LineBatch>()),
|
||||
modelBatch(std::make_unique<ModelBatch>(1000, level->chunks.get()))
|
||||
modelBatch(std::make_unique<ModelBatch>(1000, engine->getAssets(), level->chunks.get()))
|
||||
{
|
||||
renderer = std::make_unique<ChunksRenderer>(
|
||||
level,
|
||||
|
|
@ -193,10 +194,16 @@ void WorldRenderer::renderLevel(
|
|||
|
||||
drawChunks(level->chunks.get(), camera, shader);
|
||||
|
||||
model::Model model {};
|
||||
auto& mesh = model.addMesh("gui/warning");
|
||||
mesh.addBox({}, glm::vec3(1));
|
||||
|
||||
assets->getTexture("gui/menubg")->bind();
|
||||
shader->uniformMatrix("u_model", glm::mat4(1.0f));
|
||||
modelBatch->test(glm::vec3(0, 88, 0), glm::vec3(1.0f));
|
||||
modelBatch->flush();
|
||||
//modelBatch->test(glm::vec3(0, 88, 0), glm::vec3(1.0f));
|
||||
modelBatch->pushMatrix(glm::translate(glm::mat4(1.0f), glm::vec3(0, 88, 0)));
|
||||
modelBatch->draw(model);
|
||||
modelBatch->popMatrix();
|
||||
|
||||
skybox->unbind();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue