Page 1 of 1

how do I set the opacity on a texture?

PostPosted: Thu Nov 23, 2017 2:53 pm
by sandbucket
Hi guys,

I'm pretty new to this and I'm getting the hang of the interface,

I wanted to know if there is a way to get a texture to be transparent over another texture?
I am trying to simulate a flowing sand effect.

This is without the waves: https://i.imgur.com/tTx5h9F.png
This is with the waves (animated): https://i.imgur.com/aoa7t46.png
This is where the waves texture is located: https://i.imgur.com/MyORO3C.png

I'm trying to get the waves texture to have like around 25% opacity, I'm not sure how to change the alpha channels.
Let me know is this is possible and thanks!

Edit:
I also wanted to know if I can change the overall color of the waves to white through the Amplify Shader Editor? with the opacity in place.

Re: how do I set the opacity on a texture?

PostPosted: Thu Nov 23, 2017 3:22 pm
by Amplify_Borba
Hello!

In order for us to best help you, would you be able to share your shader or a screenshot encompassing all its nodes?

If you want to blend two textures, you may use the lerp node for that effect, and to apply tint you can use the multiply node, although we'd recommend considering having and using a separate grayscale texture for the intended effect.

Looking forward to your reply!

Re: how do I set the opacity on a texture?

PostPosted: Thu Nov 23, 2017 4:04 pm
by sandbucket
Hi Borba!

This is my entire shader for the wave effect: https://i.imgur.com/pqRJAGE.png

I'll try that lerp node out and report back on this post if I got it to work.

Edit: I don't necessarily want to blend two textures, but rather have a main texture, and another texture on top with a low opacity.

Edit Edit: hmm.. i see the lerp node has an alpha input, maybe if I use a float on that to control it.

Re: how do I set the opacity on a texture?

PostPosted: Thu Nov 23, 2017 4:25 pm
by sandbucket
I think I got it, but is there anyway to create a deadzone on the texture where the waves dont hit?

I have rocks built into the ground texture and the waves are going over the rocks, how would I make the animation ignore a certain part of the texture? Let me know if this is possible and thanks!

Re: how do I set the opacity on a texture?

PostPosted: Thu Nov 23, 2017 4:57 pm
by Amplify_Borba
As per your shader sample, you could achieve that effect by multiplying the emission with a mask, which would contain the ground in white and the rocks in black so that they would be ignored.

This operation would have to be introduced right between the emission input and its last connected node.

Please let us know if this helps you achieve your intended result, thanks!

Re: how do I set the opacity on a texture?

PostPosted: Thu Nov 23, 2017 8:08 pm
by sandbucket
Hey Borba,

It works smoothly :D thanks!

Re: how do I set the opacity on a texture?

PostPosted: Fri Nov 24, 2017 11:06 am
by Amplify_Borba
No worries, glad to be of assistance!

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 or if you would like us to help promote your project once it is released, thanks!