Add Scene and Method switcher to Assignment2.

This commit is contained in:
hal8174 2024-05-15 15:29:43 +02:00
parent 1948277dbd
commit b00c67bf3d
2 changed files with 35 additions and 2 deletions

View file

@ -110,8 +110,21 @@ Vec3fa ACESFilm(Vec3fa x, float exposure) {
return (x * (a * x + b)) / (x * (c * x + d) + e);
}
/* task that renders a single screen tile */
// Function that selects implementation at runtime
Vec3fa Application2::renderPixel(float x, float y, const ISPCCamera& camera, RayStats& stats, RandomSampler& sampler) {
if (selected == 0) {
return renderPixelOrig(x, y, camera, stats, sampler);
} else {
return Vec3fa(0.0f);
}
}
Vec3fa Application2::renderPixelHomogeneous(float x, float y, const ISPCCamera& camera, RayStats& stats, RandomSampler& sampler) {
return Vec3fa(0.0f);
}
/* task that renders a single screen tile */
Vec3fa Application2::renderPixelOrig(float x, float y, const ISPCCamera& camera, RayStats& stats, RandomSampler& sampler) {
/* radiance accumulator and weight */
Vec3fa L = Vec3fa(0.0f);
Vec3fa Lw = Vec3fa(1.0f);