[RayTracing] Matter of memory

Do any of You guys would have any tips or recomendations for efficient storing of ray data (intersection points, directions, normals, colors etc.)? What I mean is, do You know any form of decreasing amount of memory required for such data? In my project (CIRT) I simply store all useful information in an array of float4’s. In such a form each ray has ‘a weight’ of at least 16 bytes. I believe it can be reduced.


You can try to use Look-up tables. For example, normal vectors can be generated from a sphere surface and stored in some array (look-up table). Then, to store a normal vector in critical place you can use only one 4 byte index to look-up table element.

This may impact the performance in some cases, but in other cases this might give a little performance improvment.