臨摹乙個畫素風格高樓shader

2021-09-08 13:06:48 字數 973 閱讀 1900

是乙個的城市高樓感的shader,比較畫素風

可以拿來做遊戲背景,或者基於這個思路做一些別的效果

這個是我後來找的版本,因為最早那個版本沒存,所以大體上有些區別。

下面開始分解這個的做法

大體思路是用一種噪波作為因子,可以是sin,cos或者別的。然後用floor把他轉成int形。這樣生成出來的圖案就是方塊

最後加一層迴圈來做到層疊效果

step1.用sin作為因子,加上簡單的時間偏移

step2.將值轉為int從而變成方形

step3.然後加上for迴圈,帶入索引,做出縱深

fixed4 frag (v2f i) : sv_target

return fixed4(a, a, a, 1.0

);}

到上面那一步基本上就可以了,下面是我的版本:

進擊吧shader 寫乙個自己的shader

cg語言基礎 我們來嘗試寫乙個自己的shader shader custom textshader subshader lighting on 開啟燈光 如果想讓material 塊起作用,那麼就需要使用lighting on,如果是off,那麼顏色將會從color命令中獲取 在屬性中設定的變數可以...

乙個C 風格的C 程式

寫c 程式就是在設計乙個類!先看乙個c 程式 表示式求值 using system using system.collections.generic using system.linq using system.text public static char precede char a,char ...

乙個C 風格的C 程式

寫c 程式就是在設計乙個類!先看乙個c 程式 表示式求值 csharp using system using system.collections.generic using system.linq using system.text namespace consoleapplicationcal ...