0
点赞
收藏
分享

微信扫一扫

Unity Shader(表面着色器Surface Shader)

小安子啊 2022-02-14 阅读 59

基本数据类型

float32位浮点数

float2——float2(float,float)

float3——float3(float,float,float)

float4——float4(float,float,float,float)

half16位浮点数

half2——half2(half,half)

half3——half3(half,half,half)

half4——half4(half,half,half,half)

int32位整型

int2——int2(int,int)

int3——int3(int,int,int)

int4——int4(int,int,int,int)

fixed12位定点数

取值范围0-1之间的小数,或整数

bool布尔值
string字符串
sampler2D纹理对象

编译指令

CGPROGRAM(开头)

#pragma surface surfaceFunction lightModel[optionalparams]

||

#pragma surface surf Lambert

surfaceFunction函数名称

lightModel光照类型———Lambert漫反射

void surf(Input IN,inout SurfaceOutput o)

ENDCG(结尾)
举报

相关推荐

0 条评论