Jump to content
Sign in to follow this  
underdog

parenting light to crowd agents

Recommended Posts

hi all,

i have to put torches to my crowd agents hands then i want to put a light to them as they walking. 

what would be the possible approach for this purpose? 

 

thanks.

Share this post


Link to post
Share on other sites

so i guess my question didnt make any sense to you guys. maybe i should ask as, how can i parent a point light to an animated point? i hope it makes sense.

Share this post


Link to post
Share on other sites

May be some clue here :

 

 

Share this post


Link to post
Share on other sites
Posted (edited)

I don't think parenting a light is going to be effective in a crowd situation. Maybe if your agent count is low, less than twenty? The Rivet can be used for that. What you might want to consider is making a group out of certain primitives on the agent mesh, then generate a single mesh from all the agents, delete all the primitives except that group. Use the result as a meshlight, if your render system supports that. Another approach might be to use that same group, but apply an emissive material instead of a true light. That can lead to noisy final images or long render times, though.

Edited by Atom

Share this post


Link to post
Share on other sites

have a look at this post: https://www.sidefx.com/forum/topic/57112/

 

it's possible to get the position of an agent's bone with vex. Then I believe you can use the instance lop to instance your lights into place.

  • Like 1

Share this post


Link to post
Share on other sites

an even easier way would be to use an agent unpack set to "joints". The points will have orient attributes and you can use that to position your lights.

In the attached example I've added put a tube in my agents hand using as copy to points, it should give you some ideas.

agent_unpack_joints_v1.hip

Share this post


Link to post
Share on other sites
Posted (edited)

Here is an extension to Doc's scene to include multiple agents with the end of the torch turned into a meshlight.

The active radius is set to 2 to demonstrate the area affected by each portion of the single mesh light. Disable this checkbox for a more global illumination type effect.

Untitled-1.jpg

 

Here is an image with active radius disabled.

crowd_holds_light.thumb.jpg.813cdcfad3bdd7b675a181f46437cb0b.jpg

ap_agent_unpack_joints_v1.hiplc

Edited by Atom

Share this post


Link to post
Share on other sites

Or lops? I wager its all a bit bleeding edge, so you'd wanna test a lot before pushing into production, but this is all the kinda stuff lops is meant to be good at.

lops_crowd_light_in_hand.PNG

lops_crowd_light_simple.PNG

lops_crowd_lights.hip

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Thanks for that alternate setup. It does look like LOPs can't instance more than ten lights, however. When I set the agent count to 72 the transforms for the light icon are instanced, but the rendering of the illumination quits after ten. Maybe there is an override max count somewhere?

crowd_holds_light.jpg

Edited by Atom

Share this post


Link to post
Share on other sites
Posted (edited)

hmmm... I just gave it a try. seems to be working with my example, 50 lights. Although there does seem to be a limit to what can be displayed in opengl

lops_crowd_lights_doc_v2.hip

crowd_lights.jpg

Edited by doc
  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Ah, it's the quality under the Display options. The default normal lighting seems to be fixed at 10 and ignores max count.

solaris_lights.gif

Edited by Atom

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×