CGTalk > Software Specific Forums > Autodesk Maya
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 08-24-2012, 04:34 AM   #1
breakerdrea
New Member
 
breakerdrea's Avatar
portfolio
Darren Rea
Animator
Animation Mentor Student and Griffith Uni Student
Brisbane, Australia
 
Join Date: Apr 2004
Posts: 21
Smile Linking an images' luminace value to a lights' intensity value

Hi,
I'm trying to control a lights' intensity value with the luminance value of an image. Does anyone know how I could possibly do this.

The image is a time lapse sequence. The sun is passing from the horizon to the midday sky through a lot of clouds. So the sun is flickering very fast as it rises.

I was thinking I could track the sun moving across the sky, and then crop it down to a 4x4 pixel image sequence. Then I could link the luminance values from the image sequence to a lights' intensity. I could use multiply node if the values are too small.

Any suggestions would be grand.

Thanks,
 
Old 08-24-2012, 11:26 AM   #2
Nyro
Lurking
 
Nyro's Avatar
portfolio
A. D.
Vertex Slinger
Munich, Germany
 
Join Date: Dec 2006
Posts: 1,436
colorAtPoint command to sample the image from a file node, do this in form of an expression to be run on every frame.
 
Old 08-24-2012, 02:51 PM   #3
breakerdrea
New Member
 
breakerdrea's Avatar
portfolio
Darren Rea
Animator
Animation Mentor Student and Griffith Uni Student
Brisbane, Australia
 
Join Date: Apr 2004
Posts: 21
Hi!! Thanks for your reply.
I've been searching the internet to understand how to create an expression and how to use the colorAtPoint command. But it's all way over my head.

I was wondering if you could expand a little on your explanation. For example, where on the file node do I create the expression?

Any help is greatly appreciate

Cheers
 
Old 08-24-2012, 04:41 PM   #4
Panupat
Expert
 
Panupat's Avatar
portfolio
Panupat Chong
Thailand
 
Join Date: Feb 2004
Posts: 1,942
From the sound of it, you'd want to create expression on your light's intensity.

The general idea is...
light.intensity = some.spot.on.your.texture.node

But if you already create an HDR sequence, just add that as a texture to your light's color.
 
Old 08-25-2012, 06:13 AM   #5
breakerdrea
New Member
 
breakerdrea's Avatar
portfolio
Darren Rea
Animator
Animation Mentor Student and Griffith Uni Student
Brisbane, Australia
 
Join Date: Apr 2004
Posts: 21
Thanks for your help guys.

I do have a hdr image sequence, but when I attach that to the light intensity or the light color it does nothing... I just get a zero value in the lights intensity and a constant white value in the lights color.
I used the connection editor to do this and went through the whole list of attributes that would let me connect with the intensity and or color.
I tried filenode outColor to the lights color
filenode colorGain to the lights Color
filenode defaultColor to the lights Color
etc. etc.
Nothing worked, which seems very unusual.

I tried the expression but I'm just not understanding them. I kind of get it if I saw someone else do it, but I couldn't repeat it. So to make one on my own is pretty much close to impossible for me.
I did attempt it though... right click the intensity attribute on my light > create expression. In the editor:
sun_pointLightShape1.intensity = colorAtPoint -u .5 -v .5 file2;
I got the colorAtPoint part from the maya help files. I also tried:
sun_pointLightShape1.intensity = colorAtPoint -o RGB -u .5 -v .5 -u 0.0 -v 0.1 file2;
But there were many syntax errors.

If I can't work this out then I'll have to animate by hand 1148 frames of light flickering through clouds to match a back plate, so any other ideas would be greatly appreciated.

Cheers,

Last edited by breakerdrea : 08-25-2012 at 07:30 AM.
 
Old 08-25-2012, 08:06 AM   #6
Panupat
Expert
 
Panupat's Avatar
portfolio
Panupat Chong
Thailand
 
Join Date: Feb 2004
Posts: 1,942
I just did a little test. Maya 2011. Added HDR to a spot light color normally like texture map. Render with Vray and it shows up without doing anything fancy. I'm guessing the value is correct too because it looks way different than software render.
 
Old 08-25-2012, 09:00 AM   #7
Nyro
Lurking
 
Nyro's Avatar
portfolio
A. D.
Vertex Slinger
Munich, Germany
 
Join Date: Dec 2006
Posts: 1,436
When you plugged the texture into the light intensity, did you do a render?

This might seem like a stupid question, but it's not obvious to everyone. In Maya, the color swatch will turn black or white or something random because it can just display a single value and not the many values that a texture can represent. Even if the texture is a solid color, Maya will not represent that color in the value or color swatch.

You have to render to see if your light is working as it should.
 
Old 08-27-2012, 11:35 PM   #8
breakerdrea
New Member
 
breakerdrea's Avatar
portfolio
Darren Rea
Animator
Animation Mentor Student and Griffith Uni Student
Brisbane, Australia
 
Join Date: Apr 2004
Posts: 21
Thank you, thank you, thank you!!!

Thank you so much for your help. You were right Nyro, all I had to do was a render to see... I was just looking at the values in the attribute editor.
I also inserted a multiply divide node in between and I can now increase or decrease the intensity globally.

You guys saved me a whole lot 'o work.

Cheers!!!
 
Old 10-31-2012, 06:21 PM   #9
m0071
New Member
portfolio
moe b
Berlin, DE
 
Join Date: Dec 2009
Posts: 4
Trouble with 32bit floating files colorAtpoint

I am doing something quiet similar to breakerdrea, but I need to change the color of the light driven by the colorAtPoint.
I found out that the colors that been read are just wrong if the colour is very bright (r0.965 g0.972 b0.801) it will be that colour in maya (r0,957 g1 b0) or a dark colour (r0.007 g0.002 b0.004) will be in maya (r1 g0 b0.416). Do you have an idea where that is coming from?

float $RGB[] = `colorAtPoint -o RGB -u .5 -v .5 fileweiss`;
select -r pointLight1 ;
setAttr "pointLightShape1.color" -type double3 ($RGB[0]) ($RGB[1]) ($RGB[2]) ;

I am using
Maya 2013
32bit floating
I tried exr, hdr, tif32bit
The test files are generated with nuke and photoshop
 
Old 10-31-2012, 06:21 PM   #10
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:33 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.