Adding simple test for RT

This commit is contained in:
IlyaShurupov 2023-10-18 19:05:51 +03:00
parent 2e0d0e0050
commit 7af12ee1a0
8 changed files with 402 additions and 217 deletions

View file

@ -24,6 +24,7 @@ bool loadMeshes(tp::Scene& scene, const tp::String& objetsPath) {
auto object = &scene.mObjects.last();
for (auto& vertex : curMesh.Vertices) {
// printf("{ %f, %f, %f }, \n", vertex.Position.X, vertex.Position.Y, vertex.Position.Z);
object->mTopology.Points.append(Vec3F {vertex.Position.X, vertex.Position.Y, vertex.Position.Z});
object->mTopology.Normals.append(Vec3F {vertex.Normal.X, vertex.Normal.Y, vertex.Normal.Z});
}
@ -32,6 +33,7 @@ bool loadMeshes(tp::Scene& scene, const tp::String& objetsPath) {
int idx1 = (int) curMesh.Indices[j];
int idx2 = (int) curMesh.Indices[j + 1];
int idx3 = (int) curMesh.Indices[j + 2];
// printf("{ %i, %i, %i },\n", idx1, idx2, idx3);
object->mTopology.Indexes.append(Vec3I {idx1, idx2, idx3});
}

View file

@ -2,14 +2,14 @@
Meshes = "meshes.obj"
Camera = {
pos = { 4, 4, 4 },
size_x = 400,
size_y = 600,
pos = { 3, 3, 3 },
size_x = 10,
size_y = 10,
}
Lights = {
{
pos = { 4, 3, 3 },
intensity = 4
pos = { 4, 2, 3 },
intensity = 5
}
}