adding material class

This commit is contained in:
Dynamitos
2025-01-25 23:19:43 +01:00
parent 7beaabd34c
commit 8fdaff1e4c
5 changed files with 15 additions and 1 deletions
+4
View File
@@ -6,6 +6,10 @@
Renderer::Renderer()
{
bvh.addPointLight(PointLight{
.position = glm::vec3(2, 0, 2),
.color = glm::vec3(0, 1, 0),
});
bvh.addModels(ModelLoader::loadModel("../res/models/cube.fbx"),
glm::mat4(glm::vec4(1.0f, 0.0f, 0.0f, 0.0f), glm::vec4(0.0f, 1.0f, 0.0f, 0.0f), glm::vec4(0.0f, 0.0f, 1.0f, 0.0f),
glm::vec4(0.0f, 0.0f, 0.0f, 1.0f)));
+1 -1
View File
@@ -161,7 +161,7 @@ std::optional<IntersectionInfo> Scene::intersectModel(const ModelReference& refe
intersection = IntersectionInfo{.position = ray.origin + ray.direction * resultVector.x,
.normal = n,
.albedo = glm::vec3(0.7f, 0.7f, 0.7f),
.emissive = glm::vec3(0.0f, 0.0f, 0.0f)};
.emissive = glm::vec3(0.0f, 0.0f, 0.0f),};
distance = resultVector.x;
}
}
+2
View File
@@ -1,6 +1,8 @@
target_sources(RayTracer
PRIVATE
Camera.h
Material.h
Material.cpp
Model.h
Model.cpp
ModelLoader.h
+1
View File
@@ -0,0 +1 @@
#include "Material.h"
+7
View File
@@ -0,0 +1,7 @@
#pragma once
class Material
{
public:
private:
};