All Projects → TimvanScherpenzeel → Detect Gpu

TimvanScherpenzeel / Detect Gpu

Licence: mit
Classifies GPUs based on their 3D rendering benchmark score allowing the developer to provide sensible default settings for graphically intensive applications.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Detect Gpu

detect-gpu
Classifies GPUs based on their 3D rendering benchmark score allowing the developer to provide sensible default settings for graphically intensive applications.
Stars: ✭ 749 (+62.83%)
Mutual labels:  threejs, device, hardware, detection, pixijs, webgl2
Sky Shader
☀️ WebGL sky and sun shader editor
Stars: ✭ 90 (-80.43%)
Mutual labels:  webgl, threejs, demo
Threejs Starter
Stars: ✭ 89 (-80.65%)
Mutual labels:  webgl, threejs, webgl2
Interactive Repulsive Effect
🍫 An interactive repulsion effect of grid items as seen in BestServedBold's Dribbble shot "Holographic-Interactions".
Stars: ✭ 141 (-69.35%)
Mutual labels:  webgl, threejs, demo
Glchaos.p
3D GPUs Strange Attractors and Hypercomplex Fractals explorer - up to 256 Million particles in RealTime
Stars: ✭ 590 (+28.26%)
Mutual labels:  webgl, webgl2, gpu
Polygon Shredder
The polygon shredder that takes many cubes and turns them into confetti
Stars: ✭ 686 (+49.13%)
Mutual labels:  webgl, threejs, demo
Ray Tracing Renderer
[UNMAINTAINED] Real-time path tracing on the web with three.js
Stars: ✭ 444 (-3.48%)
Mutual labels:  webgl, threejs, webgl2
Sketch
Explorations on cross-hatching, engraving, and similar non-photorealistic rendering.
Stars: ✭ 136 (-70.43%)
Mutual labels:  webgl, threejs, webgl2
Interactivelandscape
An exploration of an animated interactive landscape built with three.js.
Stars: ✭ 150 (-67.39%)
Mutual labels:  webgl, threejs, demo
Texture Compressor
CLI tool for texture compression using ASTC, ETC, PVRTC and S3TC in a KTX container.
Stars: ✭ 156 (-66.09%)
Mutual labels:  webgl, threejs, gpu
detect-features
Detect and report browser and hardware features.
Stars: ✭ 63 (-86.3%)
Mutual labels:  hardware, detection, webgl2
Regl Cnn
Digit recognition with Convolutional Neural Networks in WebGL
Stars: ✭ 490 (+6.52%)
Mutual labels:  webgl, gpu, demo
Terrain Builder
🏔 Procedural terrain using Three.js and perlin noise, Now Accelerated by your GPU!
Stars: ✭ 228 (-50.43%)
Mutual labels:  threejs, gpu, demo
Sunset Cyberspace
🎮👾Retro-runner Game made in Expo, Three.js, OpenGL, WebGL, Tween. 🕹
Stars: ✭ 54 (-88.26%)
Mutual labels:  webgl, threejs, webgl2
Parser Javascript
Browser sniffing gone too far — A useragent parser library for JavaScript
Stars: ✭ 66 (-85.65%)
Mutual labels:  detection, device, browser
Jeelizfacefilter
Javascript/WebGL lightweight face tracking library designed for augmented reality webcam filters. Features : multiple faces detection, rotation, mouth opening. Various integration examples are provided (Three.js, Babylon.js, FaceSwap, Canvas2D, CSS3D...).
Stars: ✭ 2,042 (+343.91%)
Mutual labels:  webgl, threejs, detection
Glmaps
Data visualization examples and tutorials from scratch. 数据可视化示例代码集与新手学习教程。
Stars: ✭ 288 (-37.39%)
Mutual labels:  webgl, threejs, demo
Moonrider
🌕🏄🏿 Surf the musical road among the stars. Side project built by two people in a few months to demonstrate WebXR.
Stars: ✭ 292 (-36.52%)
Mutual labels:  webgl, threejs, browser
Three.phenomenon
⭐️ A tiny wrapper around three.js built for high-performance WebGL experiences.
Stars: ✭ 338 (-26.52%)
Mutual labels:  webgl, threejs
Metacar
A reinforcement learning environment for self-driving cars in the browser.
Stars: ✭ 337 (-26.74%)
Mutual labels:  pixijs, browser

Detect GPU

Build Status npm version gzip size install size

Classifies GPUs based on their 3D rendering benchmark score allowing the developer to provide sensible default settings for graphically intensive applications. Think of it like a user-agent detection for the GPU but more powerful.

Sponsor

BTC

ETH

DASH

LTC

Demo

Live demo

Installation

By default we use the UNPKG CDN to host the benchmark data. If you would like to serve the benchmark data yourself download the required benchmarking data from benchmarks.tar.gz and serve it from a public directory.

Make sure you have Node.js installed.

 $ npm install detect-gpu

Usage

import { getGPUTier } from 'detect-gpu';

(async () => {
  const gpuTier = await getGPUTier();

  // Example output:
  // {
  //   "tier": 1,
  //   "isMobile": false,
  //   "type": "BENCHMARK",
  //   "fps": 21,
  //   "gpu": "intel iris graphics 6100"
  // }
})();

detect-gpu uses rendering benchmark scores (framerate, normalized by resolution) in order to determine what tier should be assigned to the user's GPU. If no WebGLContext can be created, the GPU is blocklisted or the GPU has reported to render on less than 15 fps tier: 0 is assigned. One should provide a fallback to a non-WebGL experience.

Based on the reported fps the GPU is then classified into either tier: 1 (>= 15 fps), tier: 2 (>= 30 fps) or tier: 3 (>= 60 fps). The higher the tier the more graphically intensive workload you can offer to the user.

API

getGPUTier({
  /**
   * URL of directory where benchmark data is hosted.
   *
   * @default https://unpkg.com/[email protected]{version}/dist/benchmarks
   */
  benchmarksURL?: string;
  /**
   * Optionally pass in a WebGL context to avoid creating a temporary one
   * internally.
   */
  glContext?: WebGLRenderingContext | WebGL2RenderingContext;
  /**
   * Whether to fail if the system performance is low or if no hardware GPU is
   * available.
   *
   * @default true
   */
  failIfMajorPerformanceCaveat?: boolean;
  /**
   * Framerate per tier for mobile devices.
   *
   * @defaultValue [0, 15, 30, 60]
   */
  mobileTiers?: number[];
  /**
   * Framerate per tier for desktop devices.
   *
   * @defaultValue [0, 15, 30, 60]
   */
  desktopTiers?: number[];
  /**
   * Optionally override specific parameters. Used mainly for testing.
   */
  override?: {
    renderer?: string;
    /**
     * Override whether device is an iPad.
     */
    isIpad?: boolean;
    /**
     * Override whether device is a mobile device.
     */
    isMobile?: boolean;
    /**
     * Override device screen size.
     */
    screenSize?: { width: number; height: number };
    /**
     * Override how benchmark data is loaded
     */
    loadBenchmarks?: (file: string) => Promise<ModelEntry[]>;
  };
})

Support

Special care has been taken to make sure all browsers that support WebGL are also supported by detect-gpu including IE 11.

Changelog

Changelog

Licence

My work is released under the MIT license.

detect-gpu uses both mobile and desktop benchmarking scores from https://gfxbench.com.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].