Skip to content

Instantly share code, notes, and snippets.

View PixelsCommander's full-sized avatar

Denis Radin PixelsCommander

View GitHub Profile
@PixelsCommander
PixelsCommander / gist:f9ce6d5b8ca91d640d9d0cdc8d03dff5
Last active September 6, 2018 12:23
FPS meter for RNG games, pug to GameBase.assetsLoaded
const FPSMeter = document.createElement("div");
FPSMeter.id = "fpsLabel";
FPSMeter.style.fontSize = "24px";
FPSMeter.style.position = "absolute";
FPSMeter.style.right = "0";
FPSMeter.style.top = "0";
FPSMeter.style.backgroundColor = "#000";
FPSMeter.style.color = "#fff";
FPSMeter.style.zIndex = "99999";
@PixelsCommander
PixelsCommander / gist:0727c833c9bdf4bbbd18552f2063d0c1
Created September 4, 2018 11:55
There is no built in way in BabylonJS to measure total number of vertices so here we go
// TODO check for instanced, should we exclude them from count?
// TODO check for invisible
let verticesCounted = 0;
let indicesCounted = 0;
export function totalVertices(scene: Scene): { vertices: number; indices: number; } {
verticesCounted = 0;
scene.meshes.forEach((mesh) => {
if (mesh) {
@PixelsCommander
PixelsCommander / proposal.md
Last active April 27, 2020 13:16
Rasterization API proposal

Rasterization API

Abstract

Rasterization API defines interface for making snapshots from HTML elements.

Introduction