Unity Shader Graph - 遵循对象形状的 Grandient [英] Unity Shader Graph - Grandient following the object shape

查看:35
本文介绍了Unity Shader Graph - 遵循对象形状的 Grandient的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习 unity,而且我对着色器很陌生.我正在做很多教程并且已经做了一些事情,但是我有一个我无法解决的问题.我的问题是我想(如果可能的话)使渐变(或纹理、材质等)跟随对象的形状.我有一个 cilinder,我可以在其中控制渐变的位置、展开等.但是当对象有一些曲线时,它会像这样填充:

I'm learning unity and I'm very new to shaders. I'm doing a lot of tutorials and already did some things, but I have a problem that I'm not able to solve. The problem I have is that I want (if it's possible) to make a gradient (or a texture, material, etc.) follow the object shape. I have a cilinder where I can control the position of the gradient, the spread, etc. But when the object have some curves it fills like this:

我有什么

但是我在这种情况下是什么,grandient,采取对象的形状,像这样填充:

But I what that the grandient in this case, takes the shape of the object, filling like this:

我想要的

这可能吗?如何?有这个要搜索的正确名称吗?(对不起,英语不是我的母语).

It's that possible? How? Have this a correct name to search for? (I'm sorry, English is not my mother tongue).

这是我正在使用的当前着色器图:当前着色器图

This is the current shader graph I'm using: Current Shader Graph

提前致谢,感谢您的帮助.

Thanks in advance, any help is appreciated.

推荐答案

根据职位做你想做的事是不可能的.您需要 UV 映射.

it's impossible to do what you want based on position. You need UV mapping.

这篇关于Unity Shader Graph - 遵循对象形状的 Grandient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆