Class AnalyticSimpleBoxStep
Always use instanced rendering, without per-vertex data, without index buffer, without uniforms, emits coverage. Supports solid color, supports over-stroking, supports device-independent antialiasing, supports 32 bit-per-channel color input, support lines in local coordinates, supports hard-edge coverage (no AA), supports any local-to-device transforms.
This class provides a blur variant: similar to normal AA, but fills a rounded rectangle by first applying an approximate Gaussian filter to the mask in local space, and paint with colors. No actual analytic AA in blur variant.
-
Nested Class Summary
Nested classes/interfaces inherited from class icyllis.arc3d.granite.GeometryStep
GeometryStep.ProgramImpl -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VertexInputLayout.AttributeBitfield:
16-32 bits: painter's depth;
4-5 bits: join;
2-4 bits: dir;
0-2 bits: type;
join=0: round, join=1: miter;
dir=0: inside, dir=1: center, dir=2: outside;
type=0: rect, type=1: round line, type=2 butt line;static final VertexInputLayout.AttributeSetstatic final VertexInputLayout.Attribute(left, top, right, bottom) or ((startX, startY), (stopX, stopY))static final VertexInputLayout.AttributeX is corner radius for rect or half width for line.
Y is stroke radius if stroked, or -1.0 if filled.
Z is local AA radius.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, MODEL_VIEW, SOLID_COLOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendToKey(@NonNull KeyBuilder b) Appends a key on the KeyBuilder that reflects any variety in the code that the geometry processor subclass can emit.voidemitFragmentColorCode(Formatter fs, String outputColor) Emits the fragment color code into the fragment shader.voidemitFragmentCoverageCode(Formatter fs, String outputCoverage) Emits the fragment coverage code into the fragment shader.voidemitUniforms(UniformHandler uniformHandler, boolean mayRequireLocalCoords) voidemitVaryings(VaryingHandler varyingHandler, boolean usesFastSolidColor) voidemitVertexGeomCode(Formatter vs, @NonNull String worldPosVar, @Nullable String localPosVar, boolean usesFastSolidColor) Emits the geometry code into the vertex shader.@NonNull GeometryStep.ProgramImplmakeProgramImpl(ShaderCaps caps) Returns a new instance of the appropriate implementation class for the given GeometryProcessor.voidwriteMesh(MeshDrawWriter writer, Draw draw, float @Nullable [] solidColor, boolean mayRequireLocalCoords) Methods inherited from class icyllis.arc3d.granite.GeometryStep
appendAttributesToKey, depthStencilFlags, depthStencilSettings, emitFragmentDefinitions, emitSamplers, emitsCoverage, emitsPrimitiveColor, emitVertexDefinitions, getInputLayout, handlesSolidColor, hasInstanceAttributes, hasVertexAttributes, instanceAttributes, instanceBinding, instanceStride, makeColorAttribute, name, numInstanceAttributes, numInstanceLocations, numTextureSamplers, numVertexAttributes, numVertexLocations, performsShading, primitiveType, textureSamplerState, textureSamplerSwizzle, uniqueID, vertexAttributes, vertexBinding, vertexStride, writeUniformsAndTextures
-
Field Details
-
LOCAL_RECT
(left, top, right, bottom) or ((startX, startY), (stopX, stopY)) -
RADII
X is corner radius for rect or half width for line.
Y is stroke radius if stroked, or -1.0 if filled.
Z is local AA radius.In blur variant: Y is blur radius, Z is noise alpha.
-
FLAGS_AND_DEPTH
Bitfield:
16-32 bits: painter's depth;
4-5 bits: join;
2-4 bits: dir;
0-2 bits: type;
join=0: round, join=1: miter;
dir=0: inside, dir=1: center, dir=2: outside;
type=0: rect, type=1: round line, type=2 butt line; -
INSTANCE_ATTRIBS
-
-
Constructor Details
-
AnalyticSimpleBoxStep
public AnalyticSimpleBoxStep(boolean blur)
-
-
Method Details
-
appendToKey
Description copied from class:GeometryStepAppends a key on the KeyBuilder that reflects any variety in the code that the geometry processor subclass can emit.- Specified by:
appendToKeyin classGeometryStep- See Also:
-
makeProgramImpl
Description copied from class:GeometryStepReturns 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:
makeProgramImplin classGeometryStep- See Also:
-
emitVaryings
- Overrides:
emitVaryingsin classGeometryStep
-
emitUniforms
- Overrides:
emitUniformsin classGeometryStep
-
emitVertexGeomCode
public void emitVertexGeomCode(Formatter vs, @NonNull String worldPosVar, @Nullable String localPosVar, boolean usesFastSolidColor) Description copied from class:GeometryStepEmits the geometry code into the vertex shader. Implementation must define "vec4 worldPosVar" with the given name and setup it. If localPosVar is not null, then it must write geometry's local pos to it.- Overrides:
emitVertexGeomCodein classGeometryStep
-
emitFragmentColorCode
Description copied from class:GeometryStepEmits the fragment color code into the fragment shader. This is either paint's solid color or per-vertex primitive color. SeeGeometryStep.FLAG_HANDLE_SOLID_COLORandGeometryStep.FLAG_EMIT_PRIMITIVE_COLOR.- Overrides:
emitFragmentColorCodein classGeometryStep
-
emitFragmentCoverageCode
Description copied from class:GeometryStepEmits the fragment coverage code into the fragment shader.If
GeometryStep.emitsCoverage()is false, this method is called for hard-edge coverage, discard the fragment if coverage is 0. Otherwise outputCoverage is non-null, and coverage will involve in blending operations.- Overrides:
emitFragmentCoverageCodein classGeometryStep
-
writeMesh
public void writeMesh(MeshDrawWriter writer, Draw draw, float @Nullable [] solidColor, boolean mayRequireLocalCoords) - Overrides:
writeMeshin classGeometryStep
-