Class Toon

java.lang.Object
com.codename1.gpu.shaders.Toon

public final class Toon extends Object
Stylized, non photographic shading. These compute their own lighting from the sun, so use them on a Material.Type.UNLIT material: the material's colour and texture are the paint, the graph decides the light.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    FLOAT the number of light bands, 2 to 5.
    static final String
    FLOAT hatch lines per world unit.
    static final String
    VEC3 the rim light colour; black for none.
    static final String
    VEC3 the colour of the shadowed side, multiplied into the paint.
  • Method Summary

    Modifier and Type
    Method
    Description
    cel()
    Cel shading: light in hard bands with a thin soft step between them, a cool shadow tint and a bright rim.
    Pen hatching: the darker the light, the more crossing lines, drawn in world space so they stay put as the camera moves.
    Flat faceted low poly look: one colour per face by height, toward the sun or away, with no smooth gradients.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • cel

      public static ShaderMaterial cel()

      Cel shading: light in hard bands with a thin soft step between them, a cool shadow tint and a bright rim.

      Returns

      a new shader material

    • hatching

      public static ShaderMaterial hatching()

      Pen hatching: the darker the light, the more crossing lines, drawn in world space so they stay put as the camera moves.

      Returns

      a new shader material

    • lowPoly

      public static ShaderMaterial lowPoly()

      Flat faceted low poly look: one colour per face by height, toward the sun or away, with no smooth gradients.

      Returns

      a new shader material