Package icyllis.arc3d.granite.geom

# Class CircleProcessor

java.lang.Object
icyllis.arc3d.granite.GeometryStep
icyllis.arc3d.granite.geom.CircleProcessor

public class CircleProcessor extends GeometryStep
The output of this effect is a modulation of the input color and coverage for a circle. It operates in a space normalized by the circle radius (outer radius in the case of a stroke) with origin at the circle center. Three vertex/instance attributes are used:

- vec2 : position in local space of the bounding geometry vertices
- vec4 : (p.xy, outerRad, innerRad) p is the position in the normalized local space. outerRad is the outerRadius in local space. innerRad is the innerRadius in normalized local space (ignored if not stroking).
- vec4 : color

Additional clip planes are supported for rendering circular arcs. The additional planes are either intersected or unioned together. Up to three planes are supported (an initial plane, a plane intersected with the initial plane, and a plane unioned with the first two). Only two are useful for any given arc, but having all three in one instance allows combining different types of arcs. Round caps for stroking are allowed as well. The caps are specified as two circle center points in the same space as p.xy.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class icyllis.arc3d.granite.GeometryStep

  `GeometryStep.ProgramImpl`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final VertexInputLayout.Attribute`
  `CIRCLE_EDGE`
  `static final VertexInputLayout.Attribute`
  `CLIP_PLANE`
  Per-instance attributes (optional).
  `static final VertexInputLayout.Attribute`
  `COLOR`
  Per-instance attributes.
  `static final VertexInputLayout.AttributeSet`
  `INSTANCE_FORMAT`
  `static final VertexInputLayout.Attribute`
  `ISECT_PLANE`
  Per-instance attributes (optional).
  `static final VertexInputLayout.Attribute`
  `MODEL_VIEW`
  `static final VertexInputLayout.Attribute`
  `POSITION`
  Per-vertex attributes.
  `static final VertexInputLayout.Attribute`
  `ROUND_CAP_CENTERS`
  Per-instance attributes (optional).
  `static final VertexInputLayout.Attribute`
  `UNION_PLANE`
  Per-instance attributes (optional).
  `static final VertexInputLayout.AttributeSet`
  `VERTEX_FORMAT`

  ### Fields inherited from class icyllis.arc3d.granite.GeometryStep

  `DEPTH, FLAG_EMIT_COVERAGE, FLAG_EMIT_PRIMITIVE_COLOR, FLAG_HANDLE_SOLID_COLOR, FLAG_HAS_TEXTURES, FLAG_OUTSET_BOUNDS_FOR_AA, FLAG_PERFORM_SHADING, SOLID_COLOR`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CircleProcessor(boolean stroke, boolean clipPlane, boolean isectPlane, boolean unionPlane, boolean roundCaps)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `appendToKey(KeyBuilder b)`
  Appends a key on the KeyBuilder that reflects any variety in the code that the geometry processor subclass can emit.
  `GeometryStep.ProgramImpl`
  `makeProgramImpl(ShaderCaps caps)`
  Returns a new instance of the appropriate implementation class for the given GeometryProcessor.

  ### Methods inherited from class icyllis.arc3d.granite.GeometryStep

  `appendAttributesToKey, depthStencilFlags, depthStencilSettings, emitFragmentColorCode, emitFragmentCoverageCode, emitSamplers, emitsCoverage, emitsPrimitiveColor, emitUniforms, emitVaryings, emitVertexGeomCode, getInputLayout, handlesSolidColor, hasInstanceAttributes, hasVertexAttributes, instanceAttributes, instanceBinding, instanceStride, makeColorAttribute, name, numInstanceAttributes, numInstanceLocations, numTextureSamplers, numVertexAttributes, numVertexLocations, performsShading, primitiveType, textureSamplerState, textureSamplerSwizzle, uniqueID, vertexAttributes, vertexBinding, vertexStride, writeMesh, writeUniformsAndTextures`

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

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

- ## Field Details

  - ### POSITION

    public static final VertexInputLayout.Attribute POSITION
    Per-vertex attributes.

  - ### CIRCLE_EDGE

    public static final VertexInputLayout.Attribute CIRCLE_EDGE

  - ### COLOR

    public static final VertexInputLayout.Attribute COLOR
    Per-instance attributes.

  - ### CLIP_PLANE

    public static final VertexInputLayout.Attribute CLIP_PLANE
    Per-instance attributes (optional).

  - ### ISECT_PLANE

    public static final VertexInputLayout.Attribute ISECT_PLANE
    Per-instance attributes (optional).

  - ### UNION_PLANE

    public static final VertexInputLayout.Attribute UNION_PLANE
    Per-instance attributes (optional).

  - ### ROUND_CAP_CENTERS

    public static final VertexInputLayout.Attribute ROUND_CAP_CENTERS
    Per-instance attributes (optional).

  - ### MODEL_VIEW

    public static final VertexInputLayout.Attribute MODEL_VIEW

  - ### VERTEX_FORMAT

    public static final VertexInputLayout.AttributeSet VERTEX_FORMAT

  - ### INSTANCE_FORMAT

    public static final VertexInputLayout.AttributeSet INSTANCE_FORMAT

- ## Constructor Details

  - ### CircleProcessor

    public CircleProcessor(boolean stroke, boolean clipPlane, boolean isectPlane, boolean unionPlane, boolean roundCaps)

- ## Method Details

  - ### appendToKey

    public void appendToKey(@Nonnull KeyBuilder b)
    Description copied from class: `GeometryStep`
    Appends a key on the KeyBuilder that reflects any variety in the code that the geometry processor subclass can emit.
    Specified by:
      `appendToKey` in class `GeometryStep`
    See Also:
      - `GeometryStep.makeProgramImpl(ShaderCaps)`

  - ### makeProgramImpl

    @Nonnull public GeometryStep.ProgramImpl makeProgramImpl(ShaderCaps caps)
    Description copied from class: `GeometryStep`
    Returns a new instance of the appropriate implementation class for the given GeometryProcessor. This method is called only when the specified key does not exist in the program cache.
    Specified by:
      `makeProgramImpl` in class `GeometryStep`
    See Also:
      - `GeometryStep.appendToKey(KeyBuilder)`