Normal dir. node equivalent ?

Node-based Shader Editor

Normal dir. node equivalent ?

Postby yaos01 » Fri Apr 20, 2018 3:25 pm

Hello everyone
I used to use Shaderforge for my shaders but switched to Amplify because of their update.
I'm making a shader that puts sand at the bottom of an object. I used to be able to use the "Normal Dir." node and I can't find an equivalence in the Amplify nodes. Anyone have a solution?

The only thing I managed to do for now is put sand at the bottom of the object, but only if his Y position is 0. Normal Dir. used to allow me to find the position of the object as well.
yaos01
 
Posts: 7
Joined: Fri Apr 20, 2018 3:21 pm

Re: Normal dir. node equivalent ?

Postby Amplify_Borba » Fri Apr 20, 2018 3:47 pm

Hello, thank you for getting in touch and for your support!

I believe the node you're looking for is the World Normal. We also provide a sample that makes use of this node that you can check out, which should also serve as a good starting point for the effect you're creating, you can find it at AmplifyShaderEditor > Examples > Official > SnowAccum.

Please let me know if this helps, thanks!
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: Normal dir. node equivalent ?

Postby yaos01 » Fri Apr 20, 2018 4:17 pm

Thanks for your fast answer!
Unfortunately I can't seems to make the world normal node work, maybe I don't get it.

This is the part of my shader right now that is causing me confusion

https://gyazo.com/b2b8ec9fa3d775f5ba444828f2cdf1c6

For now the shader works with the sand gradient, I can turn the object around and the sand stay in the Y axis.
The problem is that it only works if the object have 0 as Y position. If I elevate the props, the sand stays at 0 and eventually vanishes.
My goal is to make a shader that have a gradient follow the rock on the Y axis, but I have no idea how to do just that.

I attached a picture of the effect it's doing right now (diffuse only)
https://gyazo.com/f5112ff58707e6379ca1f8ab21824151
yaos01
 
Posts: 7
Joined: Fri Apr 20, 2018 3:21 pm

Re: Normal dir. node equivalent ?

Postby Amplify_Borba » Fri Apr 20, 2018 4:46 pm

Did you have the chance to check out our SnowAccum sample, mentioned in my previous post?

I've edited the shader so that it uses sand instead of snow, and so that the accumulation begins from an inverted Y axis, negative to positive gradient, in order to accommodate to the effect you want to create, for your convenience:

SandAccum.unitypackage
(29.69 KiB) Downloaded 117 times


Do note that the above shader's purpose is simply to serve as an example and starting point.

Let me know if you have any further questions regarding the effect or any node, thanks!
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: Normal dir. node equivalent ?

Postby yaos01 » Sat Apr 21, 2018 9:45 am

Hey!
Thanks for your answers again, as well as your shader, it's really helpful. I might use that effect in the shader to bring some variety.
It still a bit too sparse for the effect I want to use, a regular gradient from the bottom object.

The shader "PositionCutOff" do exactly what I wish for my shader, except for one thing. when I change the translate the object in the Y axis, the gradient doesn"t follow the props. (following screenshot show this https://gyazo.com/b57c7dffc248b6b9a7bf7b318c121ae5)
I think it could be done by getting the Y translate of the item to add to the world position of the gradient, but I'm having trouble figuring out how.

Thanks a lot!
yaos01
 
Posts: 7
Joined: Fri Apr 20, 2018 3:21 pm

Re: Normal dir. node equivalent ?

Postby Amplify_Borba » Mon Apr 23, 2018 9:54 am

No problem, always glad to help!

The World Position is usually used for static object's effects since it will retrieve the true world position of each point in the surface of an object. If you intend for the effect to "stay" on the object and follow it, you need to use the Vertex Position node instead as its data is extracted directly from the mesh and contains the vertex position relative to the object origin, meaning that the effect will be bound to the object and stay exactly the same even if it changes position, rotation or size.

Please let me know if this helps, thanks!
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: Normal dir. node equivalent ?

Postby yaos01 » Thu Apr 26, 2018 8:28 am

Thanks for the help, I will find a compromise!
yaos01
 
Posts: 7
Joined: Fri Apr 20, 2018 3:21 pm

Re: Normal dir. node equivalent ?

Postby Amplify_Borba » Thu Apr 26, 2018 9:35 am

Happy to help!

Have you had the chance to rate and review Amplify Shader Editor? It would be awesome if you could share your experience with the Unity community, the Unity Asset Store thrives on user interaction and direct feedback.
Every bit helps, your feedback is extremely valuable to us!

Feel free to get back in touch if you have further questions, thanks!
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

cron