Page 6 of 6

Re: Little Addon for optical lenses etc.

Posted: Sun Apr 05, 2020 8:49 pm
by CodeHD
uuh sweet, I must have overlooked that :D

Re: Little Addon for optical lenses etc.

Posted: Mon Apr 06, 2020 4:22 am
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.

Re: Little Addon for optical lenses etc.

Posted: Tue Apr 07, 2020 8:27 pm
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 5326 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.

Re: Little Addon for optical lenses etc.

Posted: Tue Apr 07, 2020 8:35 pm
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

Re: Little Addon for optical lenses etc.

Posted: Tue Apr 07, 2020 9:06 pm
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

Re: Little Addon for optical lenses etc.

Posted: Tue Apr 07, 2020 9:14 pm
by CodeHD
We can put that on the pro-list for a "Lux Studio" :D

Re: Little Addon for optical lenses etc.

Posted: Mon Aug 31, 2020 8:39 pm
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.