Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OBF.IfcStreamer throws "Error: No scene initialized!" #557

Open
5 tasks done
keijohyttinen opened this issue Jan 22, 2025 · 0 comments
Open
5 tasks done

OBF.IfcStreamer throws "Error: No scene initialized!" #557

keijohyttinen opened this issue Jan 22, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@keijohyttinen
Copy link

keijohyttinen commented Jan 22, 2025

Describe the bug 📝

When loading fragmented model from backend, OBF.IfcStreamer throws error "Error: No scene initialized!" when calling

    const tilesLoader = components.get(OBF.IfcStreamer);
    tilesLoader.world = world;
    tilesLoader.url = baseUrl;
    tilesLoader.useCache = true;
    tilesLoader.culler.threshold = 20;
    tilesLoader.culler.maxHiddenTime = 1000;
    tilesLoader.culler.maxLostTime = 40000;
    ....
    await tilesLoader.load(geometryData, true, propertiesData);

Exception

viewer.ts:32 Error: No scene initialized!
    at get scene (index.mjs:6439:13)
    at hi.load (index.js:26996:61)

In addition, after that, there is an exception (not sure whether this is a side effect or root cause(?)):

ModelViewer.js:84 THREE.WebGLProgram: Shader Error 0 - VALIDATE_STATUS false

Program Info Log: Vertex shader is not compiled.
�
VERTEX

ERROR: 0:4: 'projectionMatrix' : undeclared identifier
ERROR: 0:4: 'modelViewMatrix' : undeclared identifier
ERROR: 0:4: 'position' : undeclared identifier
ERROR: 0:4: 'constructor' : not enough data provided for construction
�

  1: #define SHADER_TYPE RawShaderMaterial
  2: #define SHADER_NAME 
  3: void main() {
> 4: 	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  5: }

Image

Reproduction ▶️

No response

Steps to reproduce 🔢

  1. git clone [email protected]:keijohyttinen/nextjs-obc-viewer.git
  2. cd nextjs-obc-viewer/app
  3. npm install
  4. npm run dev
  5. Open in chrome browser URL http://localhost:3005/?source=https://raw.githubusercontent.com/ThatOpen/engine_components/refs/heads/main/resources/streaming/small.ifc-processed.json

System Info 💻

System:
    OS: macOS 14.6.1
    CPU: (8) arm64 Apple M1
    Memory: 402.44 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 18.19.1 - ~/.nvm/versions/node/v18.19.1/bin/node
    Yarn: 1.22.22 - ~/Development/github/nextjs-viewer/app/node_modules/.bin/yarn
    npm: 10.8.1 - ~/Development/github/nextjs-viewer/app/node_modules/.bin/npm
    pnpm: 9.15.4 - ~/.nvm/versions/node/v18.19.1/bin/pnpm
  Browsers:
    Chrome: 131.0.6778.265
    Safari: 17.6

Used Package Manager 📦

npm

Error Trace/Logs 📃

Click to expand!
Error: No scene initialized!
    at get scene (index.mjs:6439:13)
    at hi.load (index.js:26996:61)
    at async loadModelByUrl (viewer.ts:30:19)
    at async loadBimUiBasic (ModelViewer.js:130:7)


---


ModelViewer.js:84 THREE.WebGLProgram: Shader Error 0 - VALIDATE_STATUS false

Program Info Log: Vertex shader is not compiled.

VERTEX

ERROR: 0:4: 'projectionMatrix' : undeclared identifier
ERROR: 0:4: 'modelViewMatrix' : undeclared identifier
ERROR: 0:4: 'position' : undeclared identifier
ERROR: 0:4: 'constructor' : not enough data provided for construction


  1: #define SHADER_TYPE RawShaderMaterial
  2: #define SHADER_NAME 
  3: void main() {
> 4: 	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  5: }

Validations ✅

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a repository issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
  • Check that this is a concrete bug. For Q&A join our Community.
  • The provided reproduction is a minimal reproducible example of the bug.
@keijohyttinen keijohyttinen added the bug Something isn't working label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant