Wireframe script for CubeRealm! Makes blocks mostly invisible, while you can still see what block it is (not just glass). Great for dungeon searching!
// ==UserScript==
// @name Cuberealm.io Wireframe Mode
// @namespace cooluser1481
// @match https://cuberealm.io/*
// @version 1.0.2
// @author cooluser1481
// @description Wireframe script for CubeRealm! Makes blocks mostly invisible, while you can still see what block it is (not just glass). Great for dungeon searching!
// @license GPL3
// ==/UserScript==
(function() {
'use strict';
// original drawing methods
const originalDrawElements = WebGL2RenderingContext.prototype.drawElements;
const originalDrawArrays = WebGL2RenderingContext.prototype.drawArrays;
// drawElements function cuberealm uses to draw
WebGL2RenderingContext.prototype.drawElements = function(mode, count, type, offset) {
// replace triangle with lines for wireframe mesh
if (mode === this.TRIANGLES) {
mode = this.LINES; // LINE_STRIP is worse
}
return originalDrawElements.call(this, mode, count, type, offset);
};
// Patch this as well
WebGL2RenderingContext.prototype.drawArrays = function(mode, first, count) {
if (mode === this.TRIANGLES) {
mode = this.LINE_LOOP;
}
return originalDrawArrays.call(this, mode, first, count);
};
})();