IconLayer renders icons at small sizeScales with significant loss of quality
I'm trying to render a small triangle pointing to the direction of travel on a map.
Here's the asset I'm currently using:
Dimension: 7 x 10
When rendered on a map, I see that there is significant loss of quality, along with significant distortion (tracked in issue 834).

Here's how I'm instantiating the layer:
new IconLayer({
id: 'direction-pointer',
data: arrows,
fp64: true,
getColor: (d, i) => {
const opacity = d.index < currentIndex ? 255 : 0;
return [0, 0, 0, opacity];
},
iconAtlas: assetUrl('/static/direction-pointer.png'),
iconMapping: {
marker: {
x: 0,
y: 0,
width: 7,
height: 10,
mask: true
}
},
sizeScale: 10
});
@1chandu @ibgreen Could this be related to the power-of-two texture change in luma v4?
Luma v4 uses WebGL2 by default, NPOT (non power-of-two textures) textures are supported and shouldn't cause any issue.
I will take a look at this issue, after I wrap my current tasks, should be in next couple of days.
Need to re-test this with #834 fix (@rivulet-zhang working on it).
@1chandu #900 handles the distortion caused by rotation. As a separate issue, the scaling of the icon seems to be inaccurate, which could relate to this issue. Say I am rendering an icon with getSize: d => s1 and sizeScale = s2, the resulting icon actually has a much smaller size as opposed to s1 * s2. This exists in the original version and #900 does not handle this for now. Let me know if you want me to look into this.
@1chandu @ibgreen Could this be related to the power-of-two texture change in luma v4?
Kind of, I was more thinking that this could be related to a change in default texture filtering parameters. We need to make sure we are using the best texture filtering.
Say I am rendering an icon with getSize: d => s1 and sizeScale = s2, the resulting icon actually has a much smaller size as opposed to s1 * s2. This exists in the original version and #900 does not handle this for now. Let me know if you want me to look into this.
@rivulet-zhang Yes it sounds like this is worth another look.