- Home /
toon shading ios and android
does toon shading work on android and ios caue i have seen things on the web saying it doesn't
Answer by DoktorAce · Nov 10, 2011 at 07:53 PM
You can fake it pretty good with an environment map shader and by creating a classic flipped normal outline (Create a copy of your object, "grow" each vertices out along its normal, flip all normals, and then texture it black)
This would work as an environment map shader:
Shader "iPhone/Env_Diffuse_NoLight" {
Properties { _Color ("Main Color", Color) = (1,1,1,1) _Emission ("Emmisive Color", Color) = (0,0,0,0) _Blend ("Blend", Range (0, 1)) = 0.5 _MainTex ("Base (RGB)", 2D) = "white" _EnvMap ("EnvMap", 2D) = "white" { TexGen SphereMap }
} SubShader { Material { //Diffuse [_MainTex] Emission [_Emission] Ambient [_MainTex] } Pass { Lighting On
SetTexture [_EnvMap] {
constantColor (0.5, 0.5, 0.5, [_Blend])
combine texture lerp (constant) constant
}
SetTexture [_MainTex] {
combine texture * previous DOUBLE
}
SetTexture [_MainTex] {
constantColor[_Color]
combine previous * constant
}
}
}
SubShader {
Pass {
SetTexture [_MainTex] {
combine texture
}
SetTexture [_MainTex] {
constantColor[_Color]
combine previous * constant
}
}
}
Fallback "Mobile/Unlit (Supports Lightmap)" }
For the environment map texture you will have to experiment a bit. But I usually create a few rings in different shades of grey in the center of the map.
No, not at all. It works great with the orthographic camera! At least when I try it on my setup :)
Your answer
Follow this Question
Related Questions
Missing Input System and Shaders 1 Answer
Rendering Depth Texture 0 Answers
Why CYAN is default object color (with default materials & shaders) 0 Answers
URP Blit Render Feature not rendering in Single Pass Instanced VR 0 Answers
Possible to Make a shader graph for a segmented health bar RECTANGLE? 0 Answers