Realistic simulation of camera and laser

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Realistic simulation of camera and laser

Post by Dade »

B.Y.O.B. wrote: 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.
I think it can be done with the following image processing steps:

1) render the plane without laser;

2) render the frames of the animated laser;

3) for each frame make a difference between image of step #1 and the frame;

4) merge all the differences.

It should be doable with some command line tool/script (like ImageMagick).
Support LuxCoreRender project with salts and bounties
Doc_CC
Posts: 2
Joined: Tue Dec 11, 2018 10:02 pm

Re: Realistic simulation of camera and laser

Post by Doc_CC »

CodeHD wrote: Sat Dec 15, 2018 11:35 pm I now set up the lens system I showed in a previous post with v2.1beta3.
Would you be willing to post the blend file of this one? I'd very much like to see how you set up all your materials etc. to achieve this effect.
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Realistic simulation of camera and laser

Post by CodeHD »

Doc_CC wrote: Tue Dec 18, 2018 10:23 pm Would you be willing to post the blend file of this one? I'd very much like to see how you set up all your materials etc. to achieve this effect.
Yes I can, was asking for permission first since I took that lens design from a project. Since it is not a very complicated or special design, there was no objection :) In fact, it doesn't image very sharply (by todays standards) as it only has to illuminate a 1024x1024 sensor with 30um pixel pitch ;)
Read more on it here if you are interested.

- An important aspect to the matte-transulcent detector is that it has to be 3D and greater than 1e-05(mm) thick. With a 2D-plane or anything thinner it didn't work for me. If you hide the detector, the ortho-camera will still show an image, but it will be perfectly sharp, so no DOF effect.
- On the other hand, if you make the detector too thick, it will create additional blur.
- I curenntly have the lens edges and the spacers fully blackened. The spacers turned out to be necessary when I used the lens with the rest of the stuff from the paper, there seem to be problems at the boundaries between the lens main surfaces and sides (?) leading to stray light.

You might also be interested in this old Luxrender thread on a Nikon-Fisheye:
http://www.luxrender.net/forum/viewtopi ... =14&t=4776

Now to the newest laser_milkwater results:
Fox wrote: Mon Dec 17, 2018 3:18 pm It needs tuning, but here is the blend file.
I had a look at your file now. Was good to have it as a reference how to set up heterogeneous material and a gradient (although I don't fully understand the nodes yet. Is there an explanation somewhere, the wiki doesn't seem to hold much info?).
Including some surface tension at the water surface does model quite well what is seen at the top, no fat layer needed ;) I also had the idea of a thin sedimentation layer at the bottom, which I faked by increasing the glass roughness, but that didn't have the effect I hoped for.

Currently I am fiddling with the balance between the gradient, absorption etc. to see what makes for a realistic case. But I'm quite pleased with the result already, the rest depends also on the IOR of the glass (unknown) and geting the surface tension curvature right.

Only question on your file: Why do you use all those subsurf modifiers? 6 Million verts :shock: Nothing wrong with a bit of smooth shading + edge split, I have only 1400 at the moment with the curved surfaces.
Attachments
milklaser_curved_surfaces.jpg
laser_milkwater2.blend
(674.77 KiB) Downloaded 180 times
lens_example.blend
(2.23 MiB) Downloaded 176 times
Fox
Posts: 437
Joined: Sat Mar 31, 2018 11:17 am

Re: Realistic simulation of camera and laser

Post by Fox »

Looks pretty good.

The node is just to change the scattering asymmetry.
Close to value 1 looks darker (forward scattering).
Value 0 looks more white like candle wax (isotropic scattering), not very transparent no detailed shapes.

The 6 mill was little much.
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Realistic simulation of camera and laser

Post by CodeHD »

Fox wrote: Wed Dec 19, 2018 6:04 pm The node is just to change the scattering asymmetry.
Close to value 1 looks darker (forward scattering).
Value 0 looks more white like candle wax (isotropic scattering), not very transparent no detailed shapes.
I meant the Mapping Nodes themselves, particularly the "3D-mapping node". Understanding what the numbers do (but not only that, the whole chain).
When I copied your example, I first tested it by applying it to an RGB scale fed to scattering color instead of scattering asymmetry. Initially I got a horizontal gradient. I then tuned it so that I roughly had a vertical gradient across the glass, then switched it to the asymmetry.

I actually had some banding problems witht he colors, i.e. the linear interpolation didn't work. There was some other weird behaviour with the absorption and scattering color though, I might open another topic for that when I set up an exmaple file...
Fox
Posts: 437
Joined: Sat Mar 31, 2018 11:17 am

Re: Realistic simulation of camera and laser

Post by Fox »

I don't understand all the nodes either. With the help of test scene and live preview i slide the values around.
Post Reply