How can I get a particle facing vector?

Node-based Shader Editor

How can I get a particle facing vector?

Postby DuvE » Wed Jan 31, 2018 6:53 am

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.
Attachments
CASE06.unitypackage
(16.03 KiB) Downloaded 100 times
DuvE
 
Posts: 43
Joined: Thu Nov 23, 2017 6:46 pm

Re: How can I get a particle facing vector?

Postby Amplify_Borba » Wed Jan 31, 2018 2:35 pm

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.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: How can I get a particle facing vector?

Postby DuvE » Wed Jan 31, 2018 3:38 pm

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 :(
DuvE
 
Posts: 43
Joined: Thu Nov 23, 2017 6:46 pm

Re: How can I get a particle facing vector?

Postby Amplify_Borba » Wed Jan 31, 2018 4:28 pm

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!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 0 guests