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

GLTFLoader does not support Vertex Color #1506

Open
tgranie opened this issue May 26, 2024 · 0 comments
Open

GLTFLoader does not support Vertex Color #1506

tgranie opened this issue May 26, 2024 · 0 comments

Comments

@tgranie
Copy link

tgranie commented May 26, 2024

Describe the bug

  1. Use the following script with the glb attached : The glb is a Vertex Color Phong Material (Load it in https://3dviewer.net/)
  2. The glb is displayed without the colors
import {
  Viewer,
  GLTFLoaderPlugin,
  OBJLoaderPlugin,
} from "https://cdn.jsdelivr.net/npm/@xeokit/[email protected]/+esm";

const viewer = new Viewer({
  canvasId: "myCanvas",
  transparent: true,
  pbrEnabled: true,
  dtxEnabled: false
});

viewer.camera.eye = [-2.56, 8.38, 8.27];
viewer.camera.look = [13.44, 3.31, -14.83];
viewer.camera.up = [0.1, 0.98, -0.14];

viewer.scene.selectedMaterial.fillAlpha = 0.1;

const gltfLoader = new GLTFLoaderPlugin(viewer);

const sceneModel = gltfLoader.load({
  id: "myModel",
  src: "./Terrain_lv2.glb",
  pbrEnabled: true,
  colorTextureEnabled: true,
  dtxEnabled: false,
  edges: false,
});

sceneModel.on("loaded", () => {
  viewer.cameraFlight.flyTo(sceneModel);
});

viewer.cameraControl.on("picked", function (e) {
  console.log(e.entity.id);
});

window.viewer = viewer;

Expected behavior

Colors should be displayed.

Screenshots

image
Terrain_lv2.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant