RampDiffuse纠错——Error:incorrect number of arguments to numeric-type constructor
Posted 御雪妃舞
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了RampDiffuse纠错——Error:incorrect number of arguments to numeric-type constructor相关的知识,希望对你有一定的参考价值。
看着Shaders and Effects Cookbook的书籍学习shader,照着说上写ramp Diffuse这个shader时,报了个错。
Shader书上的源代码是这样的:
画红线的那一行报了这样的一个错:
最终正确代码如下:
猜测原因是旧版的unity支持的是float2(diff)支持,新版的是float2(param1,param2)
有更详细的解释的可以说明,欢迎交流
![](https://image.cha138.com/20220418/035fb50c97a64a008fa0154276e7464d.jpg)
![](https://image.cha138.com/20220418/852a8ad681794364a0562e6917519ecc.jpg)
以上是关于RampDiffuse纠错——Error:incorrect number of arguments to numeric-type constructor的主要内容,如果未能解决你的问题,请参考以下文章