<commit_before>﻿Shader "Custom/Gradient"
{
	Properties {
        _Palette ("Texture", 2D) = "white" { }
    }

    SubShader
    {
        Pass
        {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag

            sampler2D _Palette;

            struct vertInput {
        		float4 pos : POSITION;
				float4 color : COLOR0;
    		}; 

            struct vertOutput {
                float4 pos : SV_POSITION;
                float4 uv : TEXCOORD0;
                fixed4 color : COLOR0;
            };

            vertOutput vert (vertInput input)
            {
                vertOutput o;
                o.pos = mul(UNITY_MATRIX_MVP, input.pos);
                o.uv = mul(UNITY_MATRIX_MVP, input.pos);
                o.color = input.color;
                return o;
            }

            fixed4 frag (vertOutput output) : SV_Target
            {   
                float2 paletteuv = output.color.b + 1.0/32.0;
                float2 screen = output.uv.xy / output.uv.z + float2(1.0, 1.0);
                float gradient = screen.x * output.color.r + screen.y * output.color.g;
                gradient = abs(((gradient*3.0)%2.0) - 1.0);
                return tex2D (_Palette, float2(gradient, paletteuv.y));
            }
            ENDCG
        }
    }
}<commit_msg>Fix gradient material projection issues<commit_after>﻿Shader "Custom/Gradient"
{
	Properties {
        _Palette ("Texture", 2D) = "white" { }
    }

    SubShader
    {
        Pass
        {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag

            sampler2D _Palette;

            struct vertInput {
        		float4 pos : POSITION;
				float4 color : COLOR0;
    		}; 

            struct vertOutput {
                float4 pos : SV_POSITION;
                float4 uv : TEXCOORD0;
                fixed4 color : COLOR0;
            };

            vertOutput vert (vertInput input)
            {
                vertOutput o;
                o.pos = mul(UNITY_MATRIX_MVP, input.pos);
                o.uv = mul(UNITY_MATRIX_MV, input.pos);
                o.color = input.color;
                return o;
            }

            fixed4 frag (vertOutput output) : SV_Target
            {   
                float2 paletteuv = output.color.b + 1.0/32.0;
                float2 screen = output.uv.xy / output.uv.z + float2(1.0, 1.0);
                float gradient = screen.x * output.color.r + screen.y * output.color.g;
                gradient = abs(((gradient*3.0)%2.0) - 1.0);
                return tex2D (_Palette, float2(gradient, paletteuv.y));
            }
            ENDCG
        }
    }
}
{'fraction_non_alphanumeric': 0.09488233096750093, 'fraction_numerical': 0.023160254015689205, 'mean_word_length': 1.2004930156121612, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4538875', 'n_tokens_mistral': 853, 'n_tokens_neox': 772, 'n_words': 170}