Skip to content

Commit

Permalink
fix(process): wrong offset scale for elevation texture.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchoqueux committed Jul 29, 2019
1 parent f5d8cac commit f191a74
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Process/LayeredMaterialNodeProcessing.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,17 @@ export function updateLayeredMaterialNodeElevation(context, layer, node, parent)

return context.scheduler.execute(command).then(
(textures) => {
const elevation = {
texture: textures[0],
pitch: extentsDestination[0].offsetToParent(extentsSource[0], nodeLayer.offsetScales[0]),
};

// Do not apply the new texture if its level is < than the current
// one. This is only needed for elevation layers, because we may
// have several concurrent layers but we can only use one texture.
if (targetLevel <= nodeLayer.level) {
node.layerUpdateState[layer.id].noMoreUpdatePossible();
return;
}
const elevation = {
texture: textures[0],
pitch: extentsDestination[0].offsetToParent(textures[0].coords, nodeLayer.offsetScales[0]),
};

node.layerUpdateState[layer.id].success();

Expand Down

0 comments on commit f191a74

Please sign in to comment.