naelstrof / UnityJigglePhysics

A unity addon for adding stretchy bouncy physics to bones and meshes.
MIT License
281 stars 33 forks source link

Cannot find amplify shader node #5

Closed AlienPolygon closed 2 years ago

AlienPolygon commented 2 years ago

Hello, I've tried installing this with package manager, and downloading/extracting the project, but am not able to add the included amplify shader node. I also do not see it when searching the project.

naelstrof commented 2 years ago

The amplify shader node asset is here: https://github.com/naelstrof/UnityJigglePhysics/blob/main/Assets/JigglePhysics/Shaders/JigglePhysicsSoftbody.asset

I think Unity by default hides assets that are within a Package directory. I don't think ASE cares and it should show up when you go to add a new node within their editor, image though searching it within the Project tab would require you to click on "In Packages". image

AlienPolygon commented 2 years ago

Thank you for the reply, Is this not compatible with the standard shader graph editor then? It seems to be the case.

naelstrof commented 2 years ago

Thank you for the reply, Is this not compatible with the standard shader graph editor then? It seems to be the case.

It was not, though I've just made it so it is supported. image

Simply use the included JigglePhysicsSoftbodyShaderGraph.hlsl include as a node in your graph. It should work in HDRP and URP shader graphs.

naelstrof commented 2 years ago

Well I'd consider this issue resolved, let me know if this works for you!

AlienPolygon commented 2 years ago

I haven't had time to get it working. It looks like the shader is affecting the whole mesh rather than the areas I vertex painted. I haven't setup the jiggle bones yet, would that be the issue? I'm assuming the scripts need attached to the bone related to the jiggle areas. Is there more to it than that?

Also my shader node is a bit different. I'll screenshot it when I get a chance to work on it. Apologies for the trouble.

On Thu, Nov 11, 2021, 00:32 Dalton Nell @.***> wrote:

Well I'd consider this issue resolved, let me know if this works for you!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/naelstrof/UnityJigglePhysics/issues/5#issuecomment-966028965, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJTCVY5KPVBSTOTY7TX6Z4DULNPQ3ANCNFSM5HVLLQSA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

naelstrof commented 2 years ago

I haven't had time to get it working. It looks like the shader is affecting the whole mesh rather than the areas I vertex painted. I haven't setup the jiggle bones yet, would that be the issue? I'm assuming the scripts need attached to the bone related to the jiggle areas. Is there more to it than that? Also my shader node is a bit different. I'll screenshot it when I get a chance to work on it. Apologies for the trouble. On Thu, Nov 11, 2021, 00:32 Dalton Nell @.***> wrote: Well I'd consider this issue resolved, let me know if this works for you! — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#5 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJTCVY5KPVBSTOTY7TX6Z4DULNPQ3ANCNFSM5HVLLQSA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Make sure to set the alpha of the color mask to 0, it counts as a mask input.

AlienPolygon commented 2 years ago

It looks as though Blender 2.93.5 does not support adding alpha channels to vertex colors. I'll look into this further.

blender alpha vertex
AlienPolygon commented 2 years ago

For any blender users with the same issue, you can use a paint mode 'add/erase alpha' (from the above screenshot the 'mix' dropdown), though green doesn't work for some reason, I mixed Red 1 + Blue 1 to replace green... https://blenderartists.org/t/how-do-you-use-the-alpha-channel-of-vertex-colors/1166252/2

My shader seems to be affecting the whole mesh still. I've set the jiggle verts to alpha zero (transparent) with the related color. I have also set the entire mesh's vertex transparency to zero, just to rule that out. I think the issue is with my shader setup.

My shader graph for reference, I was not able to find the vertex and fragment nodes shown in yours. image

AlienPolygon commented 2 years ago

My position node was set to world instead of object.

AlienPolygon commented 2 years ago

Thank you for all of your help @naelstrof, I really appreciate it

naelstrof commented 2 years ago

Yeah! Glad it works, and for future reference, I just meant you should generally set the alpha to 0 in the color masks on the monobehaviour: image

I would also recommend using Vertex Color Master, it supports alpha channels as well as it's capable of transferring vertex groups to color channels-- which prevents edges from splitting.