Untiy ShaderLab 隨手記錄

2022-06-18 09:54:16 字數 896 閱讀 7858

shader "nafio/tunlit"

} subshader

lod 150

pass;

struct v2f;

fixed4 frag(v2f i):sv_target

endcg

} }}

_maintex_st 的說明,這個變數是後面transform_tex需要用到

transform_tex用於計算texture uv偏移量(就是編輯器中設定的偏移量)

實現方式

#define transform_tex(tex,name) (tex.xy * name##_st.xy + name##_st.zw)
材質中

這裡tiling控制縮放

而offset控制起始位置

從公式看name##_st.xy對應tiling,name##_st.zw對應offset

Linux Vim 隨用隨學隨記錄

一般模式 複製 yy 游標向上 k,10k 向上10行 游標向下 j,10j 向下10行 游標向左 h,5h 向前5行 游標向右 l,5l 向後5行 向下翻半頁 ctrl d ctrl down 向上翻半頁 ctrl u ctrl up 整頁上翻 ctrl d ctrl down 向上翻半頁 ctr...

RandomStringUtils生成隨機數

org.apache.commons.lang.randomstringutils 產生5位長度的隨機字串,中文環境下是亂碼 randomstringutils.random 5 使用指定的字元生成5位長度的隨機字串 randomstringutils.random 5,new char 生成指定長...

RandomStringUtils生成隨機數

org.apache.commons.lang.randomstringutils 產生5位長度的隨機字串,中文環境下是亂碼 randomstringutils.random 5 使用指定的字元生成5位長度的隨機字串 randomstringutils.random 5,new char 生成指定長...