I want to add a shader effect to YouTube videos.
My current approach involves using Three.js to implement a shader on a video. Specifically, I am trying to adapt this example of applying a shader to a video (code available here) into a Tampermonkey userscript for use on youtube.com.
Are the @require
statements accurately converted from the original import
statements? How can I address the issues with
eslint: no-undef - 'THREE' is not defined
, eslint: no-undef - 'PerspectiveCamera' is not defined
(if I remove THREE.
assuming direct import from three.module.js
), and eslint: no-undef - 'RenderPass' is not defined
?
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?domain=tampermonkey.net
// @grant none
// @require https://raw.githubusercontent.com/mrdoob/three.js/master/build/three.module.js
// @require https://raw.githubusercontent.com/mrdoob/three.js/master/examples/jsm/postprocessing/EffectComposer.js
// @require https://raw.githubusercontent.com/mrdoob/three.js/master/examples/jsm/postprocessing/RenderPass.js
// @require https://raw.githubusercontent.com/mrdoob/three.js/master/examples/jsm/postprocessing/ShaderPass.js
// @require https://raw.githubusercontent.com/mrdoob/three.js/master/examples/jsm/postprocessing/BloomPass.js
// @require https://raw.githubusercontent.com/mrdoob/three.js/master/examples/jsm/shaders/CopyShader.js
// ==/UserScript==
(function() {
'use strict';
// Your code here...
// Code goes here...
})();
Displayed below is a screenshot of the encountered errors: https://i.sstatic.net/Zk3uI.png