Unity Shader 屬性的定義
什么是材質(zhì)球
人的衣服
什么是shader
決定材質(zhì)跟燈光的作用
Property
若是把shader看作class,那么Property就可以看成成員變量
屬性定義的通用格式
Properites{
Property[Property…]
}
ep:定義一個(gè)int:
name("dispaly name",Int)=number
_TestInt("Test int",Int)=1
//限制范圍
_TestFloat("TestFloat",Range(1,5))=2
name:變量的名字,正常以下劃線(xiàn)開(kāi)頭
display name: 供外界使用的參考說(shuō)明,顯示在unity的屬性頁(yè)
number:表示默認(rèn)值
顏色屬性
_TestColor("Color",Color)=(num1,num2,num3,num4)
向量容器
_TestVector("Vector",Vector)=(x,y,z,w)
紋理
MainTex("Texture",2D)="White"{}
white:表示默認(rèn)值
Cube
_TestCube("cubMap",Cube)=""[]
有6個(gè)面的紋理
3D紋理
_Test3D("3D",3D)=""[]
1、只能通過(guò)腳本script去創(chuàng)建,默認(rèn)值一般為空
2、openGL3.0及以上才支持文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-809678.html
3、3D 紋理是位圖圖像,其中包含三維信息,而不是標(biāo)準(zhǔn)的二維信息。 3D 紋理通常用于仿真諸如霧或煙的體積效果,模擬體積 3D 網(wǎng)格,或存儲(chǔ)動(dòng)畫(huà)紋理并在這些動(dòng)畫(huà)紋理之間平滑混合。 在 Unity 項(xiàng)目中,Unity Editor 將 3D 紋理表示為紋理資源文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-809678.html
到了這里,關(guān)于Unity Shader 屬性的定義的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!