Realistic simulation of camera and laser

Use this forum for general user support and related questions.
CodeHD
Posts: 96
Joined: Tue Dec 11, 2018 12:38 pm

Re: Realistic simulation of camera and laser

Post by CodeHD » Sat Dec 15, 2018 4:26 pm

B.Y.O.B. wrote:
Thu Dec 13, 2018 4:58 pm
Opacity=1 is the default.
I should have said "you should leave it at 1" instead of "not use it".
Yes, I got that, and by now I also see that it should be. I re-read FarbigeWelt's link from the first response:
viewtopic.php?f=2&t=474&start=120#p5737
where I noticed he mentioned it already. But more below...
B.Y.O.B. wrote:
Thu Dec 13, 2018 4:58 pm
Like transparency in an image manipulation program or a compositor.
I also understood that, I was focussing more on the "like" alpha. I'm still not quite clear about how I should understand its effect exactly. It seems only the surface effects are "made transparent", but the volumetric effects remain? But this is not so important at the moment to me anyways.

Now to the "new" stuff (rediscovering what FarbigeWelt already observed in the link above). In short: The glass doesn't work properly unless "rough" (or "architectural" for partial realism) is checked. This is also what is needed to make the blend-file provided by FarbigeWelt in this topic look as expected.

I played around more and tried to make a real experiment which I then recreated with Luxrender. It consists of a glass of water with a few drops of milk as a homogeneous scatterer, observed with a DSLR with 70mm lens from about 500mm distance.

Appended are the following images:
- photograph of the experiment
- Render as best as I could in this time with rough glass (roughness=0.01)
- Render without rough glass
- Photograph and rough-glass render with adjusted histogram to show some contour of the scatter within the milky water.
- blend file

An interesting observation is that I only need to activate roughness on the glass material, but not on the water, which is also set up with a glass material. Maybe that has something to do with how the volumes overlap (as described in tutorials)? Didn't test that further.
Attachments
real.jpg
rough_glass_001.jpg
normal_glass.jpg
real_histo.jpg
rough_glass_001_histo.jpg
laser_milkwater.blend
(592.5 KiB) Downloaded 28 times

User avatar
B.Y.O.B.
Developer
Posts: 2247
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Realistic simulation of camera and laser

Post by B.Y.O.B. » Sat Dec 15, 2018 4:36 pm

It might be that those paths are very hard or impossible to render with the glass material (perfectly specular surface).
You might need a more advanced algorithm for them, e.g. BidirVM. You could try with BidirVM, it's available in luxcoreui.
See this post for more details: viewtopic.php?f=4&t=657#p6583
Note that BidirVM is unfinished and contains bugs.
Support LuxCoreRender project with salts and bounties

CodeHD
Posts: 96
Joined: Tue Dec 11, 2018 12:38 pm

Re: Realistic simulation of camera and laser

Post by CodeHD » Sat Dec 15, 2018 5:46 pm

Good suggestion and interesting read. I used the "hack" from that post, don't have the UI installed. (Is there any significant functional difference?)

Attached is the resulting render, non-rough glass, ~4000 Samples as the images above (forgot to mention it there).

Looks better than the non-rough BiDir, but suffers from other problems. At first glance, it could be the energy-conservation problem mentioned in the other post. The beam doesn't seem to get darker on its way down, as it should.

The BiDir + roughness "workaround" seems to start breaking down in effectiveness below roughness=0.01 as well, at least it takes some time longer to converge, I currently have that running. Btw, The BiDirVM also needed a few 100 samples before the beam was really visible.
Attachments
bidirvm.jpg

CodeHD
Posts: 96
Joined: Tue Dec 11, 2018 12:38 pm

Re: Realistic simulation of camera and laser

Post by CodeHD » Sat Dec 15, 2018 11:35 pm

And to get back more directly to the original question: I now set up the lens system I showed in a previous post with v2.1beta3.

As a detector, I used a thin block with matte translucent material. Then I observed that from behind with an ortographic camera. works like a charm!

The test object was again a Suzanne which I illuminated with a conical light.

Images of the setup and result attached. I must say I am quite impressed by the result! The 5-element lens images as it should.

All volumes were clear in the final render. No roughness on the glass surfaces either (except the lens sides are rough glass to make it more realistic, but they are not illuminated in this case, only by lens ghosts). Rendered with BiDir CPU + Metropolis, 300 Samples. Took about 10 minutes on an i7-4800MQ. No clamp, so it is even free of fireflies (almost at least).
Attachments
setup.png
setup2.png
setup3.png
suzanne.png

Fox
Posts: 135
Joined: Sat Mar 31, 2018 11:17 am

Re: Realistic simulation of camera and laser

Post by Fox » Mon Dec 17, 2018 3:18 pm

The milkwater looks like there is fat on top, then down from there water, and even more down maybe mixed milk protein particles.
I tested texturing the Volume Scattering asymmetry like so, but interpolated in final render.
Volume Scattering asymmetry.png
It needs tuning, but here is the blend file.
laser_milkwater_Fox.zip
(268.45 KiB) Downloaded 33 times

CodeHD
Posts: 96
Joined: Tue Dec 11, 2018 12:38 pm

Re: Realistic simulation of camera and laser

Post by CodeHD » Mon Dec 17, 2018 5:09 pm

Fox wrote:
Mon Dec 17, 2018 3:18 pm
The milkwater looks like there is fat on top, then down from there water, and even more down maybe mixed milk protein particles.
I tested texturing the Volume Scattering asymmetry like so, but interpolated in final render.
Volume Scattering asymmetry.png

It needs tuning, but here is the blend file.
laser_milkwater_Fox.zip
Interesting idea. It indeed wasn't super freshly stirred when I too the image, so a gradient is a good idea. I believe one would also need to model a gradient of the scattering scale in that case.
However, I think the biggest impact at the top is due to surface tension forming a curve at the glass-water-air boundary. The amount of milk in the water really was very low, I would estimate about 10 drops. Definitely not enough to cause a layer of fat as thick as whats visible in the image ;)

I'll have to check out your blend-file tomorrow.

Fox
Posts: 135
Joined: Sat Mar 31, 2018 11:17 am

Re: Realistic simulation of camera and laser

Post by Fox » Mon Dec 17, 2018 8:04 pm

CodeHD wrote:
Mon Dec 17, 2018 5:09 pm
The amount of milk in the water really was very low, I would estimate about 10 drops. Definitely not enough to cause a layer of fat as thick as whats visible in the image ;)
Unless this milk was milked from real grandma's cow, all natural unstrained straight from cow tit ;) ;)
Then the light hits them particles, not like Chinese powder milk, don't even test this, does not work.

chaz
Posts: 1
Joined: Tue Dec 18, 2018 5:02 am

Re: Realistic simulation of camera and laser

Post by chaz » Tue Dec 18, 2018 5:11 am

I would like to accomplish something similar to the original poster. I am moving a mirror and would like to observe where a reflected laser is illuminating a plane, or a curved surface. The simulation would be transient, to it would be great if the plane (ie, the camera) could store the locations where it had been illuminated. I came across a video on youtube done in blender:
https://www.youtube.com/watch?v=CKRMuJE ... e=youtu.be

I would like the screen or camera to store where the laser hits. Is there a way to do this creating a transient video, and storing the illuminated locations?
Thanks!

CodeHD
Posts: 96
Joined: Tue Dec 11, 2018 12:38 pm

Re: Realistic simulation of camera and laser

Post by CodeHD » Tue Dec 18, 2018 10:58 am

Fox wrote:
Mon Dec 17, 2018 8:04 pm
Unless this milk was milked from real grandma's cow, all natural unstrained straight from cow tit ;) ;)
Then the light hits them particles, not like Chinese powder milk, don't even test this, does not work.
Well, I used homogenized milk, so ideally there should be no clustering to form any fat layer ;)
In the experiment to recreate the atmospheric scattering (blue sky), it is always advised to use low-fat milk, because the droplets have a smaller size, and hence will behave a bit more like Rayleigh- instead of Mie-scattering and show more dispersion. Even better is to use "tincture of Mhyrr".

For anyone interested, here is a milk particle-size analysis: http://www.horiba.com/scientific/produc ... enization/ ;)
chaz wrote:
Tue Dec 18, 2018 5:11 am
I would like to accomplish something similar to the original poster. I am moving a mirror and would like to observe where a reflected laser is illuminating a plane, or a curved surface. The simulation would be transient, to it would be great if the plane (ie, the camera) could store the locations where it had been illuminated. I came across a video on youtube done in blender:
https://www.youtube.com/watch?v=CKRMuJE ... e=youtu.be

I would like the screen or camera to store where the laser hits. Is there a way to do this creating a transient video, and storing the illuminated locations?
Thanks!
From what I see in that Video (and understand in the comments) it is only an illustration. The effect you need is phosphorescence. While this is a question best left to the devs, I don't think this has been implemented yet, as it is quite difficult.
http://resources.mpi-inf.mpg.de/Renderi ... arance.pdf

Maybe you can make a workaround in post by blendeing previous frames. If you use a second render layer for the phosphorescent surface (which would be a simple diffuse in that case) you could only blend those and thus avoid having multiple laser-beams in your image.
Last edited by CodeHD on Tue Dec 18, 2018 11:04 am, edited 1 time in total.

User avatar
B.Y.O.B.
Developer
Posts: 2247
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Realistic simulation of camera and laser

Post by B.Y.O.B. » Tue Dec 18, 2018 11:02 am

chaz wrote:
Tue Dec 18, 2018 5:11 am
I would like the screen or camera to store where the laser hits. Is there a way to do this creating a transient video, and storing the illuminated locations?
A workaround could be to render an animation with only the laser light enabled, then add all frames together.
Or you could animate the laser and use multistep motion blur, but I'm not so sure about that.
Support LuxCoreRender project with salts and bounties

Post Reply