Page 2 of 2

Re: Questions about projectors (spotlight with image)

Posted: Sun Aug 01, 2021 8:49 pm
by Dade
naruto123sdo wrote: Sun Aug 01, 2021 5:11 pm
Dade wrote: Sun Aug 01, 2021 9:13 am It is the light received by the surface, what the camera sees depends by other factors like the material and orientation of the seen surface.

You need to multiply "c" for the dot product of the surface normal and shadow ray direction: this is the received light. Than you need to evaluate the material for the shadow ray direction and multiply for the incoming light computed before. This is what camera see.
I guess this will be the final step. Could you show me the code which explains how the camera takes material into consideration and combines "c" to determine the final pixel in the rendering result?
Mmm, that is actually pretty much all the code involved in the rendering. I can point you to the main spots but it is a lot of code to look into :?:

Re: Questions about projectors (spotlight with image)

Posted: Mon Aug 02, 2021 3:02 am
by naruto123sdo
Dade wrote: Sun Aug 01, 2021 8:49 pm
naruto123sdo wrote: Sun Aug 01, 2021 5:11 pm
Dade wrote: Sun Aug 01, 2021 9:13 am It is the light received by the surface, what the camera sees depends by other factors like the material and orientation of the seen surface.

You need to multiply "c" for the dot product of the surface normal and shadow ray direction: this is the received light. Than you need to evaluate the material for the shadow ray direction and multiply for the incoming light computed before. This is what camera see.
I guess this will be the final step. Could you show me the code which explains how the camera takes material into consideration and combines "c" to determine the final pixel in the rendering result?
Mmm, that is actually pretty much all the code involved in the rendering. I can point you to the main spots but it is a lot of code to look into :?:
Oh, please go ahead to point out the main spots, and I will take time to read the code, thanks.

Re: Questions about projectors (spotlight with image)

Posted: Mon Aug 02, 2021 9:19 am
by Dade
This is the PathTracer class and the RenderSample method is the one to compute a sample (follow the RenderEyeSample() path): https://github.com/LuxCoreRender/LuxCor ... r.cpp#L931

The sample is than splat on the Film (i.e. the image).

This is the implementation of the perspective camera: https://github.com/LuxCoreRender/LuxCor ... ective.cpp