Toon shader on iOS ?

Is there a way to get a toon shader working on iOS ? All the samples that I found here just work on desktop…

The effect I’m looking for is the one in the attached picture…

449366--15669--$TestWire.jpg

Do you have OpenGL ES 2.0 turned on in the settings?
Also do you have a device which supports it?

Yes, it’s on, but as you set the platform to iOS the shader is turned off and you see no outlines anymore… even compiling and installing on the device (iPad) gives just a normal shaded image…

Is the shader OpenGL ES 2.0 compatible, not some complex desktop shader or fullscreen fx?

I got the shader from this post:

http://forum.unity3d.com/threads/11073-Outline-Shader?highlight=toony-basicoutline

comments say: “excluded shader from OpenGL ES 2.0 because it does not contain a surface program or both vertex and fragment programs.”

but the most recent post in the thread dates back to 2008, so I was thinking that in the meantime what was impossible had become possible… I have no particular affection to this shader; anything that would produce the same kind of result on iOS is more than welcome !

OpenGL ES 2.0 didn’t exist until Unity 3 at all. Unity iPhone 1.x had no shader support, only fixed function pipeline.

Ok, but the question still is… is there a way to get something like that on iOS / Unity 3 today ?

did you try toon shaders from Toon package included with Unity3 installation?

Yes, I tried shaders in Unity 3 Pro; on the right you see what you get… but when you switch to delivery for iOS you the thing on the left…

Then you probably need to get a working GLSL shader for this toon effect ;).

I checked the shader

it does not stand much chance to work as it relies on a cubemap.
if you can get rid of that, there should be much less trouble

gnoblin dreamora: I’m afraid my knowledge of shaders is too primitive at the moment to do those mods myself :frowning:

did you try a more simple toon shader?

@dreamora: why is cubemap a problem?

This is just an assumption, but at least before, Unity didn’t support Cubemaps on iOS. I think the texgen cubemap part was missing.
Might be that this changed though but its the only thing I see offening in there if we talk about the zip posted towards the end of the thread there.

You can always use the old trick of duplicating the mesh, scaling the duplicate and flipping the normals for it. Add a black texture/color to it and it will work in any device.