0.0.12 • Published 4 years ago

@gpujs/expo-gl v0.0.12

Weekly downloads
13
License
MIT
Repository
github
Last release
4 years ago

@gpujs/expo-gl - A GPU.js extender for use with React Native's Expo library

This package allows you to use GPU.js with Expo to get a native GPGPU.

Installation

  1. Setup Expo - https://docs.expo.io/versions/latest/introduction/installation/
  2. Add the following to use @gpujs/expo-gl:
      import { GLView } from 'expo-gl';
      import { GPU } from '@gpujs/expo-gl';
      GLView.createContextAsync()
        .then(context => {
          const gpu = new GPU({ context });
          const kernel = gpu.createKernel(kernelFunctionHere, kernelOptionsHere);
          kernel();
        });
  3. Visit https://github.com/gpujs/gpu.js for documentation on kernelFunctionHere, kernelOptionsHere, as well as the api.
  4. Run your expo from Android or iOS and have native GPGPU support!
  5. Have fun!

Example

import { GLView } from 'expo-gl';
import { GPU } from '@gpujs/expo-gl';
GLView.createContextAsync()
  .then(context => {
    const gpu = new GPU({ context });
    const kernel = gpu.createKernel(function() {
      return 1;
    }, { output: [1], debug: true });
    console.log(kernel());
    gpu.destroy();
  });
0.0.10

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago

0.0.0

5 years ago