简体   繁体   中英

Horizontal gradient over image in Unity?

I'm trying to have the sides of an image fade to black, but I can't find a good way to do this manually or in any way other than with a shader graph. I'm looking to apply an effect like this:
在此处输入图像描述

to an existing image, but the gradient in the shader graph applies the same color to the whole texture. I'm very new to shaders, so any help would be great. Thanks!

Using Shader Graph you create a gradient example then you add a Texture2D input, use a Texture 2D sampler node and finally combine them with a multiply node.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM