Page 1 of 1

How can I get a particle facing vector?

PostPosted: Wed Jan 31, 2018 6:53 am
by DuvE
This question is not specific to ASE, but still, I wondering is there a way to get particle facing vector when using Local simulation for both "Simulation Space" and "Render Alignment"?

Sure, I can just set the velocity or speed of particles to 0.000001 and pass "Velocity" stream to the shader, but is there another way to do this?

Check attachments for example case
There is a "Velocity" stream variant used in that case example. But I think there is a better and simpler way to do this. I cannon just plug Vector3 (0,0,1) to the offset because even if particle system in local space, looks like all particle pivots are still in world space.

Re: How can I get a particle facing vector?

PostPosted: Wed Jan 31, 2018 2:35 pm
by Amplify_Borba
DuvE wrote:This question is not specific to ASE, but still, I wondering is there a way to get particle facing vector when using Local simulation for both "Simulation Space" and "Render Alignment"?

Sure, I can just set the velocity or speed of particles to 0.000001 and pass "Velocity" stream to the shader, but is there another way to do this?

Check attachments for example case
There is a "Velocity" stream variant used in that case example. But I think there is a better and simpler way to do this. I cannon just plug Vector3 (0,0,1) to the offset because even if particle system in local space, looks like all particle pivots are still in world space.


Hello DuvE, apologies but I didn't quite understand if you intend to get the direction of the particles regarding the camera or their movement, this seems a bit out of our scope but if you could provide further information on what kind of effect you want to achieve, perhaps through a screenshot or video, we might be able to provide additional insight.

Regarding your sample, I would advise that you use the "Vertex Texcoord" node instead of the "Texture Coordinates", as it provides the texture coordinates directly from vertex data without any further calculations.

Your approach seems to be the correct and most simple way of passing information from Unity's particle system to the shader, however, do take note that the material you're assigning to the particles encompasses the whole system, not the individual particles.

Re: How can I get a particle facing vector?

PostPosted: Wed Jan 31, 2018 3:38 pm
by DuvE
Imagine a flat grid or plane of cube particles, I want to offset them in a shader on Y axis for example. But I also want to rotate this whole particle system and the particles still being displaced by their local Y-axis. There is a correct behavior in the case example, but is it possible to somehow get the correct local coordinates for each particle, but not for whole particle system?

It works for meshes, if I plug a simple Vector3(0,1,0) to the offset, it will offset the mesh on its local Y axis, no matter how I rotate it. But for particles, it won't work.

PS: I just wondering why there is no "Particle facing vector" or something like "world space rotation vector" in vertex streams :(

Re: How can I get a particle facing vector?

PostPosted: Wed Jan 31, 2018 4:28 pm
by Amplify_Borba
Unfortunately, we're not sure how to best help you take advantage of Unity's Particle System since it's outside of ASE's scope and we're frankly not very familiar with it, I kindly advise you to seek further clarifications regarding this feature on the General Graphics section in Unity Forum.

Apologies for the inconvenience, please don't hesitate to get back in touch for any ASE related questions, we'll be glad to assist!