0

Typically, when i compute lights in my ray-tracing, I find the first object intersected by my ray, then I calculate the amount of the light that point. I was thinking if there was an efficient way to simulate the light that comes directly to the camera:

For example a spotlight in an empty space or the or the headlights of a car in front of the scene: enter image description here enter image description here

Perhaps it can be simulated seeing if the light rays intersect the view plane? I don't have many ideas and I don't find online resources that talk about this topic, can someone kindly help me?

Vertexwahn
  • 7,709
  • 6
  • 64
  • 90
peppone
  • 85
  • 6
  • I don't quite understand what you want to ask. If you are asking about how is light coming directly to the camera is calculated well, you just shoot rays and if it intersects the light, you just set the appropriate intensity after accounting for the inver square fall off or other factors. If you are talking about the halos and god rays kind of stuff there are specific shaders and algos for that. – gallickgunner Nov 18 '19 at 08:51
  • Well, you probably can, but you would need to use a really advanced techniques, a complex lens, spectral rendering, some kind of layered material on the lens, e.t.c. – Denis Nov 18 '19 at 12:55
  • @gallickgunner, I want calculate light coming to the camera. The problem is that the camera is a point and also the light (point lights for the moment). You say to shot rays and see they intersect the light but it means to find the intersection between several rays and a single point in space. It would make more sense to check for example if the light reaches the view plane of the camera. Ex: If a camera ray has pos 0,0,0 and dir [-0.19][0.19][0.96]. Take D and test if is reached by a light as if it were an object. But I'm not sure that it's the right approach... – peppone Nov 20 '19 at 18:14
  • 1
    @peppone - Assuming it's a point light, you could try to just shoot a ray from the light towards camera's origin, get an intersection with the view plane, then figure out the pixel that the ray went through and set the corresponding intensity but why do that? You are gonna think it saves us from intersecting each ray with each light but then you'll have to keep track of the pixels that are directly lit by the light. The ones that are, you don't usually bounce around any more for those. The proposed solution would also make area lights working complex considering you sample multiple times. – gallickgunner Nov 21 '19 at 08:59

0 Answers0