Jump to content

Emitting particles from texture


phong

Recommended Posts

Hi!

I'm emtting particles from a texture using the pic() expression and have two questions concerning this approach.

1. Emission distribution seems to be dependent on primitive attributes which makes one require a relatively highresolution geometry to be able to represent the emissionmap with all it's details. Is there any way to tell the source node to check in the image itself what value it has at that position instead of looking it up in the primitive variables?

2. When using texture lookups via pic() emission gets INCREDIBLY slow. Takes a few minutes to cook 24 frames. Is there any way to improve this?

Thanks a lot,

Phong

Link to comment
Share on other sites

Hey,

I've also found that using the pic() expression gets frustratingly slow. Have you tried using a vopsop to transfer the texture to the geometry? It's usually much much faster so unless there's any particular reason for using the pic() expression then I'd definitely suggest going with vops.

Hip file attatched :)*

*below

Edited by jujoje
Link to comment
Share on other sites

The file!

Cool, this is about a MILLION times faster than the pic() expression! The tex() expression is kinda fast too, but for some reason doesn't display the images correctly.

But how do I use this to control emission precisely now? I could promote the Cd attribute to pipe it into distribution, but then I'd have to rely on primitive attributes which requires an insanely high resolution geometry right?

Cheers,

Phong

Link to comment
Share on other sites

To be honest I'm not entirely sure how your going to avoid using some pretty high resolution geometry, as the accuracy is reliant on mesh resolution.

Rather than promoting the attributes from point to primitive and then using them as an area map in the pop network, you could just use a colour channel (e.g. $CR) in the birth probability of the pop networks source node. This should be a bit faster than having to promote the attributes, and should give you a bit more detail. I gave it a quick go on a 200x200 mesh and seemed pretty responsive.

So unfortunately not really a solution, but hopefully should speed it up a fair bit. I'd be interested to know if you find a faster way of doing it.

color_vopsop_cr.hipnc

Link to comment
Share on other sites

Cool, it works pretty good now, although having a high resolution mesh is not really practical if there are dozens of emitting surfaces.. but with a lot of baking that should work!

A different question, I know that in DOPs I can define a volume for a force to attenuate, is there anything like it in POPs or do I have to use a switch and expressions?

Thanks man! You've been a big help to me!

Phong

Link to comment
Share on other sites

Just tried emission with distribution attribute 'area'. Didn't work, no particles get emitted when I pipe in a custom color map into the 'area' parameter in VOPs and promote it to primitive attribute in SOPs. If I set it to 1 instead emission works fine but over the entire geometry.

Link to comment
Share on other sites

I usually give the popnet a set of points to emit from if I want to control the emission like that. Using a set of points scattered on a geometry is really useful if you effect needs to be mesh res. independent.

like: your geo > scatter > texture lookup > delete points you don't want to emit from.

Then in the popnet just emit from points ordered and set the impulse birth amount to $NPT.

I can make an example scene if I didn't make any sense ...

Link to comment
Share on other sites

That makes sense indeed! How is the performance if the whole surface is covered with scattered points? Wouldn't that be slower than using a highRes mesh because there are more points than vertices required for a highRes geometry?

Phong

Link to comment
Share on other sites

I have kinda been assuming that it is faster since there is a lot less data in a point cloud, a mesh would have all of the connectivity data and stuff. Also the scattered positions are going to have to be generated in the popnet anyway ...

For optimisation you could lookup the texture on the low res mesh and delete parts of the mesh before scattering.

Link to comment
Share on other sites

  • 1 month later...

Hey guys,

awesome topic :)

I just have a question:

How do I use animated texture in texture lookup VOP?

Thanks a lot

ok sorry - figured out that :)

if somebody is wondering one of the ways to do that is to create a detail string attribute (frame based file path) in SOP level on the object you are connecting to the VOP SOP and then import this as a parameter in VOP level. ;)

cheers

Link to comment
Share on other sites

  • 2 years later...

Hey,

I've also found that using the pic() expression gets frustratingly slow. Have you tried using a vopsop to transfer the texture to the geometry? It's usually much much faster so unless there's any particular reason for using the pic() expression then I'd definitely suggest going with vops.

Hip file attatched smile.gif*

*below

I've noticed that in taking the VOPSOP route the colormap node is used. But what if an image sequence is needed? the colormap node seems to generate an 'time-dependent' error. Is there a way to circumvent this?

EDIT: answered above... (what a dork I am)

Edited by faulknermano
Link to comment
Share on other sites

  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...