Skip to content

Commit

Permalink
Use sRGB space for shader colors
Browse files Browse the repository at this point in the history
  • Loading branch information
vasturiano committed Oct 28, 2024
1 parent 690e118 commit 892dff8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/layers/hexbin.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ export default Kapsule({
geom.applyMatrix4(obj.matrix);

// color vertices
const topColor = color2ShaderArr(topColorAccessor(d));
const sideColor = color2ShaderArr(sideColorAccessor(d));
const topColor = color2ShaderArr(topColorAccessor(d), true, true);
const sideColor = color2ShaderArr(sideColorAccessor(d), true, true);

const nVertices = geom.getAttribute('position').count;
const topFaceIdx = geom.groups[0].count; // starting vertex index of top group
Expand Down Expand Up @@ -224,7 +224,7 @@ export default Kapsule({
transparent: opacity < 1,
side: THREE.DoubleSide
});
sideHexMaterials[sideColor].uniforms.color.value = color2ShaderArr(sideColor);
sideHexMaterials[sideColor].uniforms.color.value = color2ShaderArr(sideColor, true, true);
}
if (!topHexMaterials.hasOwnProperty(topColor)) {
const opacity = colorAlpha(topColor);
Expand Down
2 changes: 1 addition & 1 deletion src/layers/polygons.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export default Kapsule({
material.color.set(colorStr2Hex(color));
material.opacity = opacity;
} else {
material.uniforms.color.value = color2ShaderArr(color);
material.uniforms.color.value = color2ShaderArr(color, true, true);
}
});

Expand Down

0 comments on commit 892dff8

Please sign in to comment.