Created
January 14, 2016 16:06
-
-
Save sugi-cho/6b9bf8e5917b85163396 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float2 d = _MainTex_TexelSize.xy; | |
fixed4 c = tex2D(_MainTex, uv);//元のテクスチャ | |
fixed4 o = tex2D(_Overlay, uv/(d*256));//feltのテクスチャが入る。uvが伸びないように調整してる | |
//HSLを調整したかったら使ってもいいけど無視してもいい! | |
float4 hslDelta = lerp(_HSL1, _HSL2, uv2.y); | |
float3 hsl = RGBToHSL(c.rgb); | |
hsl = saturate(hsl + hslDelta); | |
half3 c2 = HSLToRGB(hsl.rgb); | |
c.rgb = lerp(c.rgb, c2.rgb, saturate(1-m.r*2)*hslDelta.a); | |
//ここまで無視する | |
//オーバレイ合成した結果がoに入る。 | |
o = (c < 0.5 ? (2.0 * c * o) : (1.0 - 2.0 * (1.0 - c) * (1.0 - o))); | |
//マスクテクスチャを参照しつつ、元の画像とラープしてる。適当に手を加える必要あり。 | |
c = lerp(c,o,_OLevel+m*m*0.3)*(0.8+m*0.25); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment