Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

grayscale shader on iOS turns black

$
0
0
hey everyone, i've got a bit of a shader problem. Since i have no experience with shader-coding (or programing in general), i hope someone will be able to help me here. It's a simple grayscale shader, I got the code somewhere off the internet. Nothing special.It's applied to a material and everything's regular. The material is applied to a sprite. ![alt text][1] <- with default sprite shader ![alt text][2] <- on PC ![alt text][3] <- on iOS Now on mac, or win, everythings normal and how it should be. Grayscaled. On my iPad otherwise, it's just black. pure evil. I have no idea why. Here's the shader-code. Shader "GrayscaleLolTransparent" { Properties { _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} _EffectAmount ("Effect Amount", Range (0, 1)) = 1.0 } SubShader { Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} LOD 200 CGPROGRAM #pragma surface surf Lambert alpha sampler2D _MainTex; uniform float _EffectAmount; struct Input { float2 uv_MainTex; }; void surf (Input IN, inout SurfaceOutput o) { half4 c = tex2D(_MainTex, IN.uv_MainTex); o.Albedo = lerp(c.rgb, dot(c.rgb, float3(0.3, 0.6, 0.2)), _EffectAmount); o.Alpha = c.a; } ENDCG } Fallback "Transparent/VertexLit" } ---------- I haven't found anything in the search function. Just hints, that it may be because of some GLES shader stuff... I don't know. Any help? Thanks in advance! cheers [1]: http://i205.photobucket.com/albums/bb269/Shelly_pwns/color-1.png [2]: http://i205.photobucket.com/albums/bb269/Shelly_pwns/normal.png [3]: http://i205.photobucket.com/albums/bb269/Shelly_pwns/iosblack.png

Viewing all articles
Browse latest Browse all 4709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>