KeyShot Forum

Technical discussions => General discussion => Topic started by: cash68 on December 13, 2018, 02:33:23 PM

Title: Trying to accurately simulate LED lighting and a lense
Post by: cash68 on December 13, 2018, 02:33:23 PM
Hi, industrial designer here.  I am working on a project that has a circuit board enclosed in a clear acrylic lens.  The issue we are having is that the LEDs don't diffuse very much, leaving us with hot spots in the center, and uneven illumination of the decal we will be placing on top.  We tried working with the decal supplier, and they were able to add a diffusion layer which helped a lot, but then the light was too dim.

So, here is the plan:

Simulate what we have currently, in keyshot, using reference photos.   These are the LEDs were are using:

https://www.digikey.com/product-detail/en/kingbright/AA3528SES-J4/754-1571-1-ND/2704776

I tried entering some of this data in Keyshot, I am using a basic 'spotlight' since that lets you adjust the viewing angle, but kind of lost on the rest of it.  Keyshot wants lumens, but the digikey has Microcandela.  I found a convertor online, but it also asks for the angle, so I'm not sure this is correct:

https://www.rapidtables.com/calc/light/mcd-to-lumen-calculator.html

Once I can achieve a rendering similar to real life, I will then CAD model some variations in the lens itself to try to diffuse the light more.   I have googled and come up with the refractory index of acrylic being 1.58, which I can enter into keyshot.  I'm also using the acrylic material from Keyshot, but changed the refractory index to 1.58 from 1.49.

So far this isn't even close to real life; the light looks white even though IRL it looks red.  It's also not scattering enough on the lens.  Help?

Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: DMerz III on December 13, 2018, 03:17:19 PM
Have you tried just using an emission shader instead of spotlight?

Spotlight/Area lights are more for 'lighting' other objects. Where as emissive shader might be prone to preserving the hot color of light you're looking for. Not sure if this will solve your issue, but that's where I would start.
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: TGS808 on December 13, 2018, 04:41:38 PM
This may (or may not) be of assistance.

https://www.keyshot.com/forum/index.php?topic=21022.msg89449#msg89449
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: designgestalt on December 14, 2018, 01:43:59 AM
hi there,
I would agree with what Mr. Merz the third said: an emissive would have been my first choice here. I would assume, that you have more control over the material tha the spotlight. It also gives you the possibility to mask the material with a color gradient, which would give you that uneven appearance. the colors alway "bleed" out, when you crank them up higher so you need to go for a much darker tone to achieve your final color, if you need that much power in your light.
my second choice would be a point light.
cheers
designgestalt
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: mattjgerard on December 14, 2018, 06:17:17 AM
The tip that worked for me is similar to the above, duplicate the geometry that you are using for the "light" and assign one the emissive to control the visual of the led and assign the other an area light, spotlight or point light to control casting light. Won't ever be able to use one light and get both the visual of the LED and the casting of the light correct. Much more flexible, and works for stuff like this-
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: cash68 on December 14, 2018, 06:26:43 AM
Emissive doesn't have a viewable angle tho.  The LED specs say the viewing angle is 120 degrees, emissives are 360 degrees from what I understand, which would skew the results and not help me achieve diffusion.
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: cash68 on December 14, 2018, 07:00:43 AM
Here's emissive, which..... looks a lot worse.
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: mattjgerard on December 14, 2018, 07:33:58 AM
Can we see some reference images of what you are trying to achieve? I've given up partially on getting physcially accurate results by just punching in numbers with LED lighting in KS. Just doesn't happen. I deal with light pipes, fiber optics and LED's behind cloudy plastics regularly. There is not really a "formula" that will work every time. The settings that will make red and green LED's look good do not work with Blue, that sort of thing. I've gone to LED chip manufacturers and downloaded the .ies files and tried to use those. Nope, its an art, lots of putzing with material settings, light settings and etc to get the look you are going for, and at the end it doesn't matter the numbers you use, its if it looks right. Frustrating, but that is the way it was with other unnamed render engines as well that I've used. I would love to just punch numbers in and have it work, but for some reason I can't get that workflow to work.

Anyway, if you can share some of the data, other magicians here can play with it and help make suggestions for your particular piece. This one here caused me much pain and anguish trying to figure out, but Dries here on the forum gave me some tips and pointed me to tone mapping which helped the propagation of the color through the cloudy plastic. Its a post production trick, and I was irritated that KS wouldn't work the way I wanted it to, I was hoping to not have to use Photoshop to achieve the look I wanted, but had to.
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: DMerz III on December 14, 2018, 09:28:10 AM
Quote from: TGS808 on December 13, 2018, 04:41:38 PM
This may (or may not) be of assistance.

https://www.keyshot.com/forum/index.php?topic=21022.msg89449#msg89449

The solution is here, my man. Read this. BDesign (Eric) lays it out so well. Follow what he does, and you'll get what you're looking for, an LED appearance (hot color that doesn't desaturate) and light casting (which illuminates the area around it in colored light).

Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: mattjgerard on December 14, 2018, 10:08:47 AM
Hahaha, that's funny, I was just looking for that post, and you beat me to it. That was one b#$tch of a project, and Eric really helped me out. Pretty much the rest of my work has been based on this way of working, so its pretty solid. I'm creating a folder of links to these gems of posts so I can go back and reference them.


Thanks for digging that up David, hope this helps the OP.
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: cash68 on December 14, 2018, 11:41:56 AM
Sure, here's a reference image:

You can see the hot spots pretty clearly here.  I'm trying to match this in keyshot, and THEN make modifications to the B-side of the lens to see which approach has the most light diffusion.
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: cash68 on December 14, 2018, 12:08:08 PM
How would I share my keyshot file?   Or cad data?
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: cash68 on December 14, 2018, 01:00:59 PM
I tried following that link, the issue is a lot of those settings are no longer available in Keyshot 8.  There is not even a point light diffuse material available anymore.   Here's what I could achieve as close as possible to those directions (foreground) with the modified 120 deg spotlights in the background.

Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: mattjgerard on December 14, 2018, 01:21:41 PM
CAD file would be great, if you can supply it. That way we are all playing on the same playground :)
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: cash68 on December 14, 2018, 01:57:59 PM
https://grabcad.com/library/warning-light-diffusion-1

Try this, I have a BIP and a .stp

The bottom of the circular elements are LIGHTLY textured, which is in the BIP
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: kiarash.tamizkar on December 16, 2018, 09:07:03 AM
what a useful discussion here... thanks everyone i enjoyed a lot
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: TGS808 on December 16, 2018, 09:59:21 AM
Quote from: mattjgerard on December 14, 2018, 10:08:47 AM
Hahaha, that's funny, I was just looking for that post, and you beat me to it. That was one b#$tch of a project, and Eric really helped me out. Pretty much the rest of my work has been based on this way of working, so its pretty solid. I'm creating a folder of links to these gems of posts so I can go back and reference them.


Thanks for digging that up David, hope this helps the OP.

It was actually me who dug it up.  ;) I bookmarked that one right after Eric posted his method as it was clearly a keeper. I knew I wasn't going to want to go digging for it in the future.  :D
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: TGS808 on December 16, 2018, 10:15:01 AM
Quote from: cash68 on December 14, 2018, 01:00:59 PM
I tried following that link, the issue is a lot of those settings are no longer available in Keyshot 8.  There is not even a point light diffuse material available anymore.

It's still there. They just call it "Point Light" now but it's the exact same thing that was called "Point Light Diffuse" in KS7. I believe you'll find all the other settings Eric refers too are available in KS8 as well.
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: TGS808 on December 16, 2018, 05:03:58 PM
I made an effort to match your reference photo. I started with Eric's method and made some modifications to it to better replicate the look you're going for. I think the LEDs and hot spots here look pretty close to what was in your reference photo. If you think this will work, you can have the KSP if you want it. Let me know.
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: bdesign on December 16, 2018, 05:24:44 PM
Quote from: TGS808 on December 16, 2018, 05:03:58 PM
I made and effort to match your reference photo. I started with Eric's method and made some modifications to it to better replicate the look you're going for. I think the LEDs and hot spots here look pretty close to what was in your reference photo. If you think this will work, you can have the KSP if you want it. Let me know.

I think it's awesome...and thank you kindly for the reference(s)...

Cheers,
Eric
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: TGS808 on December 16, 2018, 09:42:10 PM
Quote from: bdesign on December 16, 2018, 05:24:44 PM

I think it's awesome...and thank you kindly for the reference(s)...

Cheers,
Eric

Thanks Eric! That means a lot coming from you. Now I know how Harry Potter feels when Dumbledore says he's done a good job!  :D
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: INNEO_MWo on December 17, 2018, 12:49:35 AM
Quote from: TGS808 on December 16, 2018, 09:42:10 PM
Quote from: bdesign on December 16, 2018, 05:24:44 PM

I think it's awesome...and thank you kindly for the reference(s)...

Cheers,
Eric

Thanks Eric! That means a lot coming from you. Now I know how Harry Potter feels when Dumbledore says he's done a good job!  :D

That made my day.

Thank you both!


Cheers
Marco
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: mattjgerard on December 17, 2018, 05:36:07 AM
Well done TGS808, I have something similar looking going right now on this, so you beat me to it :) Looks great, that's the look that I was aiming for. Yours has a better balance of the hot spot and glow, mine is still a bit too blown out in the middle.

Dang I love this community.
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: cash68 on December 17, 2018, 06:47:11 AM
Wow, thanks for all the responses.   I'm still screwing with my file but if you guys could post yours, I'd love to dig into the settings and see how you're achieving this.
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: TGS808 on December 17, 2018, 07:34:23 AM
Quote from: cash68 on December 17, 2018, 06:47:11 AM
Wow, thanks for all the responses.   I'm still screwing with my file but if you guys could post yours, I'd love to dig into the settings and see how you're achieving this.

My KSP is attached.
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: DMerz III on December 17, 2018, 09:18:38 AM
Quote from: mattjgerard on December 14, 2018, 10:08:47 AM
Thanks for digging that up David, hope this helps the OP.

Haha, I know I'm late on this response, but all of the credit goes to TGS808 for originally posting it earlier in the thread. (And of course, Eric, for developing that method to begin with).

BTW, that attempt from TGS808 looks great, well done. Hopefully OP will see the light at the end of the tunnel  ;)
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: TGS808 on December 17, 2018, 10:45:36 AM
Quote from: DMerz III on December 17, 2018, 09:18:38 AM
BTW, that attempt from TGS808 looks great, well done. Hopefully OP will see the light at the end of the tunnel  ;)

Thank you David, I really appreciate that!  :D I do hope it helps the OP.
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: cash68 on January 02, 2019, 02:23:03 PM
Guys, I just want to say thanks for posting the KS file, it's helped a ton.  I'm getting it very close to reality, and now I'm ideating light pipe ideas on how to make the illumination more even.

I do have a question on texture or even modeling this.  So I am forced to use Alias.  I export the part as a 'wire' file without stitching it, that way I can 'colorize' the top side of the lenses.  When I import, this allows me to add texture to the top of these lenses, while keeping the rest of the material smooth/glossy.  However, the part is no longer 'solid', correct?  I can hide the top surface of the lense, because the part is now just a bunch of surfaces.  What file format could I use so that keyshot could treat the part as one material, but allow me to put different texture on different parts?
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: mattjgerard on January 02, 2019, 02:32:38 PM
Quote from: cash68 on January 02, 2019, 02:23:03 PM
What file format could I use so that keyshot could treat the part as one material, but allow me to put different texture on different parts?

Not knowing Alias at all, you can certianly just run the gamut of tests on all the possible export options, starting with the obvious ones, obj, FBX, stl, stp, etc, and see if it gets you where you need to be. Keep in mind that KS has a Geometry Editor that will allow you to split apart surfaces and/or objects. So, if for example  you are able to get the lens to import as one piece, but want to split the top surface from the back, you can do that operation inside keyshot easily. This is good for the times when you need to do this to just one or two objects. I deal with CAD files mostly and I use this quite a bit, where the plastic injection is all made from one cad piece but the actial mold has different textures that is imparts to a single piece. I get the whole mold cad, then I split off the smooth faces for labels, and leave the textured pieces as one piece.

Just an option to keep in mind,. Glad to hear you are making progress! We love to hear how troublesome projects progress!
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: bdesign on January 02, 2019, 02:44:56 PM
Perhaps these links might be of help:

https://www.keyshot.com/forum/index.php?topic=14095.msg71320#msg71320
https://www.keyshot.com/forum/index.php?topic=22850.msg97651#msg97651

Cheers,
Eric
Title: Re: Trying to accurately simulate LED lighting and a lense
Post by: cash68 on January 02, 2019, 03:05:24 PM
Quote from: mattjgerard on January 02, 2019, 02:32:38 PM
Quote from: cash68 on January 02, 2019, 02:23:03 PM
What file format could I use so that keyshot could treat the part as one material, but allow me to put different texture on different parts?

Not knowing Alias at all, you can certianly just run the gamut of tests on all the possible export options, starting with the obvious ones, obj, FBX, stl, stp, etc, and see if it gets you where you need to be. Keep in mind that KS has a Geometry Editor that will allow you to split apart surfaces and/or objects. So, if for example  you are able to get the lens to import as one piece, but want to split the top surface from the back, you can do that operation inside keyshot easily. This is good for the times when you need to do this to just one or two objects. I deal with CAD files mostly and I use this quite a bit, where the plastic injection is all made from one cad piece but the actial mold has different textures that is imparts to a single piece. I get the whole mold cad, then I split off the smooth faces for labels, and leave the textured pieces as one piece.

I tried this, but it came out really weird.  It was like Keyshot was not treating the object as solid anymore; instead it was the A side (textured but no thickness at all) and the b side (smooth, no thickness at all).  It was like the interior of the part did not exist, so the optics got super weird.