Hi, after purchasing the recent add-on for lens simulation (Lens Sim), I wanted to resume some of my old experiments with lenses.
These tests are not yet perfect, in fact the lenses all have a small vortex in the center due to an inaccuracy on my part, and partly also to the fact that in the center there is a cone of triangles,I hope to find a solution.
But at the moment I’m happy with the result, I hope to solve the problem in the future.
The lenses are modeled with the help of Geometry nodes to create the curvature of the lens, and the material used is a simple BSFD Refraction.
The camera is orthogonal and with a group of optical lenses at the front.
I will post here perhaps other results in the future, and with the hope of also solving the annoying deformation in the center.
I found some sites where there are images of lenses and other things I found on Wikipedia, but this sector is huge, and the material is not precise, my approach is also very simple and does not guarantee a perfect creation of the optics, but today at least I managed to make some clean renderings, except for the defect in the center.
This is the file with some lenses, but I made so many.
I finally solved the defect of the lenses in the center, now I will have to redo the optical lenses that I considered good, I noticed that even the precision of the geometry nodes has some problems when I try to create an arc for three points, however now I redo all the lenses I have already done with this method, which basically uses circles positioned in the middle and scaled to find the correct diameter of the lenses, very artisanal but it works.
I’m not sure what the issue is, but it seems like something isn’t working as I expect it to. I’ve tried using different lenses with various curvatures and types, but they all appear to produce similar results. The focus distances and lens positions are different for each lens, but at least they don’t cause any distortions.
Hi! Cool tests you are having there. I’m just wondering how you render your lenses, in regards to things not working correctly. Maybe I can help you with your setup:)
My guess is that you aren’t using your camera as a sensor, but just a regular orthographic camera viewing through your lens. Right now your setup looks like this:
To make your camera act like a sensor it needs depth of field enabled, the focus distance is where your sensor is. To focus just move the sensor position(your camera).
Oh my gosh, you solved my problem, now they work as I hoped, it was as you said.
I had tried to set the depth of field, but without your help I would not have solved this in a short time, in fact I had not connected the position of the sensor with the focus point of the lenses, and after a few attempts, I deactivated it, now I can try to make corrections on those I had already made.
Then I will try to make optical reproductions of the lenses in 3D with the real specifications, but this is also a world that I need to understand better, optics is a very vast field.
@Heinzelnisse Your help was decisive, I tried to reproduce the optical lenses of one of the objectives present in the add-on, but I noticed a difference in the lenses, however I also added a BSDF Glossy Layer to the lenses, but in this test they have different distances but same angle and F-Stop 7.9, but with 3D models it is complicated to find the correct scale for the lenses and this affects the final result.
But now I have solved the problems due to precision, in fact the curvatures of the lenses are created with Geometry Nodes and are based on the original Google patent data of the 100mm f2.0 Kodak Petzval 1950 file.
This is with Lens Sim with Basic setting without adding any simulation such as Bokeh.
Other thing, I think that is possible to archive a glare effects with 3D lenses if you add Glossy BSFD Layer to Refraction BSFD, in this image made during my experiment I get a rendering with optic flare.
Maybe also adding some dirty thing is possible, but I have to make some test on it, I’m not sure why that happens.
I am continuing in this interesting work of creating 3D lenses, trying to make a personal library, and above all because I like to recreate the old photographic lenses, on which the modern ones are based, the first patents are even less complex and have good results
with Blender.
However I noticed that the lenses in Blender need to be about a meter in diameter, because there is a bug with the sensor.
The rendering times are longer than the standard camera but are acceptable, below are some images, one with the Blender camera and the other two with 3D optical lenses, the first with the 3D lenses also with the glossy component and the third only with refraction.
I continue with the modeling of new photographic lenses in 3D and I have also implemented a sort of dispersion based on the abbe number, but it is done by trial and error and is not based on mathematical calculations but obtained with various attempts.
I hope to find a method that allows me to implement diffraction precisely by entering the abbe number, but I need to understand better.
The implementation is done with nm wavelength, but it is definitely wrong.
Here’s an update with some tests done.
A bit exaggerate ones
btw could you please tell me how you calculate the depth of field cause I am also currently making lenses and can’t for the life of me figure out the correct depth of field
First of all, welcome to the Blender community, I hope you can also find help from others who are much more expert on this topic than me, in the meantime I can tell you the little that I understood for now.
With 3D lenses the depth of field is determined by the focus point of the camera, and must be behind the 3D lenses, this is affected by the F-Stop aperture in the panel, however, Cycles has problems with the scale of objects and this affects a lot in focusing on objects with the camera.
So the 3D lenses, for optimal functioning, must be large enough, I model the largest one with a diameter of about 1 meter, I have not yet identified an optimal size, in fact, I too am proceeding by trial and error.
After many tests with all the dispersion methods that I know and have found on Youtube, and infinite nodes of all types, the best of all is the simple one with 3 diffraction shaders with Red Green and Blu colors, I have not yet found a method to control the values
precisely, but I linked the abbe values to affect chromatic aberration.
These are currently the best in my opinion, they are high values but just enough to visualize the results obtained.
Ahh thanks a lot, yeah I understand why my lenses weren’t working, it was due to the fact that I was using the diameter of lenses given by patents, also BTW I recommed opticore for modelling lenses, its really useful (you can even make Aspherical lenses just by inputting the numbers given by camera patents).
Looks like I am gonna have to manually find the camera focus. Rn I am learning more about optics to figure out a formula for this. I am guessing the camera is parented to the empty?. Also thanks for saying what the depth of field value comes from as the tutorial I was using didn’t mention it.
Finally I made an empirical node to make chromatic aberration by using the Abbe Value, isn’t yet correct but now I can use only a value to make lens dispersion by using Abbe number.