Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

line-comp-op understanding #17

Open
farfromrefug opened this issue Aug 20, 2021 · 4 comments
Open

line-comp-op understanding #17

farfromrefug opened this issue Aug 20, 2021 · 4 comments

Comments

@farfromrefug
Copy link
Contributor

I am looking to achieve something like this
https://external-content.duckduckgo.com/iu/?u=http%3A%2F%2Fwww.alta-via.fr%2Fguide%2Fimages%2Fstories%2Fconditions%2Fhiver-13-14%2F2014-02-03-envers-du-plan.jpg&f=1&nofb=1
The idea is to have contour lines change color based on the background. I was thinking of using "darken" to do that

The first thing is that i cant seem to get line comp op to work as expected:

  • with what does it "comp"? the full background rendered data?
  • is it working for you?

And i think line-opacity breaks it while setting a color with alpha does not

@mtehver
Copy link
Contributor

mtehver commented Aug 21, 2021

About comp-op. First, there are two kinds of comp-ops - feature level and layer level. line-comp-op is a feature level comp-op and applies comp-op operator to the previously rendered framebuffer, including all previously rendered layers and the features from the same layer rendered before.

Layer level comp-op (com-op in CartoCSS) forces the layer to be rendered into an 'offscreen' framebuffer and then after all the features have been rendered, the resulting offscreen framebuffer is composited to the original framebuffer.

SDK does support limited number of comp-ops compared to the original CartoCSS standard and I am not really sure they work as expected when alpha value is less than 1. Also, layer blending animations may create strange artifacts.

Regarding line-opacity, can you make an example? Using line opacity vs color with same alpha should work exactly same.

@farfromrefug
Copy link
Contributor Author

@mtehver the best example is contours in this theme https://github.com/farfromrefug/new_carto_theme
do you have contours mbtiles? i can share one for france.
Also from what you explained is line-comp-op going to compose contours with landcover if they are different layers? (no sure i read it right)

@mtehver
Copy link
Contributor

mtehver commented Aug 23, 2021

@farfromrefug Please share the contours mbtiles.

Regarding line-comp-op, correct. countours will be composed to the existing framebuffer. If the underlying opaque layer was landcover, then lines would be composed/blended with that.

@farfromrefug
Copy link
Contributor Author

@mtehver here you go terrain_25m-contours10m.mbtiles:
http://gofile.me/4pKGL/0CP2Qg9pF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants