Hi guys, I wonder if anybody tried his marvelous tutorial shaders on iOS
On iPad2, the planet shaders is working fine (very similar to other planet shaders posted on the forum),
but the Clouds atmospheric shader, is hanging the device in a brutal crash.
I’m using the second varied version, the one with the RGB Ramp to make the scattering look better.
Is working great on Mac / Editor !
This is the shader source:
// Planet Clouds Surface Shader by Matt Mechtley
// Licensed Under a Creative Commons Attribution license
// http://creativecommons.org/licenses/by/3.0/
Shader "Custom/Clouds" {
Properties {
_MainTex ("Alpha (A)", 2D) = "white" {}
_AtmosRamp ("Atmosphere Ramp (RG or B)", 2D) = "black" {}
_RimColor ("Rim Color", Color) = (0.26,0.19,0.16,0.0)
}
SubShader {
Tags { "RenderType"="Transparent" }
CGPROGRAM
#pragma surface surf WrapLambert alpha
struct Input {
float2 uv_MainTex;
float3 viewDir;
};
sampler2D _MainTex;
sampler2D _AtmosRamp;
void surf (Input IN, inout SurfaceOutput o) {
float2 uv_Ramp = 1.0 - saturate(dot (normalize(IN.viewDir), o.Normal));
o.Specular = tex2D (_AtmosRamp, uv_Ramp).r;
o.Alpha = tex2D (_MainTex, IN.uv_MainTex).a + o.Specular;
}
half4 _RimColor;
half4 LightingWrapLambert (SurfaceOutput s, half3 lightDir, half atten) {
half NdotL = dot (s.Normal, lightDir);
half diffuse = max(0, NdotL* 0.9 + 0.1);
half4 c;
c.rgb = (atten * 2) * _LightColor0.rgb * diffuse * (1.0 - s.Specular)
+ (diffuse * s.Specular * _RimColor);
c.a = s.Alpha;
return c;
}
ENDCG
}
FallBack "Diffuse"
}
What can be the not-supported-by-iPad instruction here ?
It seems all great, infact works great in the editor, but sadly, on iPad crashes.
The planet shader with bumps/emissive night texture etcetera is working great also on device.