
Product
Introducing Custom Pull Request Alert Comment Headers
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
@khronosgroup/gltf-viewer
Advanced tools
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.
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.
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.
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);
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.
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");
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.
FAQs
The official glTF sample viewer.
We found that @khronosgroup/gltf-viewer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.