Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / Photometric Light Creation?
  RSS 2.0 ATOM  
2 pages: 1.2 last

Photometric Light Creation?
Rate this thread
 
43057
 
Permlink of this thread  
avatar
  • Location: Bothell, Washington
  • Total Posts: 930
  • Joined: 22 August 2006 01:22 PM

I’ve used Maya for a while, but most of my work is done in 3ds Max.  I am exploring the Maya 2011 trial version, and I’m trying to figure out how to set up proper photometric lights.  In 3ds Max, a photometric light is just a click away.  But it seems that in Maya I have to first create a standard light, then add a photometric light shader and a photon emitter.  Is this correct?  Is there a faster way to do this?  Can a script be made that creates the light for you?

I’ve been searching around for some good Mental Ray for Maya resources.  Can you recommend any of your favorites?

Thanks!



3ds Max 2013, Maya 2013
Windows 7 Ultimate 64 Bit
Core i7, 12GB RAM
Nvidia Quadro FX 3700 (Driver 267.17)

Replies: 0
avatar

Just thought I’d try and bump up this thread.  I would really like to know if a script can be made that will create a new Area light and assign the mia_photometric light shaders to the light shader and photon shader components.  This seems like an easy task for someone who’s familiar with MEL.  But as I’m not one of those people, maybe its not as easy as I assume…

Any scripters out there know how to do this?



3ds Max 2013, Maya 2013
Windows 7 Ultimate 64 Bit
Core i7, 12GB RAM
Nvidia Quadro FX 3700 (Driver 267.17)

Replies: 0
avatar

If you can provide a sample scene file (so that I can see what exactly you want), may be I can help you with this script. Looks like an easy Job.



Dushyant Kumar Kashyap.
http://programmerslimbo.blogspot.com/

Replies: 0
avatar

Here is a sample scene with a sample light all set up.  Thank you for your help.

Edit:

The script needs to be able to create a new Area Light and mia_photometric_light shader each time it is run.

(1) Create a new Area Light
(2) Enable “Use light shape” within the mental ray options
(3) Change the shape from the default rectangle to a sphere
(4) Set samples to 32
(5) Create a new mia_photometric_light node and assign it as a Light Shader and Photon Emitter
(6) In the mia_photometric_light node set the “Manual Peak Intensity Cd” to 2000

You’ll notice that I also have a mental ray exposure node assigned to the camera.



3ds Max 2013, Maya 2013
Windows 7 Ultimate 64 Bit
Core i7, 12GB RAM
Nvidia Quadro FX 3700 (Driver 267.17)

Attachment Attachment
Replies: 0
avatar

Ok, so here’s what I’ve come-up with,

https://www.creativecrash.com/may.../photo-metric-light-setup

It works 100% accurate only if there’s no Other Area Light in the Scene.
This limitation is due to the fact that I am still working on fetching the newly created areaLight-name in a variable.

Rest all works fine I guess, just source the script and it’ll create a setup for you. I’ll try to enhance it with UI and other stuff as and when I get time. Please check if I’ve left anything else.

Now here’s a query for you, can elaborate the purpose of this kind of setup, I mean how does it add-up to your Image.



Dushyant Kumar Kashyap.
http://programmerslimbo.blogspot.com/

Replies: 0
avatar

Yeah the tough part is getting it to work so that it creates new nodes each time so that it can be used repeatedly in the same scene and session.

Now here’s a query for you, can elaborate the purpose of this kind of setup, I mean how does it add-up to your Image.

In the Maya help, look for the mental ray “Sun and Sky” section.  Towards the end of that it discusses Photometric Light.  Here is a copy and paste of part of it:

The Problem
One difficulty in using base mental ray shaders to render a physically correct scenes with GI (using photons), is in balancing the photon energy and the direct light correctly. The reason for this is that the intensity is generally specified as an intensity for some given direction (for example the peak intensity on a spotlight), but the energy is the sum of (or technically, the integral) of all such intensities in all directions.

So for example for a spotlight, for the same peak intensity, you would need different photon energies depending on the width of the spotlight cone, and depending on the shape of the intensity distribution within that cone. And while this can be calculated for a mathematically defined intensity distribution (such as a spotlight cone) what about an arbitrary distribution as defined by a light profile?

Furthermore, to ensure optimal convergence of the photon solution for a light which varies its intensity based on the direction of light (e.g. a spotlight or a light using a light profile), instead of emitting photons of different energy in different directions, one should emit photons of similar energy in different densities. So the amount of energy-per-area (the density of photon energy) at a given point must match the direct light arriving at that point.

The Solution
To solve all these issues, we introduce the mia_photometric_light. It takes all the guesswork out of balancing the photon energy with the light intensity by peforming a numerical integration of the chosen intensity distribution to calculate the proper photon energy automatically, as well as takes care of adapting the photon density to the distribution, all automatically.

To use it, simply use the same instance of the shader as both light and photon shader on a light source. The light must have an origin (i.e. the shader does not work on an infinite light source). The light must be set to emit photons, and must be given a nonzero energy value (although the actual value will be overriden by the shader, a nonzero energy value is required, or mental ray will not emit any photons at all for the light). The exponent should always be 2. If the light is a spotlight, a spread value should be used. See the mental ray manual about lights.



3ds Max 2013, Maya 2013
Windows 7 Ultimate 64 Bit
Core i7, 12GB RAM
Nvidia Quadro FX 3700 (Driver 267.17)

Replies: 0
avatar

Thanks for the Info, and I’ve done changes to make it work everytime-and-everywhere (with Maya 2011+ ). Check if this works for you.
Regards.



Dushyant Kumar Kashyap.
http://programmerslimbo.blogspot.com/

Replies: 0
avatar

Your above link doesn’t work for me.  Is there another link to use?



3ds Max 2013, Maya 2013
Windows 7 Ultimate 64 Bit
Core i7, 12GB RAM
Nvidia Quadro FX 3700 (Driver 267.17)

Replies: 0
avatar

CeativeCrash says, File Pending Moderation, so Check this Attachment.



Dushyant Kumar Kashyap.
http://programmerslimbo.blogspot.com/

Attachment Attachment
Replies: 0
avatar

Thanks this is great!  There are a couple issues I’ve found however.

(1) When it creates the light, the “Illuminates by default” option is unchecked, so the light is not active.

(2) It creates a new mia_exposure_simple node each time the button is pressed.  It should first check and see if an expsure node already exists on a camera and if so, not create a new one.

(3) I should have said that it should make a mia_exposure_photographic node instead but I failed to mention that.  But I see it is as simple as replacing the node name in your script.

Thanks for your help with this!



3ds Max 2013, Maya 2013
Windows 7 Ultimate 64 Bit
Core i7, 12GB RAM
Nvidia Quadro FX 3700 (Driver 267.17)

Replies: 0
avatar

Done: Check it out.



Dushyant Kumar Kashyap.
http://programmerslimbo.blogspot.com/

Attachment Attachment
Replies: 0
2 pages: 1.2 last