Setting photon color of instanced light?

Discussions about SOFTIMAGEs© Interactive Creative Environment©
wannabeArtist
Posts: 98
Joined: 10 Jun 2009, 06:34
Location: Finland

Setting photon color of instanced light?

Post by wannabeArtist » 04 Jun 2010, 10:42

Hello,

As an attempt to keep my thread names a little more relevant, I start yet another one, which is basically part 2 of another thread here:
viewtopic.php?f=15&t=705

I have a particle setup based on emFluid and I'm using instance shape node to turn my particles into lights. For a while I thought I had got it right, but taking a closer look now, it seems that my results were what I wanted but produced by error :D

I had accidentally duplicated my point cloud, with one of them instancing lights and the other not - and it somehow produces the results in the screenshot.

While this kind of works, what I would really like to do is to be able to influence the photon intensity and color of each instanced light in ICE - is this possible?

Thanks!

EDIT: the grain in the shot is on purpose, I lowered the photon search radius to 0,1 to see if they actually have color or not.
You do not have the required permissions to view the files attached to this post.

wannabeArtist
Posts: 98
Joined: 10 Jun 2009, 06:34
Location: Finland

Re: Setting photon color of instanced light?

Post by wannabeArtist » 04 Jun 2010, 14:13

Hello again,

Slight progress, but then another dead end.

I managed to set photon color from my point cloud, but only if I set a constant value for it (set data). The good news is that it actually changes the color of the photons accordingly, even though I the light has been instanced before changing the color (in order of execution), it still affects the end result!

The only problem is, how do I pipe the particle color for the set data?

This is the message ICE gives when I try to do this in the obvious way (the missing link in the screen shot):

Input context supported: per Object
Output context supported: per point of "pointcloud.pointcloud"

Is there a way to just isolate the "plain color" out of it's context so it could be used here?

Thanks!
You do not have the required permissions to view the files attached to this post.

wannabeArtist
Posts: 98
Joined: 10 Jun 2009, 06:34
Location: Finland

Re: Setting photon color of instanced light?

Post by wannabeArtist » 04 Jun 2010, 15:28

Hmm,

I think I get it now, there's no way to make this work, because each particle would have a different color in each frame and there's only one light, which is been instanced.

Is there a way of casting the particle shape? Like "get particle shape" and then convert that to whatever object?

User avatar
Hirazi Blue
Administrator
Posts: 5113
Joined: 04 Jun 2009, 10:15

Re: Setting photon color of instanced light?

Post by Hirazi Blue » 04 Jun 2010, 19:21

What happens if you plug an attribute shader into the softlight of the light itself?
I tried this with a color_attribute and it resulted in different colors for every instanced light...
:-\
Stay safe, sane & healthy!

wannabeArtist
Posts: 98
Joined: 10 Jun 2009, 06:34
Location: Finland

Re: Setting photon color of instanced light?

Post by wannabeArtist » 04 Jun 2010, 19:29

Very interesting!

I tried that before today (and just checked again), but I couldn't get anything out of the drop down (attribute color) other than "use default value". It doesn't seem to "see" the particles.

You must have instanced the light differently - how did you do that?

User avatar
Hirazi Blue
Administrator
Posts: 5113
Joined: 04 Jun 2009, 10:15

Re: Setting photon color of instanced light?

Post by Hirazi Blue » 04 Jun 2010, 19:34

I basically followed the setup Stephen Blair shows in this post on his Support Blog:
using point light instances in ice
Stay safe, sane & healthy!

wannabeArtist
Posts: 98
Joined: 10 Jun 2009, 06:34
Location: Finland

Re: Setting photon color of instanced light?

Post by wannabeArtist » 04 Jun 2010, 19:44

Amazing,

That's what I looked at too, as you posted the link the other time.

Somehow it just wont work with my tree (based on emFluid). I even tried taking it to another place, but no luck. I better try an empty tree next...

wannabeArtist
Posts: 98
Joined: 10 Jun 2009, 06:34
Location: Finland

Re: Setting photon color of instanced light?

Post by wannabeArtist » 04 Jun 2010, 20:14

Ok,

I must be doing something wrong here.

I made a very simple test scene, with just a cube and a point light and then a point cloud that looks like in the screenshot.
The instance shape instances the point light (from the top level), hierarchy mode is at "object only", out-of-range is clamp and index is 0.

This produces the lights in the corners of the cube, but I still cannot get the attribute color node to show anything but the "use default value" option. I also tested instancing simple geometry and then I get the rest of the options in the drop down menu. Just not with a light!

Strange! Could this be a version thing? I'm using 7.01
You do not have the required permissions to view the files attached to this post.

User avatar
Hirazi Blue
Administrator
Posts: 5113
Joined: 04 Jun 2009, 10:15

Re: Setting photon color of instanced light?

Post by Hirazi Blue » 04 Jun 2010, 20:17

And the size is explicitly set to something > 0?
Stay safe, sane & healthy!

wannabeArtist
Posts: 98
Joined: 10 Jun 2009, 06:34
Location: Finland

Re: Setting photon color of instanced light?

Post by wannabeArtist » 04 Jun 2010, 20:31

Right, the size is also above zero.

It also seems that the instance shape node is pretty picky too, those settings mentioned above are the only ones I have managed to use with lights. They render, but wont let me change the colors (with attribute_color).

grahamef
Posts: 281
Joined: 23 Jun 2009, 19:01

Re: Setting photon color of instanced light?

Post by grahamef » 04 Jun 2010, 22:18

wannabeArtist wrote:Strange! Could this be a version thing? I'm using 7.01
If I recall correctly, using the color attribute with instanced lights didn't work in v7. It was added later (but off the top of my head I don't remember when).

However, what Stephen is doing in the tree that he shows on his is adding differently coloured lights to a group, and picking the group members randomly to use as the instance shape. Would that workaround be useful for you?

wannabeArtist
Posts: 98
Joined: 10 Jun 2009, 06:34
Location: Finland

Re: Setting photon color of instanced light?

Post by wannabeArtist » 05 Jun 2010, 06:21

Good morning,

Darn, if it's really missing from 7.01, then that settles it.

I'm afraid the workaround wouldn't work in this project either. It is a fire simulation and I was hoping to control the light color by particle color, or in fact, the temperature of the light.

I think I'm reverting back to plan A and doing this with FG instead. Of course, I'm still very interested in hearing suggestions to make the photon idea work.

One thing that I was wondering myself was if there is a way of casting the "particle shape" into the object it instances? Like you would do in many traditional programming languages.

something like this (in fictional pseudo code):

Code: Select all

for(int i=0; i < particles.getCount(); i++)
{
   LightSource light = (LightSource)myParticles[i]; 
   // do stuff to light's attributes here
}

User avatar
Hirazi Blue
Administrator
Posts: 5113
Joined: 04 Jun 2009, 10:15

Re: Setting photon color of instanced light?

Post by Hirazi Blue » 05 Jun 2010, 07:34

Sorry for leading you on the wrong track... 8-}
I mistakenly assumed this was something 7.01 could do also & I couldn't remember either, when it was introduced... :ymblushing:

Do the other attribute shaders work with instance lights?
If so, you might be able to "fake" it using custom attributes for RGB and mixing them back together in the Rendertree...
Stay safe, sane & healthy!

wannabeArtist
Posts: 98
Joined: 10 Jun 2009, 06:34
Location: Finland

Re: Setting photon color of instanced light?

Post by wannabeArtist » 05 Jun 2010, 07:41

No matter,

I'm almost sure there would be a way to do this, if I weren't such a newbie with ICE :)

wannabeArtist
Posts: 98
Joined: 10 Jun 2009, 06:34
Location: Finland

Re: Setting photon color of instanced light?

Post by wannabeArtist » 05 Jun 2010, 09:51

Just another idea: Is there a way in the render tree to "pipe" color from another material?

This way I could get the color for the lights from a regular object, which in turn gets the color from the particles...