Screenspace pattern gradient on object.

Node-based Shader Editor
Post Reply
Gallahalt
Posts: 2
Joined: Mon Dec 04, 2017 2:37 pm

Screenspace pattern gradient on object.

Post by Gallahalt »

Hey, I'm having issues masking a screenspace pattern using a gradient from the bottom of a mesh to the top. I've successfully worked out how to get my pattern into screenspace using the provided "Screenspace Detail" example, but I have no idea how to go about masking it to specific areas of a mesh.

This is my first time playing around with shaders and Amplify, so I'm pretty confused. Thanks for any help you guys can offer.
User avatar
Amplify_Borba
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Screenspace pattern gradient on object.

Post by Amplify_Borba »

Hello Gallahalt, thank you for getting in touch!

Would it be possible for you to provide some additional details and an example of the type of effect you're trying to achieve, so that we may best help you?

Looking forward to your reply.
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!
Gallahalt
Posts: 2
Joined: Mon Dec 04, 2017 2:37 pm

Re: Screenspace pattern gradient on object.

Post by Gallahalt »

Thanks for the reply! I'm not at the computer I attempted the shader on right now so I'll try to illustrate what I'd like to achieve with some images I got off of google. I couldn't find an exact working example of what I wanted, but I think I can explain it well enough.

Image

(Ignore the mesh outline)

So I managed to succesfully get my texture into screenspace and tiling over my character, but I'd like to restrain it to a gradient that's based on the Mesh's height. So the bottom of the mesh would be white and the top would be black, so that the screenspace texture is restrained to only the lowest parts of the mesh.

I was attempting to use the Y value of the vertex position to do this, but I got pretty confused and don't quite understand the concepts behind it yet.

hopefully this makes more sense.
User avatar
Amplify_Borba
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Screenspace pattern gradient on object.

Post by Amplify_Borba »

You could possibly use the Vertex Position node's Y coordinates together with a Smoothstep node to control the resulting gradient's intensity and positioning.

I've attached both a screenshot and a simple shader sample for your convenience, please let us know if this helps you out, thanks!
ScreenPositionBlend.zip
(1.64 KiB) Downloaded 361 times
ScreenPositionBlend.jpg
ScreenPositionBlend.jpg (181.06 KiB) Viewed 3389 times
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!
Post Reply