急求shader问题,代码死活编不过去,报语法错误!
unity3d吧
全部回复
仅看楼主
level 6
corpus 楼主
已经和官网文档上写的改成一模一样了,还是不行[泪]
#pragma surface surf Lambert finalcolor:mycolor
void mycolor (Input IN, SurfaceOutput o, inout fixed4 color)
{
color *= _ColorTint;
}
只要shader代码里面一加上这个所谓的final color modifier,就报编译失败,Shader error in 'Custum/myshader': syntax error at line XXX
这是啥情况啊?
2015年05月20日 06点05分 1
level 6
corpus 楼主
报错的行号就是void mycolor (Input IN, SurfaceOutput o, inout fixed4 color) 这行
2015年05月20日 06点05分 2
level 6
corpus 楼主
函数都改成空的还是不行
2015年05月20日 06点05分 3
level 6
corpus 楼主
放弃了lighting + surface shader的做法了,还是老老实实直接vs ps了。
2015年05月20日 09点05分 4
level 12
全部代码贴上
2015年05月20日 09点05分 5
额,原来的那个已经删掉了,后来完全自己重写shader就好了。没用上那个final color modifier.
2015年05月20日 09点05分
1