Jump to content

IES light shape


Recommended Posts

hello,

same as rdg I'm lost ...

I'm currently learning Houdini and Python, so sorry if my question seems to you stupid.

I think with my knowledge and some research, i can make a simple pyton array with differents values in the IES file in lat/long coordinate OR horizontal Angle/vertical Angle coodinate (system use in the ies file if i'm not wrong), but i don't understand how use this script ...

If I make my script with an external python idle, how can I use myfile.py in houdini to catch my array value ?

or if I make my script in Houdini, what is the workflow i must use ?

I come from maya, to deal with my script, I load my procedure/script then I run it in scriptEditor, Is houdini have something similar ?

Finaly, if I succeed to have my values in houdini node, what I 'm doing with them ;) ... but it's an another problem my first goal is to succeed/understand with python and houdini ...

If you are interesting with lighting design (technical, and "conceptual") I have found some interesting pdf's guides in Erco site section guide.

Basics

Simulation and Calculation

thx,

Papi,

realy I will take English treaning, is so difficult to formulate my mind .... , I hope you understand, but don't worry for your reply I have no problem to understand you ;)

Link to comment
Share on other sites

realy I will take English treaning, is so difficult to formulate my mind .... , I hope you understand, but don't worry for your reply I have no problem to understand you ;)

Never mind about that.. these guys can decipher ancient greek symbols from SIGRAPH papers :)

Link to comment
Share on other sites

Never mind about that.. these guys can decipher ancient greek symbols from SIGRAPH papers

... sometimes :)

I think with my knowledge and some research, i can make a simple pyton array with differents values in the IES file in lat/long coordinate OR horizontal Angle/vertical Angle coodinate (system use in the ies file if i'm not wrong), but i don't understand how use this script ...

Hey Papi,

Your English is just fine, so don't worry about it.

About your question: I think that the extent to which Python (or C++, or VEX, or anything else) might play a role in an IES solution will be dictated by the format in which you choose to encode the measurements. And whatever method that ends up being, has to support filtered lookups (point sampling is pretty much guaranteed to produce aliasing in this case, I would think). So... yes, you can create arrays in Python (ditto in VEX and C++), but does that mean that Python is the right choice for both creating the internal representation of the IES data ("arrays" in your suggestion) and performing the lookups?... possibly, but my gut says there're probably better ways.

The environment map choice has the advantage of already providing filtered lookups, and that's a big plus. The only downside to env maps is that they're not all that compact (about 99% of the storage is wasted on axially symmetrical distributions where a 1D array would do) -- but this could eventually be optimized without necessarily changing the format (by specializing the creation and lookup functions). Also, said map needs to be "manufactured" somehow from the raw IES file data (a generator COP might do the trick here, possibly managed by a python wrangler) -- but this conversion step will exist no matter which method you choose to go with, so it's a constant.

So I guess what I'm saying is that sure, python might play a part in some of the data wrangling, but I'm not convinced that using python for the actual storage and lookup is necessarily the best choice (it's certainly not your only choice).

HTH.

P.S: No, I haven't implemented this myself, so I'm just thinking out loud here.

Link to comment
Share on other sites

  • 4 weeks later...

Hi all,

I found some play time so I decided it was about time I started learning Python, and this seemed like a nice project to get started with -- a little parsing, a little HOM, and some optional SOHO for wrangling.

So here's a first kick at the IES can: It's a light object that is functionally equivalent to the default "hlight", but has an extra tab where you can specify a "power distribution map". In the same tab you'll also find controls for converting an IES data file into one of these maps. The angular mapping of this "distribution image" is neither lat-long nor cube -- it's a dual-paraboloid map.

Here's a bundle that includes the light object and its vex shader (pdlight.otl), a test hip file (test1.hip), and a couple of IES catalogs from General Electric and American Electric Lighting -- there are about 400 ies profiles to play with in there. I didn't get around to doing a proper help for it, but there's a "README" file that has some details on how to use it.

pdlight_v1.tar.gz

WARNING: This light is currently not much more than a quick sketch (it is NOT a production-ready HDA), so please treat it as though it were some dangerous lab experiment that's liable to blow up any second :)

There were a bunch of choices I made along the way which are debatable (like the dual-paraboloid mapping) and which I may reconsider later. One thing is perfectly clear: the map generation portion of this approach is stunningly inefficient -- if this were an HDK filter, it could generate the image 1,000 times faster and with good filtering. Oh well... at least this way no one needs to compile anything :)

Some of the General Electric lamps:

post-148-1230589794_thumb.jpg

How it works:

The IES file parsing is done by a bunch of python functions (not a class yet, since there's only support for IES) in the "PythonModule" section of the HDA. When a new file is specified, the ies_load() function is called, which parses the file and creates a dictionary with all the information. It then stashes the photometry measurements into a few (hidden) ramp parameters. These ramps are read by a VOP COP which re-encodes the measurements in the form of a dual-paraboloid map. The shader is then given this map as a parameter, which it looks up based on L and the light's local frame, using the resultant value to attenuate the light's intensity. That's it.

Wrangling:

This light should have a wrangler... but it doesn't. It currently falls back to the default HLight wrangler, except the light shader is overridden by the HDA's shader. Bad form, I know, but I couldn't find a way to include the wrangler in the HDA itself, meaning that when distributing the HDA I'd need to tell people how/where to install the wrangler, etc, etc... a PITA for something so intrinsic to the light's definition. I could be missing something, but it appears that, even though the SOHO wrangler mechanism makes things very flexible when generating IFD's, you can't include the wrangler itself inside HDA's and so a light HDA such as this one is suddenly no longer portable.... or is there a way to do this that I haven't found?

Anyhooo.... Enjoy! and Happy New Year! :)

Link to comment
Share on other sites

Hi all,

I found some play time so I decided it was about time I started learning Python, and this seemed like a nice project to get started with -- a little parsing, a little HOM, and some optional SOHO for wrangling.

Very nice, Mario! Thank you very much!

... but I couldn't find a way to include the wrangler in the HDA itself...

I ran across the same limitation when trying to OTLize the Indigo renderer pipeline.. unfortunately you can't do it. If your SOHO pipeline involves multiple files (such as IFD.py, etc) then I suppose you'd either have to extend Python to be able to look inside OTLs (sounds hard), or temporarily extract all Python files to some directory in the PYTHONPATH. Perhaps SESI can come up with a way since it seems there are more SOHO scripts becoming available.

Link to comment
Share on other sites

I ran across the same limitation when trying to OTLize the Indigo renderer pipeline.. unfortunately you can't do it.

That's too bad. I was kind'a hoping you'd say "Oh yeah, just do such and such" :)

I suppose that wranglers are not *strictly* necessary... but they're a much nicer way to support multiple renderers... what bothers me is the fact that the whole encapsulation idea behind HDA's is broken in this case. Maybe they could search installed HDA's for a special "Wrangler" section, or allow an 'opdef:/' path in the 'light_wrangler' parameter (which it currently looks at to determine the *external* script).

Thanks for the confirmation, Jason.

Link to comment
Share on other sites

I was starting to miss you, Mario :) thanks for the great contribution!

Thanks for the kind words everyone. I had fun doing it.

Please feel free to improve it (and post said improvement! :)). My Python knowledge is pretty rudimentary at present so I'm sure there are more efficient ways to do some of the things I'm doing in the parser. Also, if someone feels like writing an HDK version of the image generator, I'm sure it will be much appreciated -- the ramp-based hack I ended up using pretty much suXors. I probably won't be able to look at this again for some time, so take it away!

Cheers!

Link to comment
Share on other sites

  • 2 years later...

Thanks for the kind words everyone. I had fun doing it.

Please feel free to improve it (and post said improvement! :)). My Python knowledge is pretty rudimentary at present so I'm sure there are more efficient ways to do some of the things I'm doing in the parser. Also, if someone feels like writing an HDK version of the image generator, I'm sure it will be much appreciated -- the ramp-based hack I ended up using pretty much suXors. I probably won't be able to look at this again for some time, so take it away!

Cheers!

Hi, Mario, I trying to get nice photometric shape and using your developments.

But something is wrong.(I read your README.TXT file).

Is your method actual now? H11.0.733

post-5859-131065756219_thumb.jpg

Edited by olegwer
Link to comment
Share on other sites

  • 10 months later...

After reading about on the net, I'm a little surprised this isn't built into Houdini :(

It is now, which why Jeff is talking about it these days.

Friday, June 3, 2011

Houdini 12.0.283: Added support for IES photometric lights. .ies files are now recognized by Houdini as an image format, and can be used with the environment() VEX function to query the amount of illumination in a particular direction. IES lights are now accepted by the "Environment Map" parameter on the light object.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...