Git Product home page Git Product logo

andykswong / mugl Goto Github PK

View Code? Open in Web Editor NEW
98.0 98.0 5.0 7.24 MB

WebGPU and WebGL Micro 3D Graphics Library for JavaScript and WebAssembly

Home Page: https://andykswong.github.io/mugl/examples

License: MIT License

TypeScript 94.48% JavaScript 1.91% HTML 0.50% CSS 0.48% GLSL 2.63%
3d 3d-graphics assemblyscript expo gltf gltf2 html5 javascript react-native renderer typescript wasm webassembly webgl webgl2 webgpu

mugl's People

Contributors

andykswong avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mugl's Issues

glTF Loader / Renderer Optimization

Optimize the size of the model viewer / glTF module, targeting <10 KB (with no/minimal extensions support).

  • Code optimization
  • Optimize and minify shader
    • Support for no OES_standard_derivatives extension
    • Support for WebGL2
  • Allow some features to be turned off

Improve input validations

Add more comprehensive input parameter assertions, and make them tree-shakeable for minimal runtime overhead.
Currently, some checks still exist on production build, while others rely on the following pattern for tree-shaking:

if (process.env.DEBUG) {
  console.warn(...);
}

transform feedback

It'd be nice to be able to do some compute stuff with this library, and to reuse the compute output buffers in render pipelines

Cross Platform Support

Ensure support for desktop and native mobile with examples:

  • Support running on WASM
  • Support expo-gl (Android, iOS, web, Electron)
  • Support node-webgl (desktop)
  • TBD - Support other JS runtimes: QuickJS, Duktape

glTF 2 renderer example

Features:

  • glTF based scene graph model
  • glTF files and resources loader
    • glTF JSON
    • GLB
    • buffers
      • .bin
      • data URI
      • lazy-loading
    • images
      • jpg / png
      • buffer view
      • data URI
      • lazy-loading
  • Renderer support for standard glTF properties
    • scene / node
    • camera (ortho/perspective)
    • accessors / buffers / bufferViews
      • sparse
    • texture / image / sampler
      • mipmap
    • material
      • with alpha-blending
        • partially working, missing depth sorting
    • mesh
      • morph
      • Support for vertex color with vec3 of UNSIGNED_BYTE / UNSIGNED_SHORT
    • skin
    • animation
      • cubic spline animation
  • Support for essential extensions
    • KHR_lights_punctual
      • allow extra lights to be specified
    • EXT_lights_image_based
      • allow IBL background image to be specified
    • EXT_mesh_gpu_instancing
      • Support for particle system
    • EXT_texture_webp
  • Support for material extensions
    • KHR_techniques_webgl
    • KHR_materials_unlit
    • KHR_materials_clearcoat
    • KHR_materials_ior
    • KHR_materials_sheen
    • KHR_materials_specular
    • KHR_materials_transmission
    • KHR_materials_variants
    • KHR_materials_volume
    • KHR_materials_pbrSpecularGlossiness

Optimize the size of the model viewer / glTF module, targeting <20 KB (with no/minimal extensions support):

  • Optimize and minify shader
  • Code optimization
  • Allow some features to be turned off

Webgpu support?

Description

Chrome webgpu support is around the corner, should be finally enable by default in chrome 113 in like ~3 weeks.

Is mugl will remains purely webgl2, or is there any plan to also handle webgpu (maybe providing some webgl2 fallback).
The syntax is really similar and having the combo webgpu + assemblyscript binding sounds really promising.

Support WebXR

Add support for WebXR and multiview (OVR_multiview2 / OCULUS_multiview).
This should be an extension instead of core device feature

Nano device backend improvement

Nano Backend Improvements:

  • Consider dropping WebGL2 support to keep it minimal
  • Document unsupported features
  • Further optimize bundle size

Improve test coverage

  • Device
    • Utils
    • GL2 Backend
      • Resources
      • Pipeline state merge logic
      • Rendering device
    • WebGPU Backend

Fix GLB vs glTF resolution

Currently I simply check the URI suffix for GLB, which may not be good enough. We can instead always load the content as binary and check for the GLB header magic.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.