Grayscale shader, can I make modified textures appear brighter?

Hi,

I am completely unfamiliar with shaders.
I am using this shader to make texture appear on GUI as grayscale.

Shader "Custom/Grayscale" {
    Properties {
        _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
    }
 
    SubShader {
        Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
        LOD 200
 
        CGPROGRAM
        #pragma surface surf Lambert alpha
 
            sampler2D _MainTex;
 
            struct Input {
                float2 uv_MainTex;
            };
 
            void surf (Input IN, inout SurfaceOutput o) {
                half4 c = tex2D(_MainTex, IN.uv_MainTex);
                o.Albedo = dot(c.rgb, float3(0.22, 0.707, 0.071));
                o.Alpha = c.a;
            }
 
        ENDCG
    }
 
    Fallback "Transparent/VertexLit"
}

The only problem is that textures appear very dark, almost black.
Is there a way to make them brighter?

Thank you.

o.Albedo = dot(c.rgb, float3(0.22, 0.707, 0.071));

the weights doesn’t exactly add up 0.22+ 0.707+ 0.071 = 0.998 but is still should be good enough.
You could test with a pure white texture with a white alpha (“opaque”) to see if it comes out white (or very close, could be 254,254,254). If it doesn’t something else is tinting your mesh, most likely vertex colors or a post effect.

Hi,

I am new to it and didn’t understand some things you said. The shader code above wasn’t created by me.

  1. I created following texture and it appears pretty dark: #666666 to be exact.
    1592514--95637--$TestTexture.png
    How can I find what causes this?

  2. What do you mean regarding weights doesn’t add up? Should there be solid 1?

Thank you.

change o.Albedo to o.Emission, or write a new fragment shader that is not effected by lights in scene.

Woooow! You are the greatest! It works perfectly! Thanks a lot!