Questions about projectors (spotlight with image)

General project and community related discussions and offtopic threads.
User avatar
Dade
Developer
Posts: 5594
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Questions about projectors (spotlight with image)

Post by Dade » 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 :?:
Support LuxCoreRender project with salts and bounties

naruto123sdo
Posts: 19
Joined: Mon Jun 14, 2021 9:47 pm

Re: Questions about projectors (spotlight with image)

Post by naruto123sdo » Mon Aug 02, 2021 3:02 am

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.

User avatar
Dade
Developer
Posts: 5594
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Questions about projectors (spotlight with image)

Post by Dade » Mon Aug 02, 2021 9:19 am

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
Support LuxCoreRender project with salts and bounties

Post Reply