Skip to content

Commit

Permalink
Fix instanced object colors
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Sep 1, 2023
1 parent bf77898 commit 09456ae
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/viewer/scene/model/vbo/VBOSceneModelRenderers.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ class VBOSceneModelRenderer {

if (this._aColor) {
this._aColor.bindArrayBuffer(state.colorsBuf ? state.colorsBuf : state.colorsBuf);
if (this._instancing && state.geometry && state.colorsBuf) {
if (this._instancing && state.colorsBuf) {
gl.vertexAttribDivisor(this._aColor.location, 1);
}
}
Expand Down Expand Up @@ -420,7 +420,7 @@ class VBOSceneModelRenderer {
const scene = this._scene;
const gl = scene.canvas.gl;
const {_state: state, model} = layer;
const {textureSet, geometry, origin, positionsDecodeMatrix} = state;
const {textureSet, origin, positionsDecodeMatrix} = state;
const lightsState = scene._lightsState;
const pointsMaterial = scene.pointsMaterial;
const {camera} = model.scene;
Expand Down Expand Up @@ -603,7 +603,7 @@ class VBOSceneModelRenderer {
}
}

this._draw({geometry, state, frameCtx, incrementDrawState});
this._draw({ state, frameCtx, incrementDrawState});

gl.bindVertexArray(null);
}
Expand Down Expand Up @@ -668,7 +668,6 @@ class VBOSceneModelTriangleInstancingRenderer extends VBOSceneModelRenderer {
const {
state,
frameCtx,
geometry,
incrementDrawState,
} = drawCfg;

Expand Down Expand Up @@ -718,7 +717,6 @@ class VBOSceneModelPointInstancingRenderer extends VBOSceneModelRenderer {
const {
state,
frameCtx,
geometry,
incrementDrawState,
} = drawCfg;

Expand Down Expand Up @@ -758,7 +756,6 @@ class VBOSceneModelLineInstancingRenderer extends VBOSceneModelRenderer {

const {
state,
geometry,
frameCtx,
incrementDrawState,
} = drawCfg;
Expand Down

0 comments on commit 09456ae

Please sign in to comment.