-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
93 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { render, RGBA } from '../renderer' | ||
|
||
const scanlineIntensity = 0.15 | ||
const scanlineThickness = 3 | ||
|
||
export function scanline(source: Buffer, width: number, height: number): Buffer { | ||
return render(source, width, height, (uv, texture2D) => { | ||
const scanlinePosition = Math.floor(uv[1] * height) | ||
|
||
const onScanline = scanlinePosition % scanlineThickness === 0 | ||
|
||
const samplerColor = texture2D(uv) | ||
|
||
const scanlineBrightness = onScanline ? 1 - scanlineIntensity : 1 | ||
|
||
return multiply(samplerColor, scanlineBrightness) | ||
}) | ||
} | ||
|
||
function multiply(color: RGBA, factor: number): RGBA { | ||
return [color[0] * factor, color[1] * factor, color[2] * factor, color[3]] | ||
} |
Binary file modified
BIN
+38.3 KB
(120%)
...nder-card-with-all-commits-custom-color-background-and-screen-effect-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+347 KB
...e-test-ts-theme-with-screen-effect-render-card-with-blue-chill-theme-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+463 KB
...t-theme-test-ts-theme-with-screen-effect-render-card-with-fuji-theme-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+571 KB
...heme-test-ts-theme-with-screen-effect-render-card-with-journey-theme-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+349 KB
...st-theme-test-ts-theme-with-screen-effect-render-card-with-lax-theme-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+367 KB
...theme-test-ts-theme-with-screen-effect-render-card-with-monica-theme-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+345 KB
...heme-test-ts-theme-with-screen-effect-render-card-with-rainbow-theme-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+630 KB
...me-test-ts-theme-with-screen-effect-render-card-with-road-trip-theme-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+352 KB
...theme-test-ts-theme-with-screen-effect-render-card-with-summer-theme-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+161 KB
...th-screen-effect-render-card-with-summer-theme-and-custom-background-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+350 KB
...me-with-screen-effect-render-card-with-summer-theme-and-custom-color-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters