Little Addon for optical lenses etc.

General project and community related discussions and offtopic threads.
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Little Addon for optical lenses etc.

Post by CodeHD »

uuh sweet, I must have overlooked that :D
wasd
Posts: 319
Joined: Tue Apr 24, 2018 7:20 pm

Re: Little Addon for optical lenses etc.

Post by wasd »

I think using words "floating point" and "precision" in one sentence should be strictly forbidden. Also, with 64 bit we won't even need the point to float.
CPU Bidir + Metropolis | Core i5-4570
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Little Addon for optical lenses etc.

Post by CodeHD »

I did a quick test, and enabled the option for both custom split normals as well as autosmooth on a regular mesh. It is controlled by a second switch. The autosmooth version is enabled by default because v2.3 is the latest stable release.
new_menu.png
new_menu.png (4.71 KiB) Viewed 5265 times
I've also tested the difference on the rendering result. Using custom split normals does change the result a bit for the better. However, no change to the shift-issue. See the following comparsion with a single lens at the origin. First old mesh with autosmooth, second with split normals.
autosmooth.png
customsplit.png
Then I also tested the influence of absolute size. Indeed, it seems that the "realistic" scaling leads to additional errors. A lens works better if it is a few m large. I find this strange, float should provide enough orders of magnitude to acommodate for everything, and it says everywhere I read that Blender internally uses float, just the display is rounded to 5 digits. Any ideas?

BYOB, where did you actually get the info that cutsom splits have higher precision that regular normals? I found no docs that specify this.
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Little Addon for optical lenses etc.

Post by B.Y.O.B. »

When I implemented the custom normal support, I wasn't satisfied with a Python solution (because slow), so I dug around in the Blender source code until I could extract a raw pointer to the custom normals array. And that is a float array.

You can see here that the regular normals are shorts (2-byte integer): https://github.com/LuxCoreRender/LuxCor ... ypes.h#L64
And here the custom normals are extracted (4-byte float): https://github.com/LuxCoreRender/LuxCor ... r.cpp#L679
Fox
Posts: 437
Joined: Sat Mar 31, 2018 11:17 am

Re: Little Addon for optical lenses etc.

Post by Fox »

Blender precision is just horrible.
Here i only have small cut-off of earth real size, but i need real origin for procedural shader.
Blender precision.jpg
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Little Addon for optical lenses etc.

Post by CodeHD »

We can put that on the pro-list for a "Lux Studio" :D
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Little Addon for optical lenses etc.

Post by CodeHD »

Since last posted here, I made some updates, especially a new inclusion of a cube-corner retroreflector array, and recorded a little introduction-video:

https://www.youtube.com/watch?v=D8rQBVI4lIg

As I mentiopn in there, I next plan to do a video of a real lens system. If I play it right, I can maybe turn it into a good demo of LuxCore's glass capabilities as well.
Post Reply