Class Effects
java.lang.Object
lol.trq.helios.effect.Effects
- All Implemented Interfaces:
AutoCloseable
Screen effects: background blur behind a shape, and bloom.
Both work on the framebuffer bound when they are called, and assume drawing units are screen space with the
origin at the top left, as on a Minecraft GUI screen: a point (x, y) is at framebuffer pixel
(x / pixel, y / pixel) from the top left.
-
Constructor Summary
ConstructorsConstructorDescriptionEffects(GlBackend gl, GlStateCache cache, Passes passes, ShapeBatch batch) Creates the effects. -
Method Summary
Modifier and TypeMethodDescriptionvoidBloom: draws the glow sources into an offscreen buffer, blurs it, and adds the result onto the bound framebuffer.voidblurBehind(float x, float y, float width, float height, float radius, float pixel, int iterations, float offset, int tint) Blurs what is already drawn behind a rounded rectangle and draws the result inside it, the frosted glass effect.voidclose()Deletes the batch the effects draw through.
-
Constructor Details
-
Effects
Creates the effects.- Parameters:
gl- the backendcache- the host's state cachepasses- the shared passesbatch- the batch used to draw blurred results through a shape
-
-
Method Details
-
blurBehind
public void blurBehind(float x, float y, float width, float height, float radius, float pixel, int iterations, float offset, int tint) Blurs what is already drawn behind a rounded rectangle and draws the result inside it, the frosted glass effect.- Parameters:
x- lefty- topwidth- widthheight- heightradius- corner radiuspixel- one framebuffer pixel in drawing unitsiterations- blur strength, 1 to 8; each step roughly doubles the radiusoffset- tap spread, usually 1 to 4tint- colour the blurred image is multiplied by;0xFFFFFFFFfor none
-
bloom
Bloom: draws the glow sources into an offscreen buffer, blurs it, and adds the result onto the bound framebuffer. The sources themselves are not drawn on screen; draw them again normally if they should show.- Parameters:
sources- draws the glowing parts, in the current projection; the offscreen buffer is bound and clearediterations- blur strength, 1 to 8offset- tap spread, usually 1 to 4intensity- how strongly the glow is added; 1 adds it once
-
close
public void close()Deletes the batch the effects draw through.- Specified by:
closein interfaceAutoCloseable
-