IES-Like Lights in Cycles / Architectural Lighting

Hi everyone

Recently i started playing around with angle-dependent lights to imitage IES Lighting Profiles with Cycles. This trick works with Mesh-Lighting (Emission Shader), as well as Area Lights. I’ve found the Area Lights to behave better than Emission-Planes, mainly because you can independantly adjust the Size and Strength without influencing each other.



Demo File

http://www.pasteall.org/blend/16001

Change Lamp Size to vary “fuzzyness” (doesn’t influence overall brightness, unlike emission-planes).
Play around with the ColorRamp to achieve different effects.

How it works

I get the angle between the normal and the incoming ray into the light to determine the light characteristics for this angle: vector-dotproduct: ab=|a||b|cos(phi). both vectors are normalized, so |a| and |b| are both 1, we get cos(phi)=ab

Then this drives a Colorramp to determine the Color/Strength depending on “the angle”. For simplicity i don’t use the angle - arccos(ab) - but just ab, because it’s in the right range [0;1] and i don’t need a linear scale.

The additional Light Falloff Node helps reducing the overly bright spots near the lamp, so it’s not “physicly correct” but can help alot reducing noise/fireflies.

what next

To use real .ies files, someone would simply have to write an converter to write the data into an image file, which could then replace the ColorRamp-Node. This could be a very nice feature for people doing architectural renders. making some image files as a library for different lights.

I hope this can be of use to some uf you :slight_smile:

3 Likes

Great stuff! Gotta try this.

EDIT: tried this and it’s super cool. I’m thinking how much stuff could be done with nodes that i’m not even considering/understanding because of my non-math background…sigh.

I mean, dotproduct!? Incoming/normal!? Vector math!? :slight_smile:

Thanks.

Hi Gexwing,
Thanks a lot for your generosity.
“to write an converter” could you explain your idea, please?

Great work. This is excellent. Thanks.

@gexwing
Thank you, very much.

Elegant method.
Thanks for share :wink:

I think would be better if someone write a python script that convert ies values into color-ramp node directly :wink:

The best thing would be a direct implementation for .ies files in lights… and that’s at the moment still a bit over my head. The script sounds a bit complicated to work with (working with the second example picture with only 18 values was already a bit of a pain) reading an image would be way user-friendlier, and i only proposed this for convenience so you could get some free .ies files and convert them easily, for custom stuff you can still use colorramp, or even other textures, like a wave texture there. Feeding the dotproduct into it’s coordinates, works well too:


1 Like

gexwing,

this is awesome! Much better than our dabbling with geometry to fake ies lights about one year ago or so (time flies!), and so fast! Thank you very much for posting, very clever!

I wonder if this approach has been possible all along but nobody got the idea until now.

What a great solution!

I believe such a thing would’ve been possible since the ramp node was committed, but he seemed to be the first one to actually try using something like the geometry node to modulate the power of the light.

Testing it myself, it looks to be a pretty impressive trick, while it is true that there’s no specific sampling or speed advantages with this setup, it essentially means that we have discovered a way to turn a mesh emitter into a spotlight without using the actual lamp type. (which means you have all of the indirect and mesh-related goodies as well like caustics and an adjustable start radius.)

This is a nice trick! Just wait till storm’s volumetric patch and it will be 10x cooler.

Very clever idea, I will be interested to play with this technique. Thanks for sharing!

To everyone wanting to play with the technique.

Not to hijack this thread, but noting that it might be time consuming to set this up over and over again if needed, I decided to take the liberty of converting this system to a group node format which can be found in this file.
Cycles_spotTest.blend (428 KB)

The group node contains various controls on the width of the light cone as well as a few more to control the visibility and falloff of a common IES type similar to what is already seen in this thread. I will note that for flexibility reasons, it may not be the best to include a pre-defined ramp node in the setup, but it’s the best that can be done until a developer gives the user the ability to embed widgets like the ramp inside of the group node interface.

This is simply amazing, I wish I had the sort of math knowledge that you and Agus3D has. You can do incredible stuff with Cycles already if you only have the knowledge to really use it :slight_smile:

Very Nice setup :wink:

Genius. Wouldn’t even have occurred to me that you could do this.

Immediately I knew I just had to try this. great Idea gexwing.


Well, dont tell you not ask…
21 min, it was so cool to play with ramp. Thanks for idea.
I have no yet spot lamp support, tiny quad used as light source. (point light is not useful because it reset normal to always have dot()=1)



Only 2 scattering to speed up and make more contrast rays (bounce = 1)

Wonderfull!!
P.D: Anyone have a build for Mac OS X?

storm, that looks beatifull :slight_smile:
can’t wait until we have volumetrics in trunk, thanks for your work!

pretty sweet. Real IES implementation should be the eventual goal, but this is really cool for the time being.