PixelArtCrt
CRT and LCD display simulation for pixel art. Runs once per screen pixel over a low
resolution render texture (see ceramic.PixelArt in CRT mode, which owns the
parameters and their documentation).
Techniques borrowed, with their origin:
- crt-lottes by Timothy Lottes (public domain): Gaussian pixel reconstruction (
gaus,
horz3, horz5), scanline weights (scan and the three-row sum in main), the four
phosphor masks (maskTv, maskAperture, maskVgaStretched, maskVga), the warp
curvature and the halo + mask composition in linear light.
- crtemu by Mattias Gustavsson (MIT or public domain): low resolution pre-blur for the halo
(rendered by
ceramic.PixelArt, sampled here as bloomTex), the vignette formula,
grain and flicker.
- gba-color by Pokefan531, after hunterk's Color Mangler (public domain): color matrix and
luminance applied in linear light; the GBA values live in
ceramic.PixelArtPreset.
- SameBoy LCD shader by LIJI32 (MIT): the idea of splitting a pixel in three RGB subpixels
with darker gaps (
maskLcd), rewritten.
- crt-geom by cgwg, Themaister and DOLLS (GPL, no code taken): the idea that the beam
widens with brightness (
beamScale).
- Pixel art antialiasing as described by Inigo Quilez, Themaister, Claudio Fernandes and
Ben Golus: bilinear interpolation limited to a band one output pixel wide around texel
edges (
sharpTexel).
Instance Members
The filter on screen, in screen pixels: origin in xy, size in zw. Gives each
fragment its screen position, so that phosphor masks stay fixed on the screen like
the glass of a real tube, whatever the content does (gl_FragCoord is not available
on every target)
shade
projectionMatrix(m00: Float, m10: Float, m20: Float, m30: Float, m01: Float, m11: Float, m21: Float, m31: Float, m02: Float, m12: Float, m22: Float, m32: Float, m03: Float, m13: Float, m23: Float, m33: Float): Void
shade
modelViewMatrix(m00: Float, m10: Float, m20: Float, m30: Float, m01: Float, m11: Float, m21: Float, m31: Float, m02: Float, m12: Float, m22: Float, m32: Float, m03: Float, m13: Float, m23: Float, m33: Float): Void
shade
mainTex(texture: shade.Sampler2D): Void
Private Members
shade
resolveTextureSlot(name: String): Int
| Name |
Parameters |
:build |
shade.macros.ShadeMacro.buildShaderClassFields() |
:autoBuild |
shade.macros.ShadeMacro.buildShaderClassFields() |
:build |
ceramic.macros.EntityMacro.buildForCompletion() |
:autoBuild |
ceramic.macros.EntityMacro.buildForCompletion() |
:build |
tracker.macros.EventsMacro.build() |
:autoBuild |
tracker.macros.EventsMacro.build() |