Page 1 of 1


Posted: Wed Jul 10, 2019 9:39 am
by Administrator
Add a GLSL Fragment Shader to your fourm with bbcode and javascript files added to your installation of phpbb.



HTML Replacement
/* must be executed instantly */
let script = document.currentScript || (function() {
var scripts = document.getElementsByTagName("script");
return scripts[scripts.length - 1];

document.addEventListener("DOMContentLoaded", function(){
/* check to see if setBackgroundCanvas/GLSLFragmentShader have Been Applied */

if(typeof Element.prototype.setBackgroundCanvas !== "undefined"){
/* setBackgroundCanvas Already Loaded */

if(typeof window.GLSLFragmentShader !== "undefined"){

let ele1 = $(script).closest(".post")[0]; = "none";

let GLSLJson = "{URL1}";

let glslFragmentShader = new GLSLFragmentShader(ele1, GLSLJson);


ele1.glslFragmentShaderLoaded = function(){

ele1.size = 1;

ele1.removeEventListener("GLSLFragmentShaderLoaded", ele1.glslFragmentShaderLoaded);


ele1.backgroundCanvasLoaded = function(){

/* cleanup */
document.body.removeEventListener("BackgroundCanvasLoaded", ele1.backgroundCanvasLoaded);


ele1.addEventListener("BackgroundCanvasLoaded", ele1.backgroundCanvasLoaded, false);

ele1.addEventListener("GLSLFragmentShaderLoaded", ele1.glslFragmentShaderLoaded, false);

console.log("This template does not support GLSLFragmentShader");
console.log("This template does not support setBackgroundCanvas ");


Help Line

Load a GLSLFragmentShader Behind the Post


Add the following Files to the installation of phpbb, put each project in it's own folder setBackgroundCanvas and GLSLFragmentShader respectively. The setBackgroundcanvas Project was designed for npm use this version instead below as it include all the required functions

assets/setBackgroundCanvas/setBackgroundCanvas.js ... tShader.js

Edit the overall_header.php file of your installation template that your using and add the following two lines before the closing head tag.

<script src="{T_ASSETS_PATH}/setBackgroundCanvas/setBackgroundCanvas.js"></script>
<script src="{T_ASSETS_PATH}/GLSLFragmentShader/GLSLFragmentShader.js"></script>