PixelArtCrt_Frag
precision: 'highp': screen positions reach the thousands, which a mediump float
(10 bit mantissa) cannot resolve to the pixel.
Instance Members
Private Members
Flicker frequency, in radians per second
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
scanlineStrength: Float
shade
lcdGridStrength: Float
shade
lcdSubpixelLow: Float
shade
vignetteStrength: Float
shade
noiseStrength: Float
shade
flickerStrength: Float
Rec. 709 luma weights
Display to linear light (no-op when gamma is 0)
Linear light back to display (no-op when gamma is 0)
Lottes Fetch: the texel off texels away from the one under pos, in linear light
Lottes Dist: distance from the center of the texel under pos, in texels (-0.5 to 0.5)
Lottes Gaus: 1D Gaussian, scale is negative (hardPix, hardScan)
Lottes Horz3: 3-tap Gaussian reconstruction along x of the source row off
Lottes Horz5: 5-tap Gaussian reconstruction along x of the source row off
Width of the beam drawing a row of the given color: the crt-geom idea
(brighter rows draw a wider beam), applied to the Lottes scanline Gaussian
Lottes Scan: weight of the source row off at this position, for a beam of width scale
Pixel art antialiasing (Quilez, Themaister, Fernandes, Golus): nearest texel, with
bilinear interpolation only within a band of sharpBand output pixels around texel
edges, so that sub-pixel scrolling stays smooth without blurring the pixels
Lottes: one RGB triad per three cells along x (in cells)
Lottes mask 1: compressed TV style shadow mask, triads offset every other line
Lottes mask 2: aperture grille
Lottes mask 3: stretched VGA style shadow mask
Lottes mask 4: VGA style shadow mask
LCD (after SameBoy): each source pixel split in three RGB subpixels, with a dark grid
between pixels. Tied to source pixels, not screen pixels: one game pixel is one LCD pixel
uv: image coordinates (after curvature), for the LCD mask tied to source pixels.
screenPos: fragment position in screen pixels, for the phosphor masks
Lottes Warp: barrel distortion of the image coordinates
Rounded rectangle in source pixels: 1 inside, 0 outside. Also hides what the
curvature pushed outside the image
crtemu vignette: 1 at the center, darker towards the edges
The usual one-line GLSL hash
| Name |
Parameters |
:build |
shade.macros.ShadeMacro.buildFragVertForHaxe() |
:autoBuild |
shade.macros.ShadeMacro.buildFragVertForHaxe() |
shade |
{ precision : "highp" } |