Home Technical Talk

Lights as a particle

polycounter lvl 18
Offline / Send Message
Soccerman18 polycounter lvl 18
I know it's possible to use geometry as a particle but is there a way to use a light, such as an omni light, as a particle? Tried using geometry as a light with a material but the result just isn't the same.

And this has nothing to do with light particles but there was a tutorial I saw a while ago where there was a spaceship that came in a hovered in front of a camera and the tutorial was about using dummy objects to control the hovering motion. Anyone remember where that tut was?

Replies

  • Richard Kain
    Offline / Send Message
    Richard Kain polycounter lvl 18
    Light calculations can be fairly costly, in terms of performance, because a light has the potential to affect everything in a scene. Using light sources as particles would probably not be wise. Using a single light source in conjunction with a particle system would be fine, but attempting to use lights AS particle...I'm not so sure that is a good idea. Can you describe exactly what kind of visual effect you are trying to achieve here?
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    I think he's talking about pre-rendered scenes, not real-time stuff, Richard, so performance probably isn't much of an issue.
  • Richard Kain
    Offline / Send Message
    Richard Kain polycounter lvl 18
    Ooooohhhh...yeah, that makes a lot more sense. Hmmm...in that case, it is entirely dependent on the 3D appilcation you are using. I can't really think of any reason why it shouldn't work though. I'm sure some of the other members can help you with 3DS Max. But I'm a Blender man myself.
  • Mark Dygert
    Damn thats a good question, what program are you using Max8-9 Maya?

    I use Max and I can't think of a way since Lights are not valid objects that can be selected when you try and choose objects. Other than using light emitting geometry or lens effects which would be a royal B to use I think you are stuck. I guess you could always hand animate lights to follow particles but that could drive you nuts depending on how many you have.
  • Soccerman18
    Offline / Send Message
    Soccerman18 polycounter lvl 18
    sorry, yea it's for a rendered animation, would be scary to try to get that to work in real time. I'm using Max 8. I don't see why it wouldn't be able to do it, it's all just points in space, shouldn't make a difference if it's geometry or a light or another particle system. It's all just calculations to determine where that point is in that frame.

    The only ways I can think of off hand to have geometry produce light are to use a material with 100% self illumination and use radiocity to calculate the lighting (which won't work since at best it'll only calculate the lighting for one frame) or use the light material in Vray which wasn't quite doing what I was hoping for. Any other ways that might work better?

    The best way I can think of to hand animate them is to make a bunch of splines and have the lights follow them, but you lose the randomness of the motion. Which is why I was looking for that tutorial with the hovering camera but I can't seem to find that to see if that might help.
  • Mark Dygert
    It might help us to help you, if we knew more about what you are trying to do. If you can share more details (I totally understand if you can't) it would be a big help.

    I was thinking about it and you might be able to attach lights to small objects and use Reactor to blow them around. I'm pretty sure that would do what you want and is pretty easy to set up.
  • kakikukeko
    Offline / Send Message
    kakikukeko polycounter lvl 17
    I don't know for max.. if you can attach geometry to a particle, can't you parent a light to a dummy, then clone the hierachy and them attach it/them to particles?
  • Eric Chadwick
    I haven't tried it but Particle Flow sounds like it can do this. You could use a Shape Instance Operator. The help explains it well. Link a light to a dummy, then use that dummy as the geom.
  • Mark Dygert
    It seems the particle system strains out anything that is not geometry. Things I tried:

    - Linked a light to a cube, only the cube came out of the emitter.
    - Grouped the light and the cube and selected the group to come out of the emitter, only the cube came out even though it let me select the group AS the particle, I had high hopes for this one.
    - Linked the light to a dummy, couldn't select the dummy as a valid particle until I linked a cube (geometry) to the dummy, only the cube (geometry) came out.

    It won't let you select anything that is not valid geometry as a particle.

    The problem I think it has with using non geometry as particles is that it need the object to have mesh properties so it can preform things like the MetaParticles and collision where it splits particles into pieces and joins them back together based on their proximity/collision to/with other particles. Particles also have a life span and change shape over time, geometry can, lights and non geometric shapes don't preform like that. It looks like the system is limited to only using geometry.

    Its a case of advanced features limiting the functionality of the tool. Personally I think they need to make a dumb particle emitter, one where lights and shapes can be used but there isn't an option for metaphysics. Or better yet have the particle emitter strain out everything but geometry ONLY when metaphysics is checked on.

    The Shape Instance Operator sounds like it would work but it can only use Reference Objects which must be geometry, all non geometry (lights) are strained out.

    [ QUOTE ]

    Max Reference File:
    Glossary

    Reference Object
    In Particle Flow, a reference object is a geometry object or collection of objects used as particles by the Shape Instance operator. It can be a single object, a group, a hierarchy, or even a compound object consisting of several elements.

    [/ QUOTE ]
    It is meant to help randomize and control what kinds of geometric particles are flying around. It is not designed to help hack non geometric shapes into the particle system =/ Good idea tho =)


    I'm running a few tests with Reactor, it seems to be working. Heres a quick and dirty mini tutorial.
    - Make a cube, attach an omni light, copy it a few times.
    - Make a rigid body collection, Main Menu > Reactor >Create Object > Rigid Body Collection > Click in scene (it doesn't render)
    - With the RB collection selected go to the modify tab add the cubes.
    - Place a wind generator (same as above), or a few. Set its wind to some high number.
    - Select all the cubes open the "open properties window" 4th icon from the right looks like an icon of a drop down menu, in the reactor tool bar. Set their masses to .2 or something nice and light so they blow around rather than sink past the wind.
    - Preview it and see what you get. You can now set the cubes to not render and have just dancing lights.

    I can go into a more step by step if you need it, I don't have time to write up a tutorial today but I could bang something out this weekend IF you need it.

    Here is my test .avi and here is the max file and a screen grab.

    I added volume fog to the scene so the lights where more visible the green glow has nothing to do with reactor.
    Hopefully someday they will combine reactor with the particle system but until then we have to make due =/
  • rube
    Offline / Send Message
    rube polycounter lvl 17
    I don't know if this will work for max particles (I think it work for XSI particles) but here's a mentalray shader that might help...

    http://www.mymentalray.com/mymr_shaders/shaders.htm

    go to 'Ray Control' section and grab ctrl_objectlights, you're on your own to see if it works or not though. There is a small tutorial on there in the "Francesca" section.

    If it does work it will be quick slow though as it won't link a light to your particles but make the particles lights... what you may need to do actually is attach some geometry to the particles for the shader to latch onto.

    rube
  • Mark Dygert
    I'm pretty sure he already tried playing light emitting materials, the problem I think he ran into was that you must use Radiosity to get the material to emit light, it takes a long time to render and works with mostly indoor environments. It can be a pain to get radiosity to work "outside". That shader is built into Max in the "Advanced Lighting Overide" material and can be used with Mental Ray or Scanline render, I think he was playing with first. If he must use the particle system then it might be his only option, but it depends on what the scene is?
  • Soccerman18
    Offline / Send Message
    Soccerman18 polycounter lvl 18
    Sorry I didn't get back to this earlier, been crazy busy on another project and i haven't had much time to play around with this. Not sure how much I can say about the project, but the idea was to try to do something similar to stars, meteors, sparks, all basically moving lights. Those aren't very good examples as they don't provide much in the way of light to the scence (sparks do a little), but lights also have effects like volumetric lighting which are a little difficult to duplicate especially with objects moving in front of the light causing shadows.

    That's really helpful Vig. Seems like reactor is the way to go, doesn't exactly have the control I was hoping for, but it looks like it'd produce something similar to the motion I'm trying to get. Depending on how things go with this other project I've been working on I may have some time to work on this so I'll try to get some pics up.
  • Soccerman18
    Offline / Send Message
    Soccerman18 polycounter lvl 18
    Been playing around with scripts, haven't done any scripting in Max before so I decided to look into it, but here's what I've got going:
    <font class="small">Code:</font><hr /><pre>
    on ChannelsUsed pCont do
    (
    pCont.useTime = true
    pCont.useSpeed = true
    pCont.usePosition = true
    )

    on Init pCont do
    (
    Global objs
    if objs == undefined then objs = #(OmniLight(), OmniLight(), OmniLight(), OmniLight(), OmniLight(), OmniLight(), OmniLight(), OmniLight(), OmniLight(), OmniLight())
    )

    on Proceed pCont do
    (
    count = pCont.NumParticles()

    for i in 1 to count do
    (
    pCont.particleIndex = i
    objs.position = pCont.particlePosition
    )
    )

    on Release pCont do
    (

    )
    </pre><hr />
    Not much to it, and there's a bug in how the lights are made that needs to be worked out still, but it has omni lights following particles.
Sign In or Register to comment.