This file contains hidden or 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
| export default function () { | |
| return { | |
| fragment: { | |
| uniform: { | |
| u_light: 'vec3', | |
| u_dark: 'vec3' | |
| }, | |
| main: `vec3 gray = vec3(dot(lumcoeff, color)); | |
| color = mix(u_dark, u_light, gray);` | |
| uniforms: [ |
This file contains hidden or 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
| import {Kampos, effects, Ticker} from 'kampos'; | |
| const target1 = document.querySelector('#canvas1'); | |
| const media1 = document.querySelector('#video1'); | |
| const target2 = document.querySelector('#canvas2'); | |
| const media2 = document.querySelector('#video2'); | |
| const hueSaturation = effects.hueSaturation(); | |
| const brightnessContrast = effects.brightnessContrast(); |
This file contains hidden or 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
| import {Kampos, effects, Ticker} from 'kampos'; | |
| const ticker = new Ticker(); | |
| const kampos = new Kampos({target, effects: [effects.hueSaturation()], ticker}); | |
| const kampos2 = new Kampos({target2, effects: [effects.hueSaturation()], ticker}); | |
| // rest of drawing logic ... | |
| ticker.start(); |
OlderNewer