2
$\begingroup$

I'm fairly new to blender and not a graphics person by any stretch of the imagination. I've been having some success though modelling semi-reflective glass for a project I wish to build (physically) and I'm wondering if it is possible to model the effects of a lens. The lens I wish to model is a double-convex type. It has a diameter of 120mm and a focal-length of 301mm. Is this something that can be modelled in blender and if so, how? I'd like to be able to position the camera close to this lens and reproduce the magnifying effects of the lens on the scene behind the lens as well as depth-of-field effects.

Thanks a lot.

$\endgroup$
  • 3
    $\begingroup$ have you tried yet? :) $\endgroup$ – zeffii Jun 28 '16 at 16:51
  • $\begingroup$ Regarding modeling, this should be possible. Regarding materials - it depends. Maybe related - blender.stackexchange.com/questions/9091/… $\endgroup$ – Mr Zak Jun 28 '16 at 19:29
  • $\begingroup$ Of course I misread the question, and wasted a few hours building a model of a double concaved lense: :-/ !Sample render. .blend file. $\endgroup$ – Loren Osborn Jun 29 '16 at 8:28
2
$\begingroup$

You can create something like the following. You can also adjust the IOR to your liking; this is just a sample at 1.2.

Result with Shady Puck in the background:

enter image description here

Mesh sideview profile:

enter image description here

Modeling

Start by keying Shift + A and going to Mesh > Sphere. Key R, then X, then 90. Key Numpad 3 and Numpad 5 to enter Right Orthographic view. Key Tab and Z to enter Edit Mode and Wireframe View, respectively. Key B for Box Select and drag while holding down your LMB to select the following vertices.

enter image description here

Key S, then Y, then .3 to scale the selected vertices down to a more lens-like shape. Key G, then Y, then .48 to slide them over. You now have half a double convex lens. You should see something like the following.

enter image description here

Key A once or twice to deselect all vertices. Key B for Box Select and drag while holding down your LMB to select the following vertices.

enter image description here

Key X and choose Vertices. Tab out of Edit Mode and key Z to exit Wireframe View. Go to the Properties panel > Object modifiers tab and add a Mirror modifier. Make sure Z is checked under Axis: and nothing else. Your settings should look like the following.

enter image description here

Add a Subdivision surface modifier. Set the View: value to 3 and the Render: value to 4.

enter image description here

Key T to toggle open/close the Toolshelf. Go to Tools tab > Edit dropdown > Shading: and select Smooth.
You are now done with modeling.

Materials

This is where the magic happens. Go to the Properties panel > Materials tab and add a Glass BSDF shader. Note that you will have to be in Cycles Render for this to work. Play with the IOR: as you wont.

Materials tab:

enter image description here

You now have a fully completed double convex lens.

Further Reading

Many of the techniques from this piece are gathered from tutor4u's awesome Focused Text Animation tutorial.

.blend file

The following is the .blend file with the lens and Shady Puck text from the first image.

$\endgroup$
  • $\begingroup$ Any idea concerning the DoF effect (without the compositor) ? $\endgroup$ – lemon Jun 28 '16 at 17:34
  • $\begingroup$ @lemon Without the compositor, not off the top of my head. I might be able to figure something out with enough research. If you have an idea, though, feel free to add it somewhere towards the end. $\endgroup$ – Shady Puck Jun 28 '16 at 18:00
  • $\begingroup$ @user1602842 If you like my answer, please consider accepting it by clicking the checkmark in the upper left corner of my answer. It would help me greatly and make me very happy! $\endgroup$ – Shady Puck Jun 28 '16 at 19:17
  • $\begingroup$ Shady Puck, if you're still there, I was able to reproduce your lens from scratch, great tutorial, however when I try to use the lens in my existing scene, I'm unable to render the other materials and textures correctly. In Cycles Render mode, everything turns out grainy at best, although the lens works. I've tried applying new materials to the other surfaces but couldn't get anything to look realistic. Is there any way to render standard textures, such as wooden floors, while in Cycles Render mode? $\endgroup$ – sebinho Jun 28 '16 at 20:59
  • 1
    $\begingroup$ @ShadyPuck Just tried it - RoundCube creates less distortions even with 3 or more subdivisions! I assume the umbrella-shape of the polar end of the sphere creates artifacts when spheres are used to make lenses with their poles up $\endgroup$ – MicroMachine Feb 12 '19 at 0:11
2
$\begingroup$

I think this problem could be broken down into three separate issues:

  1. Modelling - In theory, geometry-wise you should be able to model "anything" you like, there really aren't that many constraints imposed. A convex lens is a relatively simple geometry should not be too hard to model.

    Whether Blender is the adequate tool for this is another matter. If you want real mathematical rigor and precision a NURBS modeling software may be more adequate although it is perfectly possible to do it in Blender with fair amount of

  2. Lens Effect - If you plan on using Blender Cycles it is a physically accurate rendering engine, and it can even simulate a Pinhole Camera whether or not it can accurately recreate your lens is a matter of testing but all points in that direction at least for the distortion part.

    As for the depth of field I am no longer sure, but it's a matter of testing yourself.

  3. Actual Camera - Now I am not much into optics, but would it not be a lot easier to use Blender Cycles physical camera settings to simulate the camera effect?

    You can define a real world focal lens, sensor size, and even sampled depth of field with distance and size settings. Maybe this is enough to simulate the optics directly without having worry too much about physical accuracy of the model, although you may still want some form of simplified representation for your project.

$\endgroup$
  • $\begingroup$ Thanks a lot Duarte Farrajota Ramos. I'm going to look in to this. I guess Blender Cycles must be an addon. Doesn't look like it came with my install of blender (2.77 on Linux) but I'll try and track it down. All the best! $\endgroup$ – sebinho Jun 28 '16 at 19:20
  • $\begingroup$ Cycles is one of the two default rendering engines built into Blender by default (the other being Blender Internal), you should be able to select it from the drop down menu in the window header towards the top of the screen. blender.org/manual/render/cycles/index.html $\endgroup$ – Duarte Farrajota Ramos Jun 28 '16 at 19:35
  • 1
    $\begingroup$ Yes, found it - and it was using that renderer by default. Thanks again I'll read up on these links. $\endgroup$ – sebinho Jun 28 '16 at 19:42
  • $\begingroup$ Actually no it wasn't - it got switched over when I loaded Shady Puck's blender file $\endgroup$ – sebinho Jun 28 '16 at 20:21
  • $\begingroup$ You can freely switch between the two at any time but have in mind that they are completely different and separate rendering systems. Materials shaders, and textures created for Cycles won't work in Blender internal and opposite is also true. $\endgroup$ – Duarte Farrajota Ramos Jun 28 '16 at 23:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.