npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@khronosgroup/gltf-viewer

v1.1.0

Published

The official glTF sample viewer.

Downloads

40

Readme

Khronos glTF Sample Renderer

This is the official Khronos glTF 2.0 Sample Renderer using WebGL.

Try out the glTF Sample Viewer which uses this renderer in combination with a custom frontend.

Table of Contents

Credits

Developed and refactored by UX3D. Supported by the Khronos Group and by Google for the glTF Draco mesh compression import. Formerly hosted together with the example frontend at the glTF Sample Viewer repository. Original code based on the concluded glTF-WebGL-PBR project. Previously supported by Facebook for animations, skinning and morphing.

Features

API

glTF Sample Renderer is made to be integrated into web applications (see glTF Sample Viewer) or to be used for automated testing (see Render Fidelity Tools).

The API consists of several components that in combination allow flexible configuration of the glTF viewer.

More detailed information about the API is listed in the api documentation.

GltfView

The GltfView component is associated with one WebGL2 context. In practice this means it will be associated with one HTML5 Canvas. This component manages the interaction between the canvas and the GL context. It therefore specifies the viewport, the swapchain and can be used to schedule frame renders.

const view = new GltfView(webGl2Context);

The view is also used to render frames, either on every window repaint event or on demand, e.g. when taking a frame capture.

const update = () =>
{
    view.renderFrame(state, canvas.width, canvas.height);
    window.requestAnimationFrame(update);
};
window.requestAnimationFrame(update);

GltfState

The GltfState encapsulates the state of the content of a GltfView. As currently some WebGL resources are stored directly in the Gltf objects, the state cannot be shared between views.

const state = view.createState();
state.sceneIndex = 0;
state.animationIndices = [0, 1, 2];
state.animationTimer.start();

The state is passed to the view.renderFrame function to specify the content that should be rendered.

ResourceLoader

The ResourceLoader can be used to load external resources and make them available to the renderer.

state.gltf = await resourceLoader.loadGltf("path/to/some.gltf");

Render Fidelity Tools

The glTF Sample Renderer is integrated into Google's render fidelity tools. The render fidelity tools allow the comparison of different renderers. To run the project follow the instructions here and here. For information on how the glTF Sample Renderer was integrated see the pull request on Github.