some stuff to render flow, i really need to disambiguise the camera viewport to the size of render textures

This commit is contained in:
benkyd
2022-11-23 14:59:48 +00:00
parent 52fd4e874c
commit f35a6013da
5 changed files with 24 additions and 17 deletions

View File

@@ -1,10 +1,15 @@
#include "ray_source.hpp"
#include <scene/camera.hpp>
#include <tracing/ray.hpp>
using namespace inferno;
RaySource::RaySource()
RaySource::RaySource(Camera* camera)
: mReferenceCamera(camera)
{
this->generate();
}
RaySource::~RaySource()
@@ -12,12 +17,6 @@ RaySource::~RaySource()
}
void RaySource::cameraUpdate(Camera* camera)
{
mReferenceCamera = camera;
}
void RaySource::generate()
{
@@ -25,5 +24,13 @@ void RaySource::generate()
RayField RaySource::getInitialRays(bool MSAA)
{
if (mReferenceCamera->didUpdate())
{
this->generate();
}
for (int x = 0; x < mReferenceCamera->getRayViewport().x; x++)
for (int y = 0; y < mReferenceCamera->getRayViewport().y; y++)
return RayField{};
}