Jump to content


Photo

Fake Global Illumination & Occlusion


  • Please log in to reply
25 replies to this topic

#1 Pinionist

Pinionist

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 79 posts

Posted 17 January 2009 - 04:15 PM

Hey there!

I was wondering this morning if Duplicate3D can duplicate lights. So, yeah, it can :)

Here are the first implementation of this.

Posted Image

Attached Files



#2 tais

tais

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 74 posts

Posted 17 January 2009 - 06:21 PM

Hey there!

I was wondering this morning if Duplicate3D can duplicate lights. So, yeah, it can :)

Here are the first implementation of this.

Posted Image


yes you can spin your light with motion blur too!

#3 Shaelp

Shaelp

    Power Pig

  • Adv Members
  • PipPipPipPip
  • 41 posts

Posted 18 January 2009 - 09:23 AM

wow................ thanks....

#4 Pinionist

Pinionist

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 79 posts

Posted 18 January 2009 - 09:41 AM

yes you can spin your light with motion blur too!


Yeah, but with this technique, you can "see" where the lights are, since you can link duplication with instance to let's say little spheres.

Posted Image

Little bit more polished:

Posted Image

Posted Image

Please post your ideas and examples :)

Attached Files



#5 Pilalitos

Pilalitos

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 791 posts

Posted 18 January 2009 - 02:23 PM

Cool technique and it rendered faster than i thought!

#6 pingking

pingking

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 893 posts

Posted 18 January 2009 - 04:47 PM

now make a script that samples the color values of points on a sphere and set this as the color of the lights at this position :rolleyes:

#7 Pinionist

Pinionist

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 79 posts

Posted 18 January 2009 - 05:40 PM

now make a script that samples the color values of points on a sphere and set this as the color of the lights at this position :rolleyes:


It is quite possible. I don't know a first thing about scripting in Fusion (well I know basics), but here how I think this could be achieved.

Since Fusion is scalar, and resolution independant, you could take any panoramic image (which you would texture your sphere with),
and then transfer color of this panoramic image via probe. Now, for the res- independant part. I think, that by animating movement of
this probe by regular intervals (to scan the pano image), you could end up with a "lighting rig" which seeks color of probe-fed image,
and then because spots are set around the scene by regular intervals by Duplicate3d node already, just set probe-intervals and Dup3d node time offset as well.

Well, works in theory at least, need to check this in reality. But not at 11pm :)

Let me know if you figure out a way.

Remember, there's always a way to do this by using many spots and then taking each spots color via individual probe, but that wouldn't be a elegant solution, i guess.

#8 pingking

pingking

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 893 posts

Posted 19 January 2009 - 04:54 AM

the theory how it will work was clear to me, but the pratical part is the hard one. i'm a little more into scripting, but in this case we have to calculate rectangular to polar coordinates (rectangular image to polar sphere texture) which is atm a bit over my math knowledge. shouldn't be hard to find some formular for this.

#9 nt65

nt65

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 271 posts

Posted 19 January 2009 - 09:04 AM

Pinionist,
Nice find and really looking forward to seeing where this goes.

nick

#10 Attila Sziklai

Attila Sziklai

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 178 posts

Posted 19 January 2009 - 02:26 PM

Hmmm.. what about this.
Connect the probe to your lightColor, move it on an environment using an expression but with a frame step of 0.01 or something like that. Then if you set the timeoffset on the duplicate duplicate nodes to 0.01 then the lights will use the sampled colors.
Didn't see your comp but this should work.

#11 Pinionist

Pinionist

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 79 posts

Posted 19 January 2009 - 04:01 PM

Hmmm.. what about this.
Connect the probe to your lightColor, move it on an environment using an expression but with a frame step of 0.01 or something like that. Then if you set the timeoffset on the duplicate duplicate nodes to 0.01 then the lights will use the sampled colors.
Didn't see your comp but this should work.


That's exactly how I tried to achieve that without using expresions, but the problem is that you're creating animation by doing that. And for a still frame it's basically ok, but when you press play in your timeline - you end up with disco lights :).
I'm thinking that only way to achieve non-flickering image-based lighting rig would be to precisely correlate number of duplicated lights, with number of frame step of probe movement, so that when going from frame to frame, the whole light rig would end up in infinite loop, so no flickering would occur.

#12 Attila Sziklai

Attila Sziklai

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 178 posts

Posted 19 January 2009 - 09:03 PM

I meant something like this:

Attached File  sampledGI.jpg   64.5KB   303 downloads

Needed a more geometric approach for the duplicates but it works.
Made some optimizations also for faster computing.

Have fun!

cheers,
Attila

Attached File  GI_sampledColors.comp   25.43KB   152 downloads

#13 Attila Sziklai

Attila Sziklai

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 178 posts

Posted 20 January 2009 - 04:31 AM

Forgot to mention that you can change the number of copies and of course the environment can be animated since it samples on every fame.

#14 Pinionist

Pinionist

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 79 posts

Posted 20 January 2009 - 05:31 AM

Forgot to mention that you can change the number of copies and of course the environment can be animated since it samples on every fame.


This is some ninja coding skills mate! :ph34r: This is crazy! I still need to figure out what your expression does, but I think we officially went berserk doing this :mf_dribble:
Now we need to make macro out of it :)

Thanks a lot for help, really appreciate such team work!

#15 Attila Sziklai

Attila Sziklai

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 178 posts

Posted 20 January 2009 - 05:53 AM

You're welcome!
If you have any questions about the expressions, feel free to ask.
I've made the code that the only attributes you have to set is the number of copies in Y; X and the time offset to "store" the sample increments. So if you have more than 99 samples 0.01 won't be enough small amount maybe the default should be 0.001.
It will automatically calculates the sampled positions of the probe and its size too. Also the intensity of the lights. Opps that reminds me that I didn't add a value to multiplies the intensity. There is a simple expression on the lightSource begining with a number. You have to change that to a variable ;)
The little spiral rotation adjustment on the first duplicate is to maintain the offset difference caused by the expression on the X position of the probe.
To see what it exactly does type 0.01 multiplies in the frame number on timeline (0.01; 0.02...0.16 etc.) and see how changes the position of the probe.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users