Closed BudgiePanic closed 7 months ago
working on this looks like it needs the following:
exposure camera needs to convey more information to motion shapes so they can bake their AABBs
time = 0s always
when the camera exposure startsfollowing the book's advice on this feature, we need to extend the Ray
record to include some more information:
0s
but the shutter camera will supply the time valuetests to create
created tests for motion shape cube and plane, now working on creating the shutter camera
I believe world will now need method overloads where the time the color is computed / time the occlusion is checked for, must be passed in as a parameter
To make this work, I think I need to change the perspective camera API, they need to expose the code they use to generate the color for one pixel, so the shutter camera can call it multiple times with different time stamps
These camera's have a code smell in my opinion, methods across various subclasses sharing the exact same structure
The only camera that can't have its takePicture
logic extracted to a consumer lambda is depthCamera, but that's because the depth camera is doing a post processing step as part of its takePicture
method, which could easily be removed to another method
you could almost make a single camera class with behaviour delegates for ray generation, pixel imaging, and whole imaging
tomorrow we need to modify world functionality to use the new time field in rays
something is up with ray-shape intersection testing when they are nested in a linear motion shape
motion blur is not appearing in reflective surfaces either
motion blur is not appearing in reflective surfaces either
fixed now, just had to pass in the time, which is now stored in shading info object
something is up with ray-shape intersection testing when they are nested in a linear motion shape
I think it is because we are currently transforming the ray by negative velocity in local object space instead of in world space
edit: was actually because not calculating AABB correctly for motion shapes
alright now that that is working, last thing we need to do is make the shutter camera bake the scene with exposure end time
future issue to deal with hmm, baking the motion shapes with the camera's exposure end time to optimize their AABBs is going to create an implicit coupling between the camera and the world being imaged, for example, you wouldn't be able to have two shutter cameras imaging the same world at different times
we could modify motion shapes so they have to be provided a motion end time at construction time?
we could use a design pattern to have all motion shapes in a world listen for time end events, and update AABBs when a shutter camera announces their exposure duration or something
going to change the motion shape so if the end time is unknown, then we don't use the AABB's bounding box
this will allow correct behaviour of the program for rays cast at time != 0
for motion shapes even when their end time is not set
going to make shutter camera baking the exposure duration a higher level function so the user is causing that behaviour, rather than the camera automatically baking the times when Camera::imageWorld
is called
looks like everything is working
section in chapter 17 of the book