RT Multisampling

This commit is contained in:
IlyaShurupov 2023-10-19 19:11:29 +03:00 committed by Ilya Shurupov
parent 97a99f84f5
commit e9daedd6ea
7 changed files with 120 additions and 37 deletions

View file

@ -78,6 +78,17 @@ int readRenderSettings(lua_State* L, tp::RayTracer::RenderSettings& settings) {
}
lua_pop(L, 1); // Pop the 'spray' field
// Read depth field
lua_getfield(L, -1, "multisampling");
if (lua_isnumber(L, -1)) {
settings.multisampling = (int) lua_tonumber(L, -1);
} else {
printf("RenderSettings 'depth' field is missing or not a number.\n");
lua_pop(L, 1); // Pop the 'depth' field
return 0; // Error
}
lua_pop(L, 1); // Pop the 'depth' field
return 1; // Success
}

View file

@ -9,7 +9,17 @@ Camera = {
Lights = {
{
pos = { 4, 2, 3 },
intensity = 5
}
pos = { -0.5, 3.5, 1 },
intensity = 1
},
{
pos = { 0, 0, 1 },
intensity = 0.5
},
}
RenderSettings = {
depth = 1,
spray = 10,
multisampling = 1,
}

View file

@ -6,3 +6,21 @@ Camera = {
size_x = 400,
size_y = 600,
}
Lights = {
{
pos = { -0.5, 3.5, 1 },
intensity = 1
},
{
pos = { 0, 0, 1 },
intensity = 0.5
},
}
RenderSettings = {
depth = 1,
spray = 10,
multisampling = 1,
}

View file

@ -20,5 +20,6 @@ Lights = {
RenderSettings = {
depth = 1,
spray = 10,
spray = 3,
multisampling = 16,
}