CartoDB / mobile-sdk

CARTO Mobile SDK core project
https://carto.com/docs/carto-engine/mobile-sdk/
BSD 3-Clause "New" or "Revised" License
181 stars 65 forks source link

[FR] custom shader support #407

Open farfromrefug opened 3 years ago

farfromrefug commented 3 years ago

It would be nice to be able to provide custom shaders for colormap or tilemap. I see multiple features from that:

mtehver commented 3 years ago

Marking this with 'idea-maybe-future' currently, but it is unlikely to be implemented anytime soon. It is not easy to design a simple yet comprehensive shader wrapper, there is a reason why GLES/Metal have such a large APIs.

I think most use cases are covered either by:

farfromrefug commented 3 years ago

@mtehver i understand but what is "virtual datasource" ?

mtehver commented 3 years ago

@farfromrefug Virtual datasources connect to primary datasources and do some processing on the data. For example, imaginary GreyscaleRasterTileDataSource would use another datasource to fetch the tile and would then decompress the image and apply 'rgbaToGrayscale' filter to the image.

farfromrefug commented 3 years ago

@mtehver ok i see, thought you meant something already implemented. Now i think a shader is the way to go there as it is gpu side and thus much more efficient i think. I understand your point about it not being easy wrap . I think i ll try and create a custom version where i can just "custom set" that string for example. Not perfect but i think i can do almost anything with this and the current shader parameters