question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Discussion on the Reference Viewer API

See original GitHub issue

There was a discussion on ux3d/glTF-WebGL-PBR which I would like to bring over to the main repo so that it can be discussed and handled when we have time (or if somebody in the community is willing to contribute to it). It’s regarding how a user would interface with the reference viewer programmatically, and how such an API should look like (and what sort of things we should support). Right now we can load a set of glTF scenes into the reference viewer and view them in a web browser, or render to an image by using a CLI via the build-in headless mode. However it would be a very powerful to be able to control the reference viewer via an API (entirely) as well, and to make it as easy as possible to the user. Right now, this is already possible, but the API is not very user friendly for that, and some things are quite hard to do.

Instead, we would like to be able to write something along these lines:

let viewer = new gltfViewer(canvas);
viewer.loadEnvironment("field.hdr");
viewer.useIBL = true;
viewer.lookAt([0,0,0], [0,1,0], 45);
viewer.load("/assets/BoomBox.gltf");
viewer.render().save("BoomBox.png");
// or hook it to your own callbacks!

This is just an example of course.

This issue is here to brainstorm on how the syntax for something like this should look like, and what sort of things the community would like to be able to control via such an API in the reference viewer that is being developed in the reference-viewer branch. It’s a wish list (to glTF Santa?), that we will integrate (or the community) when we have a good idea on how this should look like, and when we finally have time to integrate this.

Anyway, feel free to come up with ideas 😃

I’ll see if I can dig up Ed’s and Don’s ideas on this since they had some good ones in the previous issue.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:25 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
zellskicommented, Aug 1, 2019

I stumbled into this yesterday, as I put out a version of FBX2glTF and lamented to myself how difficult it is to write end-to-end regression tests for a glTF generator. I have a few ways to test in place already (running the validator, for example). But what I really want is to image-diff (e.g. PSNR or MMSIM) actual renders.

Does anyone have a working example of referencing this repo in a node package.json and executing a remote render? I will admit that the many revolving parts are a bit beyond my web programming fu –– can Electron run in a pre-existing Node process, for example, or does it need to be treated essentially as just another binary executable?

In an ideal world I’d love to see an API like the ones @donmccurdy outlines above. In the shorter term, though, I’m fine with a pragmatic solution. I am just a bit at a loss how to elegantly pull this repo in as a NPM submodule and execute it. I’m fine writing a little bit of wrapping JS.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reference Viewer | Unreal Engine Documentation
The Reference Viewer displays a graph of assets that reference or are referenced by any assets that are currently selected in the Content...
Read more >
Viewer API
This section contains the following information: Overview · HTML Templates · Class: AjaxResponse · Class: BurnRequest · Class: Comment · Class: Conversation ......
Read more >
Viewer API Reference - GitHub Pages
This API can be used to customize some behaviors in the Publitas.com Viewer. Getting Started. window.viewerReady = function ...
Read more >
Viewer SDK API reference for Android
Viewer SDK API reference for Android. Suggest Edits. The Viewer SDK for Android provides the following class: TVULiveRoom. Updated 10 months ago ...
Read more >
Developer's Guide | Google Books APIs
The Embedded Viewer API lets you embed book content from Google Books directly in your web pages with JavaScript. The API also provides...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found