Search Unity

Toon Shader

Discussion in 'Works In Progress - Archive' started by Ippokratis, Mar 25, 2012.

  1. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    I am creating a new toon shader. It is compatible with IOS, Android and renders fast.
    The estimated release date is around April 30 and the price will be 15$.

    Link to web player

    Here is some first results using a free model from turbosquid :
    $Screen shot 2012-03-25 at 9.58.16 AM.png
    $Screen shot 2012-03-25 at 9.59.04 AM.png

    Edit :
    Update with outlined toon shader.

    Web player link :

    $Screen shot 2012-04-01 at 10.47.49 PM.png
     
    Last edited: Apr 1, 2012
  2. rqpaine

    rqpaine

    Joined:
    Oct 6, 2011
    Posts:
    69
    can we see the original model with a standard shader?
     
  3. Acumen

    Acumen

    Joined:
    Nov 20, 2010
    Posts:
    1,041
    Before putting it out there, could you give some real tests on the iOS platforms ? With an actual possible scene scenario ?
    I was excited by the looks of it, since that is what I was always looking for, but "pretty fast" was a bit of a bummer.
     
  4. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    Thanks for the interest !
    I updated the first post with a link to a web player, so you can check the shader out.
    rqpain :
    The model I used can be found here, you can try different shaders on it.

    Acumen :
    I understand your skepticism, so I will try to clarify some things : I post this as a work in progress. That means there is still work to do, hence no benchmarks provided. Right now the speed is comparable to diffuse shader.

    Could you please rephrase, I do not fully understand what you are saying. You mean to provide some sample scene ? If so, check the first post for a quick demonstration. For now, this is all I can provide ( I code in weekend only, hence a full scene will take some time, but I will provide it before release ).

    Keep this thought :)

    I have some difficulties to understand what you are saying again, I believe you mean that you do not believe my statement about speed. I fully understand this and I will provide some benchmarks before the release. Actually the reason I do not release it now is that I have to create some documentation, graphics, example files, explain how to integrate with Batching Tools to have a minimum number of draw calls for multiple moving objects ( like, say, one draw call ). The good thing is that the "meat" of this product is ready, I just have to finish the packaging.

    If you have any suggestions, questions, please ask.
    -Ippokratis
     
  5. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    I think he ment that that "pretty fast" means that its kind of fast but not to fast maby edit the post to say "realy fast"?
     
  6. Diviner

    Diviner

    Joined:
    May 8, 2010
    Posts:
    677
    Good job on the shader, you seem to have a knack for this. Unfortunately I don't need something like this, but if you can find a way to make an outline ( cell ) shader that can work on iOS, I'd be extremely interested. Everything I tried gets rejected by iPhone's GPU.
     
  7. rqpaine

    rqpaine

    Joined:
    Oct 6, 2011
    Posts:
    69
    can we get a shot of your shader on these models, also free from turbo squid? that goku is already toonish, these will show off your shader on a range of styles:

    a classic fantasy archer
    http://www.turbosquid.com/3d-models/medieval-archer-fantasy-3d-model/290750

    a robot/mech
    http://www.turbosquid.com/3d-models/free-max-mode-tada-3rd/611033

    a monster of high poly count
    http://www.turbosquid.com/3d-models/character-3d-model/263590

    especially these two more realistic meshes
    a policeman
    http://www.turbosquid.com/3d-models/free-3ds-model-police-officer/320414

    a kinda toonish jock
    http://www.turbosquid.com/3d-models/stylized-male-athletic-max-free/473463

    Im interested from an intellectual view but I think others might like to see how it handles different kinds of modeling.
     
  8. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    titanty : Thanks for the explanations, I think that "fast" describes it well ( just modified it ).

    Diviner : Thanks for the kind words. I already have an outline version in the works that fixes the thick silhouette ( outline ) problem at long distances ( problem in most implementations I founs so far). I will provide some examples soon. It is costly though ( 2 draw calls per outlined mesh ). The unity provided toon shaders use cube maps, hence cannot be used on IOS and Android, another approach is to use sphere maps ( there are some posts on this subject ). I am looking forward to see more of your projects, the tutorials are great.

    rqpaine : I do not have 3ds max, so I cannot use most of these models. I will post the ones I can import in Unity.
    You should know from now that if you cannot create - find - purchase models that have cartoon "feel", the results with any shader will not look good. I have devised a way to combine line art and cartoon shading, so the shader - texturing part is pretty covered ( most in future posts ), the modelling part is up to you. If you have a specific model that you wish to test, send it over and I will happily send you back some pictures so you can judge if it works for you, but this should happen after I release the product, in about a month as noted in the first post.

    Thanks for the feedback,
    -Ippokratis
     
  9. stefmen

    stefmen

    Joined:
    Apr 14, 2009
    Posts:
    791
    what are the specs of this shader?
     
  10. Acumen

    Acumen

    Joined:
    Nov 20, 2010
    Posts:
    1,041
    Yeh, sorry for not being totally clear. I tend to write mysterious comments that nobody but me seems to understand :(
    Sounds like I need to watch this progress closely ! You pretty much answered all my questions already. Looking forward for more examples and documentation.
     
  11. marata

    marata

    Joined:
    Jan 6, 2012
    Posts:
    38
    Good job!

    I think you need to show more models with your shader,.

    I'm interested to buy it..

    Totally agreed
     
  12. Fu11English

    Fu11English

    Joined:
    Feb 27, 2012
    Posts:
    258
    Very interested, especially for a cell shaded outline version. The toon shaders built into Unity are a bit of an April fools joke that someone forgot to remove :)
     
  13. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    stefmen :
    Please rephrase, I do not understand your question. I am not aware of shaders having "specs", I am curious what exactly you need to know. Thanks.

    Acumen:
    Actually, I have some difficulties in understanding colloquial words, it is good to know that I answered your questions. More examples and documentations are coming soon.

    Marata:
    Thanks for your kind words.
    I intend to show more models as I progress with the shader development. Right now I work with Blade Master 2 model ( Thanks Evan Greenwood ).
    $Screen shot 2012-03-26 at 10.09.02 PM.png

    Please note that it uses 88 tris.

    Beyond Basic Games :
    I have great respect to what Unity provides for free - an affordable price. I hope that when this shader is finished, it will serve others well.
    Thanks for the feedback and your kind words,
    -Ippokratis
     
    Last edited: Mar 26, 2012
  14. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126
    Looks fantastic, if I keep working my game I'll use your shadder for sure
     
  15. badawe

    badawe

    Joined:
    Jan 17, 2011
    Posts:
    297
    Hy there! :)

    When we can put our hands on this shader?
     
  16. TBYG

    TBYG

    Joined:
    Sep 29, 2011
    Posts:
    158
    I'm very interested in this and the outlined version as well. One thing I haven't gotten around to is learning shaders.
     
  17. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126
    Absolutely fantastic !
    Although I'm going to experiment with 2d , i'll be happy to spend 15$ on your shader .
    Go ahead and check my game in my sigh to see why I NEED your shader,
    Thanks !!!
     
  18. Wolfos

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    951
    Built-in shader works on iOS, but not on Android. I like how that looks, might use it for Bedroom Racer.
     
  19. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    Thanks for your kind words, here is another example with a web player :
    Link to the web player

    $Screen shot 2012-03-31 at 12.47.14 PM.png


    How it works : You have a mesh like this.
    It is a mesh with submeshes.
    $Screen shot 2012-03-31 at 12.53.48 PM.png
    You use the shader color field in each material to assign the base color.
    If you need texture details ( I use them in this model for the eyes and the mouth ), you use another shader that uses this info too.
    So you can set for each material the color and the details. The shader applies a "toon effect" on this input (cell shading).

    I am very satisfied with the results and the comments so far, I will release this shader by April 7 ( in a week) since there is enough interest.

    I plan to add some more shaders ( outline, different number of shades, different orientation of shades ) and editor tools that will permit easier - more expressive content creation as this pack matures. I also intend to permit cooperation with Batching Tools for lowering the rendering times too. As I add features, the price will bump a little (but not too much), so check it out early :)
    -Ippokratis
     
    Last edited: Mar 31, 2012
  20. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
  21. Acumen

    Acumen

    Joined:
    Nov 20, 2010
    Posts:
    1,041
    Interesting :)
    Does this outline technique use the doubledthenflippedmesh approach ?
     
  22. markofjohnson

    markofjohnson

    Joined:
    Oct 12, 2010
    Posts:
    68
    Can't wait to try this. Keep going! Will be testing this on _all_ iOS hardware (well, all the devices with shaders of course).
     
  23. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,

    Acumen : Yes, but at the shader ( more flexibility over modifying the mesh, same cost ). A Sobel effect would be Pro only - no good.

    markofjohnson : Thanks for your kind words, I try hard to release it earlier due to increased interest :)

    -Update-
    New test on outlined toon shader. Adjustable outline thickness, color, supports transparent lines.

    Web player link :

    $Screen shot 2012-04-01 at 10.47.49 PM.png
     
    Last edited: Apr 1, 2012
  24. Andrew_atl

    Andrew_atl

    Joined:
    Sep 21, 2010
    Posts:
    103
    Looks really good. Does it support shadows?
     
  25. Lotho

    Lotho

    Joined:
    Feb 19, 2012
    Posts:
    9
    This looks great, well done! ill be buying this regardless if I use it or not!
     
  26. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
    Curious to see the shader working with a hand painted texture...
    I'll buy it to give it a try :)
     
  27. kalamona

    kalamona

    Joined:
    Aug 16, 2011
    Posts:
    727
    Hello,
    I am interested. I prepared a model, could we see it how does it work with your shader? If you don't want to show it to others, you can PM me a link too.
    The prepared model:
    Samurai rabbit pose fbx
    Texture



    Also what would be the price?
     
  28. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    Thanks for your kind words :)

    I am open to suggestions, would you like to send some assets to test them out ?

    I will provide a web player with the model you send in the weekend ( I also try to release the first version by then ).
    It will cost 15$.

    Thanks for your feedback,
    Ippokratis
     
    Last edited: Apr 5, 2012
  29. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    New build : Hellboy, 1500 tris, 2600 verts ( Unity stats ).
    Source model
    Link to web player
    $Screen shot 2012-04-08 at 9.32.07 AM.png

    -Update-
    Good news : The first version of this toon shader family ( currently having 6 members ), is done.
    Bad news : I cannot test on IOS until I manage to send the @#%$ fax to Apple so I can renew my developer account.

    I have done many changes in the original shader that was running fast on IOS. All those changes are making the shader more lightweight, thus faster. But, I cannot test it on IOS any more, because my apple developer account expired. Until I get approved again as an IOS developer ( I thought renewal can be done via internet but nope, fax is required ), the shader is published without IOS support guarantee.

    I am making a new thread once I submit the shader to the Asset Store ( in a few hours ).
    Thanks for your patience,
    -Ippokratis.
     
    Last edited: Apr 8, 2012
  30. Lotho

    Lotho

    Joined:
    Feb 19, 2012
    Posts:
    9
    cant wait :)
     
  31. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Agreed...looks fantastic. My love of WindWaker knows no bounds so this is happyface stuff right here if indeed it's spry on iOS. :D
     
  32. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Submitted.
    If it gets approved it will look like this :

    $Screen shot 2012-04-09 at 12.48.57 AM.png

    Thanks for the feedback :)
     
  33. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Looks good!
     
  34. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    I haven't thought that using hellboy's head violates copyright infringement (!).
    I will re-create the package without it and submit it tomorrow.
    Sorry for the delay,
    -Ippokratis.
     
  35. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    I'll be buying. And nice Tempest clone you created.
     
  36. krillmcrawl

    krillmcrawl

    Joined:
    Feb 18, 2011
    Posts:
    29
    Looks very nice! Does the shaders support transparency, for example main color being semitransparent (50%)?
     
  37. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
  38. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    Thanks for your kind words :)

    Thanks :) I can provide a version of the shader that supports main color transparency easily, the problem is efficiency ( overdraw kills performance in any shader). If you do not mind sacrificing performance, I will include another 4 shaders that support this feature ( and jump to 10 shaders ). The only reason I have not developed it so far is that I thought there will be no demand.

    -Update-
    I am planning to re-submit the modified package this weekend, some video tutorials in Engrish will follow soon. Thanks a lot for your support !
    -Ippokratis
     
  39. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    I'll check for it in the store next Monday then.

    I was thinking of buying your batch tools too but when are you fixing the bug?

    Thanks.
     
  40. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    Sure, but what bug are you talking about ? I am very interested in user feedback, does someone you know has problems with batching tools ?
    If so, please report at the main thread ( preferably send along a minimal sample scene that reproduces the error ).
    Thanks,
    -Ippokratis
     
  41. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Well I could of sworn I read in another thread that there was a bug in the batcher because of Unity 3.5.

    From your reaction I guess you probably already fixed it.
     
  42. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    Batching Tools Lightmap support is broken in 3.5 ( and I am working on this) but I am not aware of other problems. I am very interested in user feedback, hence my response. If this is the issue you mention, I try hard to solve it but I am unable to estimate when this will happen. Lightmapping is an important feature I wish to further support but the new implementation gives me headaches :)
     
  43. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    OK, well I want the toon shading primarily but was going to buy the batching to help optimise. I'll certainly let you know / forward the logs for this to you if you haven't gotta it fixed by the time I use it.
     
  44. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    goat: Sure, I appreciate feedback a lot.

    -Update-
    Thanks to BirdaoGwra, I have a nice model to showcase the toon shader :)
    A web player that showcases it will appear later today.
    [EDIT]
    The fax arrived at Apple and now I can test the shader on my IPod Touch again ! The next 4 days are going to be very interesting :)
     
    Last edited: Apr 13, 2012
  45. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    LOL, I'm doing that same tutorial that BirdaoGwra used to create that model. That style and your toon shader is a perfect combo for Unity I think.

    I'll still pay to buy the shader from you but if you want extra help testing done with iOS 3.1.3 (1st Gen iPod Touch) and iOS 4.2.1 (iPhone 3G) with old intel Core2Duo MacMini Lion 10.7.3.

    If it fails I guess I'll fall back to mat shading (which is OK with the right colors applied to the vertices).
     
  46. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    The toon shader runs on devices supporting programable shaders, all models from Iphone 3gs ( included ) and up. If you plan to support earlier devices, you should try other solutions indeed. We both own a similar mac btw :)
    I am very interested in the tutorial you mention. Could you please provide a link ?
     
  47. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    I was afraid of that.

    I will still buy your shader as I will be buying an new iPod touch soon. I guess I could figure out programmatically whether to use your toon Shader or mat shader with colored vertices (this looks like 'claymation', not bad; but not toon shading).

    Here is the link to the tutorial (It is for Blender 2.46, please note keyboard shortscuts have changed somewhat):

    http://cg.tutsplus.com/tutorials/bl...-a-complete-manga-character-in-blender-day-1/

    Here is link to Blender 2.5x shortcuts:

    http://wiki.blender.org/uploads/1/14/Keyboardlayout_250.png

    There are several intro tutorials for using the mouse and shortcuts for beginners in Blender. You can probably find one in Greek.

    Here are the shortcuts in my limited experience I use the most:

    LMB - Left Mouse Button, RMB - Right.., MMB - Middle..

    <Shift>MMB - Move window in current viewport (not the mesh) up or down (that is Y axis)
    <Control>MMB - Move window in current viewport (not the mesh) left or right (that is X axis)
    MMB<ScrollWheel> - Move window in current viewport (not the mesh forward or backwards (that is Z axis)
    MMB<Drag Push/Pull> - move around all axis acording to the location current '3D cursor'
    <NumPad>. - Center selected mesh/object in viewport

    <Control>LMB - lasso select - similar to Photoshop Gimp cowboy lasso select
    <ALT>RMB - loop select - selects edges along surface circumference
    <L> - Linked select
    <A> - All/None select
    <Control><NumPad>+ - grow (add) to current selection group
    (One Face)<Shift> - deselects selected face

    G - move mesh/object
    Gx, Gy, Gz - move mesh/object restricted to the axis x, y, or z

    R - rotate mesh/object
    Rx, Ry, Rz - rotate mesh/object restricted to the axis x, y, or z



    Here is another shortcut list:

    http://www.blendertips.com/hotkeys.html
     
    Last edited: Apr 14, 2012
  48. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi,
    Thanks for the links and the info, much appreciated.

    -Update-
    The shader works fine on IOS. No benchmarks yet, just a simple 60 fps scene with transparent outline.

    $Screen Shot 2012-04-16 at 1.22.27 AM.png
     
  49. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Hi when this will be released? ... I just bought batching tools btw :)
     
  50. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Hey,

    Looks good. When I was in Korea, alot of the school girls dress like that, catholic school uniform or in England public school style uniforms.

    I have been testing NGUI and other Package Imports today in Unity 3.5.1 (again since I need to test on iOS) with my Duo2Core (mid 2007) MacMini, osX Lion 10.7.3, 4GB RAM, Intel 350 GPU, and 15GB free diskspace:

    Didn't you say you use MacMini with the same specs (or nearly the same)?

    Everytime I try to import NGUI, or other packages osX freezes up and I have to hard cycle the machine.

    I did this in Unity 3.4.2 as well and I uploaded a whole project as bug report.

    The only other thing I have seen so consistently look up a UNIX OS prior to this was a SCSI Barcode reader someone neglected to remove at a bank I worked at or having an NFS file system and losing a network connection (to be fair that would look up all OSes in that day).

    Do you have this same trouble on your MacMini importing Unity Packages like NGUI (or others, even custom made simple programs)?

    This is very agravating as I use Unity 3.5.1 on a Windows 7 x64 machine (loaded with all kinds of junk, much more than the MacMini) with same CPU as the MacMini and 4GB RAM as well. The big difference being the PC has a similarly old ATI 2400HD Graphics card rather than the MB Intel 350 Graphics Card.

    I think the cause might be when Unity create 'mats' from texture raster files but that's a guess.