ホログラムなグリッチ - saitocastel1900/UnityShader GitHub Wiki

  • グリッチにホログラムの要素を取り入れてみるグリッチのページ

  • RGBシフト:色差フィルターなのかな?色をずらせる表現らしい

  • ラインの作成の閾値をrandom()にするといい感じでノイズがかかる

 float Line1 = step(_LinePositionY * rand(sin(posterize(_Time.w))), rand(uv.y+_LineWidth))
....

float r = tex2D(_MainTex,uv+_ColorGap*rand(sin(posterize(_Time.w)))).r;
                float b = tex2D(_MainTex,uv-_ColorGap*rand(sin(posterize(_Time.w)))).b;

                float2 ga = tex2D(_MainTex,uv).ga;
                float4 shiftColor = fixed4(r,ga.x,b,ga.y);
                
                return shiftColor;
            }

                float2 uv = i.uv;
                float interpolation = step(frac((uv.y + _Time.z) * _SliceSpace),_FillRatio);
                float4 scanlineColor = lerp(_ScanLineMainColor, _ScanLineSubColor, interpolation);
                
                float Line1 = step(_LinePositionY * rand(sin(posterize(_Time.w))), rand(uv.y+_LineWidth));
                float Line2 = step(_LinePositionY * rand(sin(posterize(_Time.w))) + _LineWidth, uv.y);
                uv.x += saturate(Line1-Line2) * _Deviation * sin(posterize(_Time.w) * _Frequency);
                float4 color = tex2D(_MainTex,uv);

                float r = tex2D(_MainTex,uv+_ColorGap*rand(sin(posterize(_Time.w)))).r;
                float b = tex2D(_MainTex,uv-_ColorGap*rand(sin(posterize(_Time.w)))).b;

                float2 ga = tex2D(_MainTex,uv).ga;
                float4 shiftColor = fixed4(r,ga.x,b,ga.y);
                
                color.a = _Alpha;
                return color * scanlineColor * shiftColor;