Shader not working on any project created in Unity 2018.1 beta 4 using the NEW Unity Hub

Creating Project using regular Unity hub gives me this.

Using the new Unity hub gives me this. I tried Lightweight Render Pipleline, HD Render Pipleline, 3D option, and 2D option.

Here is my shader. Its a color swapper.

Shader "PaletteSwap/Unlit Texture"
{
Properties {
    _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}

SubShader {
    Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
    LOD 100

    ZWrite Off
    Blend SrcAlpha OneMinusSrcAlpha

    Pass {
        CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #pragma target 2.0
            #pragma multi_compile_fog

            #include "UnityCG.cginc"

            struct appdata_t {
                float4 vertex : POSITION;
                float2 texcoord : TEXCOORD0;
                UNITY_VERTEX_INPUT_INSTANCE_ID
            };

            struct v2f {
                float4 vertex : SV_POSITION;
                float2 texcoord : TEXCOORD0;
                UNITY_FOG_COORDS(1)
                UNITY_VERTEX_OUTPUT_STEREO
            };

            sampler2D _MainTex;
            float4 _MainTex_ST;
            half4 _Out[256];

            v2f vert (appdata_t v)
            {
                v2f o;
                UNITY_SETUP_INSTANCE_ID(v);
                UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
                o.vertex = UnityObjectToClipPos(v.vertex);
                o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
                UNITY_TRANSFER_FOG(o,o.vertex);
                return o;
            }

            fixed4 frag (v2f i) : SV_Target
            {
               
                fixed4 c = tex2D(_MainTex, i.texcoord);
                UNITY_APPLY_FOG(i.fogCoord, col);
                if (c.r == c.b && c.r == c.g && c.a != 0)
                    return _Out[c.r * 256];
               
                return c;
            }
        ENDCG
    }
}

}

Hi X301,
Could you please file a bug report with a minimal reproduction project for this issue and reply in here with the case #?
You can find more information about bug reporting here.

You may want to save your case’s ticket: 992925_6t20322nrc48psu4

Thanks! This part is enough: 992925

Hi,

Looks like the new hub creates projects in linear mode by default, not gamma. I will dig around and see if this is an intended change.
You can work around this by changing the ColorSpace to Gamma in the player settings.

EDIT: I’ve been looking at how to make this run in linear mode, and it looks like the color you use in the lookup table will be slightly different if you run the project in linear. You might have to apply a gamma curve yourself or make sure you author content (and import textures) in the color mode you want. What I will do is making sure SetColorArray converts the color values you provide to the shader to the space the shader operates in, since this does not seem to be correct at the moment.

EDIT2: SetColorArray and GetColorArray both have this line in the documentation: “No sRGB-linear conversion is done during the function call.”
I’m unable to change this without breaking existing scripts, so you will have to convert to linear yourself when setting the colors if you want to run in linear mode. This combined with a gamma correct shader should give you the desired result.
The bug has been closed as by design, but perhaps this is something that can be revisited later

Thank you I will try this out when I get a change :).