Questions about projectors (spotlight with image)

General project and community related discussions and offtopic threads.
naruto123sdo
Posts: 19
Joined: Mon Jun 14, 2021 9:47 pm

Questions about projectors (spotlight with image)

Post by naruto123sdo » Thu Jul 29, 2021 11:57 pm

I'm trying to simulating a projector (using spotlight with images), and it only illuminates a simple flat plane with diffused surface. Also, the images are simply 8-bit grayscale images.

I wonder if it is possible to predict the camera image, given the diffuse color of the surface, distance between the surface and projector, projected image, and spotlight exposure? Is there a function governing that?

I notice that I can change the exposure of the spotlight, but I'm not sure how specifically it affects the intensities of the projected image (e.g., after increasing the exposure by 0.1, how will it change the intensities of the projected image?).

Another thing I noticed is that the spotlight has attenuation, and I wonder what is the relationship between the exposure and the distances in Luxcore?

Thank you in advance.

kintuX
Posts: 720
Joined: Wed Jan 10, 2018 2:37 am

Re: Questions about projectors (spotlight with image)

Post by kintuX » Fri Jul 30, 2021 8:55 am

An image is worth a 1 000 words, a scene file a million.

PS
Uncheck "Use Cycles Settings" on Light
eg
spot light projected.jpg

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

Re: Questions about projectors (spotlight with image)

Post by Dade » Fri Jul 30, 2021 11:42 am

naruto123sdo wrote:
Thu Jul 29, 2021 11:57 pm
I wonder if it is possible to predict the camera image, given the diffuse color of the surface, distance between the surface and projector, projected image, and spotlight exposure? Is there a function governing that?
I'm not sure to understand the question. The rendering is somewhat the prediction of what you will get given the above information. What exactly are you trying to predict ?

Projection lights has also no exposure parameter :?:
naruto123sdo wrote:
Thu Jul 29, 2021 11:57 pm
I notice that I can change the exposure of the spotlight, but I'm not sure how specifically it affects the intensities of the projected image (e.g., after increasing the exposure by 0.1, how will it change the intensities of the projected image?).
Are you sure to not talk about camera exposure instead of light ?
naruto123sdo wrote:
Thu Jul 29, 2021 11:57 pm
Another thing I noticed is that the spotlight has attenuation, and I wonder what is the relationship between the exposure and the distances in Luxcore?
I assume you are talking of the attenuation of light intensity with the square of the distance, it just a physic law.
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 » Fri Jul 30, 2021 3:03 pm

Hi Dade,

Sorry about the confusions.
Dade wrote:
Fri Jul 30, 2021 11:42 am
Are you sure to not talk about camera exposure instead of light ?
I guess this is how to control the spotlight intensity, right?
Image
Dade wrote:
Fri Jul 30, 2021 11:42 am
The rendering is somewhat the prediction of what you will get given the above information. What exactly are you trying to predict ?
What I mean is, even before I do the rendering, can I predict the rendered result? For example, I'm projecting a grayscale image, let's say it's a pure gray image with intensities of 125. I project it on a flat plane with diffused color whose RGB value is (20,20,20). The plane is 1 m far from the spotlight, and it is perpendicular to the spotlight direction. The spotlight intensity uses the above configuration. The camera is able to see the illuminated plane. There's no ambient light.

Given the above information, can I predict what is the grayscale intensity of the plane on my camera image, even before I do the rendering?

Thank you, and please let me know if there's still anything not clear.
Attachments
Snipaste_2021-07-30_09-38-10.png

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

Re: Questions about projectors (spotlight with image)

Post by Dade » Fri Jul 30, 2021 3:49 pm

naruto123sdo wrote:
Fri Jul 30, 2021 3:03 pm
I guess this is how to control the spotlight intensity, right?
Image
I assume yes but it is a BlendLuxCore front-end pre-processing thing: LuxCore doesn't have such parameter, I assume it multiplies the gain by the exposure or something like that.
naruto123sdo wrote:
Fri Jul 30, 2021 3:03 pm
Dade wrote:
Fri Jul 30, 2021 11:42 am
The rendering is somewhat the prediction of what you will get given the above information. What exactly are you trying to predict ?
What I mean is, even before I do the rendering, can I predict the rendered result? For example, I'm projecting a grayscale image, let's say it's a pure gray image with intensities of 125. I project it on a flat plane with diffused color whose RGB value is (20,20,20). The plane is 1 m far from the spotlight, and it is perpendicular to the spotlight direction. The spotlight intensity uses the above configuration. The camera is able to see the illuminated plane. There's no ambient light.

Given the above information, can I predict what is the grayscale intensity of the plane on my camera image, even before I do the rendering?
Yes, but over the complete projected area or on a point ? Anyway, it is math it is possible to derive from the model but to what porpoise ? For you it may may be just easier and to look at the values on the EXR output :idea:
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 » Fri Jul 30, 2021 4:19 pm

Dade wrote:
Fri Jul 30, 2021 3:49 pm
Yes, but over the complete projected area or on a point ? Anyway, it is math it is possible to derive from the model but to what porpoise ? For you it may may be just easier and to look at the values on the EXR output :idea:
Over the complete projected area.

I'm doing a projector simulation, and it requires precisely control the rendered result in order to mimic the real-world scenario. For example, it requires me to control the above parameters (exposures, projected images, surface diffuse color etc.) so that I can get the required rendered result (the correct color on the illuminated plane).

So yes, what is the specific mathematical model Luxcore is using? Thanks.

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

Re: Questions about projectors (spotlight with image)

Post by Dade » Fri Jul 30, 2021 7:15 pm

naruto123sdo wrote:
Fri Jul 30, 2021 4:19 pm
So yes, what is the specific mathematical model Luxcore is using? Thanks.
The code for Projection light source is here: https://github.com/LuxCoreRender/LuxCor ... t.cpp#L161

ProjectionLight::Illuminate() takes a point a return the amount of light received and the shadow ray to trace to know if the light sources is visible. Assuming the light source is always visible, you need to integrate the values of ProjectionLight::Illuminate() over the surface you want to examine.

PBRT Texture Projection Lights should match LuxCore projection light sources (and vice versa): https://www.pbr-book.org/3ed-2018/Light ... tionLights
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 » Sun Aug 01, 2021 3:25 am

Dade wrote:
Fri Jul 30, 2021 7:15 pm
ProjectionLight::Illuminate() takes a point a return the amount of light received and the shadow ray to trace to know if the light sources is visible. Assuming the light source is always visible, you need to integrate the values of ProjectionLight::Illuminate() over the surface you want to examine.
Thanks a lot for the code and document. I notice ProjectionLight::Illuminate() returns c, but how is it related to a pixel in the rendered image? Also, I could not find imageMap in the file, and is it the image that is projected? And what is emittedFactor and where is it defined?

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

Re: Questions about projectors (spotlight with image)

Post by Dade » Sun Aug 01, 2021 9:13 am

naruto123sdo wrote:
Sun Aug 01, 2021 3:25 am
I notice ProjectionLight::Illuminate() returns c, but how is it related to a pixel in the rendered image?
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.
naruto123sdo wrote:
Sun Aug 01, 2021 3:25 am
Also, I could not find imageMap in the file, and is it the image that is projected?
Yes, it is a field of the object and they are declared here: https://github.com/LuxCoreRender/LuxCor ... ight.h#L66
naruto123sdo wrote:
Sun Aug 01, 2021 3:25 am
And what is emittedFactor and where is it defined?
Again, it is declared in the same header file and initialized during preprocessing here: https://github.com/LuxCoreRender/LuxCor ... ht.cpp#L86
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 » 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?

Post Reply