Closed Jogii closed 1 month ago
@elalish Hello, i saw that google's render-fidelity-tools uses khronos gltf sample viewer. Can you please have a look into the code above.
You're welcome to look at our integration, but for ease of use and reliability, I'd recommend <model-viewer>
.
@elalish Does <model-viewer>
requires three,js as peer dependency, which mean i have to install threejs also from npm along with <model-viewer>
?
Our upcoming release will have this option. Currently we bundle three.js internally.
Sorry for the late response. It seems like you are missing the loading of an environment map (HDR file). If the glTF does not have lights itself the screen will be black without environment light. Here is the code snippet from Sample Viewer:
uiModel.hdr.subscribe(hdrFile => {
resourceLoader.loadEnvironment(hdrFile).then( (environment) => {
state.environment = environment;
// We need to wait until the environment is loaded to redraw
redraw = true;
});
});
Hi all,
I am trying to use glTF Sample Viewer as an API to integrate the same with my web application. I am using the NPM packaged code of Khronos gltf sample viewer.(npm i @khronosgroup/gltf-viewer). I followed the steps mentioned in the khronos gltf sample player github page but my modal is not loading , instead a blank sceen is rendered, and there is no error in console.
Can some one review my code and let me know what am i doing wrong. Also Is there any step wise documention to integrate the player API?
`const canvas = document.getElementById('canvas'); const context = canvas.getContext('webgl2', { alpha: false, antialias: true });