Package icyllis.arc3d.granite

# Class ShaderCodeSource

java.lang.Object
icyllis.arc3d.granite.ShaderCodeSource

public class ShaderCodeSource extends Object
Manage all the fragment shader code snippets, used by Granite renderer.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ARC_ALPHA_ONLY`
  `static final String`
  `ARC_ANGULAR_GRAD_4_SHADER`
  `static final String`
  `ARC_ANGULAR_GRAD_8_SHADER`
  `static final String`
  `ARC_BLEND`
  Apply one of 42 blend modes.
  `static final String`
  `ARC_COLOR_SPACE_TRANSFORM`
  `static final String`
  `ARC_CUBIC_IMAGE_SHADER`
  `static final String`
  `ARC_DITHER_SHADER`
  `static final String`
  `ARC_ERROR`
  `static final String`
  `ARC_HW_IMAGE_SHADER`
  `static final String`
  `ARC_IMAGE_SHADER`
  `static final String`
  `ARC_LINEAR_GRAD_4_SHADER`
  `static final String`
  `ARC_LINEAR_GRAD_8_SHADER`
  `static final String`
  `ARC_PASSTHROUGH`
  `static final String`
  `ARC_PORTER_DUFF_BLEND`
  `static final String`
  `ARC_RADIAL_GRAD_4_SHADER`
  `static final String`
  `ARC_RADIAL_GRAD_8_SHADER`
  `static final String`
  `ARC_RGB_OPAQUE`
  `static final String`
  `ARC_SOLID_COLOR`
  `static final String`
  `BLEND_CLEAR`
  Public blend functions, these are pure functions.
  `static final String`
  `BLEND_COLOR`
  `static final String`
  `BLEND_COLOR_BURN`
  `static final String`
  `BLEND_COLOR_DODGE`
  `static final String`
  `BLEND_DARKEN`
  `static final String`
  `BLEND_DARKER_COLOR`
  `static final String`
  `BLEND_DIFFERENCE`
  `static final String`
  `BLEND_DIVIDE`
  This can produce undefined results from `BlendMode.blend_divide(float[], float[], float[])` if values out of range.
  `static final String`
  `BLEND_DST`
  `static final String`
  `BLEND_DST_ATOP`
  `static final String`
  `BLEND_DST_IN`
  `static final String`
  `BLEND_DST_OUT`
  `static final String`
  `BLEND_DST_OVER`
  `static final String`
  `BLEND_EXCLUSION`
  `static final String`
  `BLEND_HARD_LIGHT`
  `static final String`
  `BLEND_HARD_MIX`
  `static final String`
  `BLEND_HUE`
  `static final String`
  `BLEND_LIGHTEN`
  `static final String`
  `BLEND_LIGHTER_COLOR`
  `static final String`
  `BLEND_LINEAR_BURN`
  `static final String`
  `BLEND_LINEAR_DODGE`
  `static final String`
  `BLEND_LINEAR_LIGHT`
  `static final String`
  `BLEND_LUMINOSITY`
  `static final String`
  `BLEND_MINUS`
  `static final String`
  `BLEND_MINUS_CLAMPED`
  `static final String`
  `BLEND_MODULATE`
  `static final String`
  `BLEND_MULTIPLY`
  `static final String`
  `BLEND_OVERLAY`
  `static final String`
  `BLEND_PIN_LIGHT`
  `static final String`
  `BLEND_PLUS`
  `static final String`
  `BLEND_PLUS_CLAMPED`
  `static final String`
  `BLEND_SATURATION`
  `static final String`
  `BLEND_SCREEN`
  `static final String`
  `BLEND_SOFT_LIGHT`
  `static final String`
  `BLEND_SRC`
  `static final String`
  `BLEND_SRC_ATOP`
  `static final String`
  `BLEND_SRC_IN`
  `static final String`
  `BLEND_SRC_OUT`
  `static final String`
  `BLEND_SRC_OVER`
  `static final String`
  `BLEND_SUBTRACT`
  `static final String`
  `BLEND_VIVID_LIGHT`
  `static final String`
  `BLEND_XOR`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ShaderCodeSource()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `emitDefinitions(FragmentNode[] nodes, IdentityHashMap<String,String> added, Formatter code)`
  `FragmentStage`
  `findStage(int stageId)`
  `static String`
  `getMangledName(String baseName, int manglingSuffix)`
  `static String`
  `invoke_child(FragmentNode child, String localCoords, String priorStageOutput, String blenderDstColor, FragmentNode outputNode, String outputBaseName, byte outputType, Formatter code)`
  `static String`
  `invoke_node(FragmentNode node, String localCoords, String priorStageOutput, String blenderDstColor, Formatter code)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### ARC_ERROR

    public static final String ARC_ERROR
    See Also:
      - Constant Field Values

  - ### ARC_PASSTHROUGH

    public static final String ARC_PASSTHROUGH
    See Also:
      - Constant Field Values

  - ### ARC_SOLID_COLOR

    public static final String ARC_SOLID_COLOR
    See Also:
      - Constant Field Values

  - ### ARC_RGB_OPAQUE

    public static final String ARC_RGB_OPAQUE
    See Also:
      - Constant Field Values

  - ### ARC_ALPHA_ONLY

    public static final String ARC_ALPHA_ONLY
    See Also:
      - Constant Field Values

  - ### ARC_COLOR_SPACE_TRANSFORM

    public static final String ARC_COLOR_SPACE_TRANSFORM
    See Also:
      - Constant Field Values

  - ### ARC_LINEAR_GRAD_4_SHADER

    public static final String ARC_LINEAR_GRAD_4_SHADER
    See Also:
      - Constant Field Values

  - ### ARC_LINEAR_GRAD_8_SHADER

    public static final String ARC_LINEAR_GRAD_8_SHADER
    See Also:
      - Constant Field Values

  - ### ARC_RADIAL_GRAD_4_SHADER

    public static final String ARC_RADIAL_GRAD_4_SHADER
    See Also:
      - Constant Field Values

  - ### ARC_RADIAL_GRAD_8_SHADER

    public static final String ARC_RADIAL_GRAD_8_SHADER
    See Also:
      - Constant Field Values

  - ### ARC_ANGULAR_GRAD_4_SHADER

    public static final String ARC_ANGULAR_GRAD_4_SHADER
    See Also:
      - Constant Field Values

  - ### ARC_ANGULAR_GRAD_8_SHADER

    public static final String ARC_ANGULAR_GRAD_8_SHADER
    See Also:
      - Constant Field Values

  - ### ARC_IMAGE_SHADER

    public static final String ARC_IMAGE_SHADER
    See Also:
      - Constant Field Values

  - ### ARC_CUBIC_IMAGE_SHADER

    public static final String ARC_CUBIC_IMAGE_SHADER
    See Also:
      - Constant Field Values

  - ### ARC_HW_IMAGE_SHADER

    public static final String ARC_HW_IMAGE_SHADER
    See Also:
      - Constant Field Values

  - ### ARC_DITHER_SHADER

    public static final String ARC_DITHER_SHADER
    See Also:
      - Constant Field Values

  - ### BLEND_CLEAR

    public static final String BLEND_CLEAR
    Public blend functions, these are pure functions.

    Implementation is the same as raster pipeline, but is vectorized and eliminates branches.

    See Also:
      - `BlendMode`
      - Constant Field Values

  - ### BLEND_SRC

    public static final String BLEND_SRC
    See Also:
      - Constant Field Values

  - ### BLEND_DST

    public static final String BLEND_DST
    See Also:
      - Constant Field Values

  - ### BLEND_SRC_OVER

    public static final String BLEND_SRC_OVER
    See Also:
      - Constant Field Values

  - ### BLEND_DST_OVER

    public static final String BLEND_DST_OVER
    See Also:
      - Constant Field Values

  - ### BLEND_SRC_IN

    public static final String BLEND_SRC_IN
    See Also:
      - Constant Field Values

  - ### BLEND_DST_IN

    public static final String BLEND_DST_IN
    See Also:
      - Constant Field Values

  - ### BLEND_SRC_OUT

    public static final String BLEND_SRC_OUT
    See Also:
      - Constant Field Values

  - ### BLEND_DST_OUT

    public static final String BLEND_DST_OUT
    See Also:
      - Constant Field Values

  - ### BLEND_SRC_ATOP

    public static final String BLEND_SRC_ATOP
    See Also:
      - Constant Field Values

  - ### BLEND_DST_ATOP

    public static final String BLEND_DST_ATOP
    See Also:
      - Constant Field Values

  - ### BLEND_XOR

    public static final String BLEND_XOR
    See Also:
      - Constant Field Values

  - ### BLEND_PLUS

    public static final String BLEND_PLUS
    See Also:
      - Constant Field Values

  - ### BLEND_PLUS_CLAMPED

    public static final String BLEND_PLUS_CLAMPED
    See Also:
      - Constant Field Values

  - ### BLEND_MINUS

    public static final String BLEND_MINUS
    See Also:
      - Constant Field Values

  - ### BLEND_MINUS_CLAMPED

    public static final String BLEND_MINUS_CLAMPED
    See Also:
      - Constant Field Values

  - ### BLEND_MODULATE

    public static final String BLEND_MODULATE
    See Also:
      - Constant Field Values

  - ### BLEND_MULTIPLY

    public static final String BLEND_MULTIPLY
    See Also:
      - Constant Field Values

  - ### BLEND_SCREEN

    public static final String BLEND_SCREEN
    See Also:
      - Constant Field Values

  - ### BLEND_OVERLAY

    public static final String BLEND_OVERLAY
    See Also:
      - Constant Field Values

  - ### BLEND_DARKEN

    public static final String BLEND_DARKEN
    See Also:
      - Constant Field Values

  - ### BLEND_LIGHTEN

    public static final String BLEND_LIGHTEN
    See Also:
      - Constant Field Values

  - ### BLEND_COLOR_DODGE

    public static final String BLEND_COLOR_DODGE
    See Also:
      - Constant Field Values

  - ### BLEND_COLOR_BURN

    public static final String BLEND_COLOR_BURN
    See Also:
      - Constant Field Values

  - ### BLEND_HARD_LIGHT

    public static final String BLEND_HARD_LIGHT
    See Also:
      - Constant Field Values

  - ### BLEND_SOFT_LIGHT

    public static final String BLEND_SOFT_LIGHT
    See Also:
      - Constant Field Values

  - ### BLEND_DIFFERENCE

    public static final String BLEND_DIFFERENCE
    See Also:
      - Constant Field Values

  - ### BLEND_EXCLUSION

    public static final String BLEND_EXCLUSION
    See Also:
      - Constant Field Values

  - ### BLEND_SUBTRACT

    public static final String BLEND_SUBTRACT
    See Also:
      - Constant Field Values

  - ### BLEND_DIVIDE

    public static final String BLEND_DIVIDE
    This can produce undefined results from `BlendMode.blend_divide(float[], float[], float[])` if values out of range.
    See Also:
      - Constant Field Values

  - ### BLEND_LINEAR_DODGE

    public static final String BLEND_LINEAR_DODGE
    See Also:
      - Constant Field Values

  - ### BLEND_LINEAR_BURN

    public static final String BLEND_LINEAR_BURN
    See Also:
      - Constant Field Values

  - ### BLEND_VIVID_LIGHT

    public static final String BLEND_VIVID_LIGHT
    See Also:
      - Constant Field Values

  - ### BLEND_LINEAR_LIGHT

    public static final String BLEND_LINEAR_LIGHT
    See Also:
      - Constant Field Values

  - ### BLEND_PIN_LIGHT

    public static final String BLEND_PIN_LIGHT
    See Also:
      - Constant Field Values

  - ### BLEND_HARD_MIX

    public static final String BLEND_HARD_MIX
    See Also:
      - Constant Field Values

  - ### BLEND_DARKER_COLOR

    public static final String BLEND_DARKER_COLOR
    See Also:
      - Constant Field Values

  - ### BLEND_LIGHTER_COLOR

    public static final String BLEND_LIGHTER_COLOR
    See Also:
      - Constant Field Values

  - ### BLEND_HUE

    public static final String BLEND_HUE
    See Also:
      - Constant Field Values

  - ### BLEND_SATURATION

    public static final String BLEND_SATURATION
    See Also:
      - Constant Field Values

  - ### BLEND_COLOR

    public static final String BLEND_COLOR
    See Also:
      - Constant Field Values

  - ### BLEND_LUMINOSITY

    public static final String BLEND_LUMINOSITY
    See Also:
      - Constant Field Values

  - ### ARC_BLEND

    public static final String ARC_BLEND
    Apply one of 42 blend modes.
    See Also:
      - Constant Field Values

  - ### ARC_PORTER_DUFF_BLEND

    public static final String ARC_PORTER_DUFF_BLEND
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ShaderCodeSource

    public ShaderCodeSource()

- ## Method Details

  - ### findStage

    public FragmentStage findStage(int stageId)

  - ### getMangledName

    public static String getMangledName(String baseName, int manglingSuffix)

  - ### invoke_node

    public static String invoke_node(FragmentNode node, String localCoords, String priorStageOutput, String blenderDstColor, Formatter code)

  - ### invoke_child

    public static String invoke_child(FragmentNode child, String localCoords, String priorStageOutput, String blenderDstColor, FragmentNode outputNode, String outputBaseName, byte outputType, Formatter code)

  - ### emitDefinitions

    public static void emitDefinitions(FragmentNode[] nodes, IdentityHashMap<String,String> added, Formatter code)