Monday, December 4, 2023
HomeVisual EffectsUnity, particle system with velocity alignment + vertex offset

Unity, particle system with velocity alignment + vertex offset


Hello everybody.
Has anybody tried to create faculty of fish? It’s easy process in Unity: commonplace particle system + mesh + velocity.
wings_line_8
And possibly lots of us used vertex offset by shader. The only node-tree is:

I’ve tried totally different parameters, totally different nodes combos to create faculty of fish with vertex offset, however every time I had the identical, or worse then earlier outcomes…
wings_line_7

Shader works appropriately on static mesh, however particle system change vertexes positions by the identical axes (in instance it’s X). I discovered that particle pivots have the identical XYZ orientation.

So technically shader works appropriate, it modified vertex place by particle pivot, which isn’t the identical object pivot.
I attempted to discovered faculty of fish in PC video games… however every sport confirmed me the identical: floated log.

Is it potential to understand faculty of fish, every fish adjustments the route by velocity, and vertex place adjustments by object pivot orientation?




1 Like

Possibly there are simpler methods however I might count on utilizing the customized vertex stream velocity may provide help to. There’s a thread about this!

Since particles that use velocity alignment don’t orient itself utilizing 3d rotations, you may as an alternative use the rate vector as your relative fish orientation pivot if that is sensible? :fish:
There may be most probably somewhat bit sorcery concerned in creating this kind shader so please share your progress :slight_smile: I’m curious!

thx for the hyperlink, however I’ve already learn and rebuilt the shader… consequence the identical (((

The workflow within the hyperlink must be tailored and utilized to you shader’s vertex offsets in a different way than mentioned within the thread. The precise implementation I can’t inform you with out making an attempt to determine it out on my own

Principally your vertex remodel is in world house. So and not using a rotational offset, the animation gained’t work. Usually the very best method for that is to again a vertex animation in native house for the mesh, after which play that animation within the shader as a lot of the nodes obligatory often begin from the belief that you’re in native house.
I’ve by no means had a lot luck with procedural animation for the swimming of the fish, however flocking is nice.
One other factor you’ll wish to do is to construct in an averaging system between frames in order that they’ve a most angular velocity. This could assist with the flip-popping.
With out your graph I can solely say this, “I hope you’re working in quaternions” as a result of gimbal lock is gonna kick your ass each time.



1 Like

Ah cool, appears such as you solved the vertex animation situation, nonetheless utilizing the sine curve?
Within the answer I’m utilizing on the present challenge, there’s a RotateAboutAxis node, additionally present in Unreal. Fairly useful fella:



3 Likes

Sorry for my lengthy reply, however I’ve some issues with new Unity 2018.3 and ShaderForge. So I’ll present the node tree as quickly as I made it on Amplify or ShaderGraph

Cool, Are you able to share your settings?? I received identical situation

Hello, i’m additionally presently making an attempt to do a really comparable factor with butterflies flapping. Any assist or node sharing could be drastically appreciated

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments