Class Fx

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

public final class Fx extends Object
Effects: energy, magic, damage and sci-fi surfaces. Most glow through the EMISSIVE hook, so they pair well with PostProcess.setBloom. Those that fade out need an alpha blended or additive render state; each says so.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    FLOAT progress or strength, 0 to 1: how dissolved, how charged.
    static final String
    VEC3 the effect's main colour.
    static final String
    VEC3 its second colour: an edge, a core, a hot spot.
    static final String
    VEC4 a world point (xyz) and the time (w) it was hit, for ripples.
    static final String
    FLOAT pattern repeats per unit.
    static final String
    FLOAT animation speed multiplier.
  • Method Summary

    Modifier and Type
    Method
    Description
    A beam or laser along the texture's u: a white hot core, a coloured sheath and energy streaming along it.
    Burns the surface away: pixels vanish as AMOUNT rises from 0 to 1, with a glowing COLOR edge ahead of the hole.
    Flames on a camera facing quad: v runs from the base (0) to the tips (1).
    A force field bubble: a honeycomb that lights up at the silhouette and ripples out from the last hit (HIT).
    A hologram: scan lines climbing the surface, a bright rim, flicker and see-through body.
    A swirling portal on a disc or quad centred on uv (0.5, 0.5): spiral arms pulled toward a bright rim and a dark centre.
    A damage flash and pulse: the surface keeps its look and glows COLOR by AMOUNT, throbbing.
    Smoke puffs on a camera facing quad: soft billowing grey that thins toward the edges and drifts up.
    X-ray: only the silhouette glows, the body is invisible.

    Methods inherited from class Object

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

  • Method Details

    • dissolve

      public static ShaderMaterial dissolve()

      Burns the surface away: pixels vanish as AMOUNT rises from 0 to 1, with a glowing COLOR edge ahead of the hole. Opaque.

      Returns

      a new shader material

    • hologram

      public static ShaderMaterial hologram()

      A hologram: scan lines climbing the surface, a bright rim, flicker and see-through body. Alpha blended.

      Returns

      a new shader material

    • forceField

      public static ShaderMaterial forceField()

      A force field bubble: a honeycomb that lights up at the silhouette and ripples out from the last hit (HIT). Additive or alpha blended.

      Returns

      a new shader material

    • beam

      public static ShaderMaterial beam()

      A beam or laser along the texture's u: a white hot core, a coloured sheath and energy streaming along it. Additive, on a quad or a thin cylinder.

      Returns

      a new shader material

    • fire

      public static ShaderMaterial fire()

      Flames on a camera facing quad: v runs from the base (0) to the tips (1). Turbulence rises, the colour runs from COLOR2 (hot) to COLOR (cool) to nothing. Additive.

      Returns

      a new shader material

    • smoke

      public static ShaderMaterial smoke()

      Smoke puffs on a camera facing quad: soft billowing grey that thins toward the edges and drifts up. Alpha blended.

      Returns

      a new shader material

    • portal

      public static ShaderMaterial portal()

      A swirling portal on a disc or quad centred on uv (0.5, 0.5): spiral arms pulled toward a bright rim and a dark centre. Opaque.

      Returns

      a new shader material

    • xray

      public static ShaderMaterial xray()

      X-ray: only the silhouette glows, the body is invisible. Additive; draw it with depth testing off to see it through walls.

      Returns

      a new shader material

    • pulse

      public static ShaderMaterial pulse()

      A damage flash and pulse: the surface keeps its look and glows COLOR by AMOUNT, throbbing. Drive AMOUNT from 1 down to 0 after a hit, or hold it for a power-up. Opaque.

      Returns

      a new shader material