- Home /
A Grayscale Shaders does not work on Android?
i hope that you can help me... I have a Shaders for Grayscale Texture ,on PC it working fine,but it never working on any android devices.just like the Shaders load failed.This is my code:
Shader "Custom/Greyscale" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
// Get the original texture colour
half4 tex = tex2D (_MainTex, IN.uv_MainTex);
// Get the apparent brightness
half brightness = dot(tex.rgb, half3(1, 1.1, 1));
// Set RGB values equal to brightness
o.Albedo = brightness;
}
ENDCG
}
FallBack "Diffuse"
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612043155im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Why does this shader make my 2D sprites disappear if they are rotated 180 degrees? Also, pixel snap? 3 Answers
2D Greyscale shader with lighting and color. 1 Answer
Greyscale Shader Removes UI Masking 0 Answers
How do I access the 'Shader' property of the Greyscale Effect? 1 Answer
Modifying Greyscale Shader for selective Colouring. 2 Answers