EdgeSmoothing
final class EdgeSmoothing
Package: dev.joid.lib.render.tessellator · Module: core · Source: EdgeSmoothing.java
Draws convex shapes with a soft edge one screen pixel wide, so that a rotated or scaled shape stays smooth without multisampling.
Description
Section titled “Description”DrawShape and DrawResource use it under a rotation or a fractional scale; you call it only to smooth geometry of your own.
Coordinates are in screen pixels of the current matrices: the edge fades over half a pixel inside and half a pixel outside the outline.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
boolean | isConvex(Point… points) static | If true, the points, in order, form a convex polygon of 3 points or more; aligned points are allowed. |
void | polygon(float red, float green, float blue, float alpha, Point… points) static | Draws the convex polygon through points in the color red, green, blue, alpha on 1, with a soft edge; a polygon thinner than one pixel draws with its coverage as opacity. |
void | rect(double left, double top, double right, double bottom, double[] uv, float red, float green, float blue, float alpha) static | Draws the rectangle from left, top to right, bottom with a soft edge, textured by the bound texture between the coordinates uv (u0, v0, u1, v1), and tinted by the color on 1. |
Method details
Section titled “Method details”isConvex
Section titled “isConvex”boolean isConvex(Point... points) static
If true, the points, in order, form a convex polygon of 3 points or more; aligned points are allowed.
polygon
Section titled “polygon”void polygon(float red, float green, float blue, float alpha, Point... points) static
Draws the convex polygon through points in the color red, green, blue, alpha on 1, with a soft edge; a polygon thinner than one pixel draws with its coverage as opacity.
void rect(double left, double top, double right, double bottom, double[] uv, float red, float green, float blue, float alpha) static
Draws the rectangle from left, top to right, bottom with a soft edge, textured by the bound texture between the coordinates uv (u0, v0, u1, v1), and tinted by the color on 1.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
