This was the part I was worrying about for a while. When I initially had photon casting and rendered them on the shader, the performance was terrible (10-15 fps). I only had about 50-100 photons, which is nowhere near enough for a good render, and I didn't even have incident angle data - I was only passing down positions and color (power). This worried me. This week, with a completed photon scattering step, I started passing down the complete photon data (position, color, and incident angles) in much larger numbers, but I did not render them out. When I first ran it, I was expecting my laptop to burst into flames. However, it was completely okay. So I proofed that the shader can handle large amounts of floating point data without failing. This is a huge relief, and I am now ready to move onto radiance gathering on the shader! This is exciting!
The numbers I was working with was:
- 500 photons initially cast from light source
- ~1030 photons total after photon scattering
- 3 attributes per photon: position, color (power), incident angle
- 3 floats per attribute (each type of vec3)
- ~1030 x 3 x 3 = ~9270 floats passed to shader