adding materials, adding serialization for meshes and materials, random fixes

This commit is contained in:
Erris
2026-03-03 08:51:02 +01:00
parent b7e5ceb1d1
commit 4a624cfe70
16 changed files with 222 additions and 22 deletions

View File

@@ -10,6 +10,14 @@
namespace OpenEngine {
// SHOULD BE MOVED ==================================
enum class PrimitiveType
{
None = 0,
Quad,
Cube
};
struct MeshVertex
{
glm::vec3 position;
@@ -19,6 +27,15 @@ namespace OpenEngine {
uint32_t id = -1;
};
struct Material
{
glm::vec4 albedo = { 1.0f, 1.0f, 1.0f, 1.0f };
float roughness = 1.0f;
float metallic = 1.0f;
float ambient_strength = 1.0f;
float specular_strength = 1.0f;
};
struct Mesh
{
Ref<VertexArray> vertex_array;
@@ -46,7 +63,8 @@ namespace OpenEngine {
static void BeginScene(const EditorCamera& camera);
static void EndScene();
static void DrawMesh(const Ref<Mesh>& mesh, const glm::mat4& transform);
static void DrawMesh(const Ref<Mesh>& mesh, Material& material,
const glm::mat4& transform);
};
}