Diep Shaders

Nothing to see here

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/372703/632906/Diep%20Shaders.js

  1. (function() {
  2. 'use strict';
  3.  
  4. var c = document.getElementById('canvas');
  5. var ctx = c.getContext("2d");
  6. var c2 = document.createElement('canvas');
  7. var ctx2 = c2.getContext('2d');
  8. var c3 = document.createElement('canvas');
  9. var ctx3 = c3.getContext('2d');
  10. c2.width = c.width;
  11. c2.height = c.height;
  12. c3.width = c.width;
  13. c3.height = c.height;
  14. document.getElementsByTagName('body')[0].appendChild(c2);
  15. document.getElementsByTagName('body')[0].appendChild(c3);
  16. c2.style.position = "absolute";
  17. c2.style.top = "0px";
  18. c2.style.left = "0px";
  19. c2.style.zIndex = -1;
  20. c3.style.position = "absolute";
  21. c3.style.top = "0px";
  22. c3.style.left = "0px";
  23. c3.style.zIndex = -2;
  24. c2.style.filter = "blur(10px) contrast(0%) saturate(0%) brightness(20%)";
  25. window.addEventListener("resize", function() {
  26. c2.width = c.width;
  27. c2.height = c.height;
  28. c3.width = c.width;
  29. c3.height = c.height;
  30. }, false);
  31. var mP = { x: 0, y: 0 };
  32. window.addEventListener("mousemove", function(e) {
  33. mP = { x: e.clientX, y: e.clientY };
  34. }, false);
  35. c.style.opacity = 1;
  36. var i = 0;
  37. var shaderButton = document.createElement('button');
  38. document.getElementsByTagName('body')[0].appendChild(shaderButton);
  39. shaderButton.style = "position:absolute; top:10px; left:10px;";
  40. shaderButton.innerHTML = "On";
  41. shaderButton.onclick = function() {input.set_convar('ren_background', false);}
  42. function loop1() {
  43. i++;
  44. ctx3.fillStyle = "hsl(0, 0%, 90%)";
  45. ctx3.fillRect(0, 0, c2.width, c2.height);
  46. ctx2.clearRect(0, 0, c2.width, c2.height);
  47. ctx2.drawImage(c, 20, 20);
  48. setTimeout(loop1, 1000 / 30);
  49. }
  50. loop1();
  51. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址