Author Topic: Exact sample location within each rendered pixel  (Read 956 times)

2021-08-12, 14:04:35

genesys

  • Active Users
  • **
  • Posts: 16
    • View Profile
Let's say we render a 4x4 pixel image for a camera with 90° vertical and horizontal FOV and disable antialiasing using

bool shading.enableAa = false

Are the sample locations for the 16 rays generated guaranteed to be in the pixel centers and do the outer borders of the outer pixels align exactly with the camera frustum?

if the sample locations are jittered or offset instead, how can I get the exact sample location for each pixel?

2021-08-13, 09:14:10
Reply #1

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12783
  • Marcin
    • View Profile
Hi, great questions! Out of curiosity - why do you need to know this? :)

Here is a reply from our smart people department:

Quote
When AA is disabled, the primary rays are always shot through the exact pixel center in all the passes (so they should hit exactly the same point on some geometry). However any further bounces (diffuse, reflections, ...) will still be random.
Also, when doing a normal render (meaning non-DR, non-resume), the first pass is always done without AA, shooting the rays through pixel centers.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2021-08-13, 11:23:55
Reply #2

genesys

  • Active Users
  • **
  • Posts: 16
    • View Profile
perfect, thank you!

to clarify:
Quote
However any further bounces (diffuse, reflections, ...) will still be random.
what exactly does that mean for a perfectly reflective surface? will the origin of the reflection ray be exactly the intersection of the primary ray (which originates from the pixel center), or will the origin of the reflection ray be offset to some other location within the area of the rendered pixel?


Out of curiosity - why do you need to know this? :)

We're using corona to generate data for machine learning and need to reconstruct the ray that was used for each rendered pixel, so knowing the exact sample location is important to not introduce small errors.
« Last Edit: 2021-08-13, 11:31:54 by genesys »