Selectively applying effects #4537
Replies: 2 comments
-
I assume you are referring to Deck({
effects: [
new PostProcessEffect(motionBlur, {viewIds: ['blurred']})
],
views: [
new MapView({id: 'blurred'}),
new MapView({id: 'not-blurred'})
],
layers: [...],
layerFilter: ({layer, viewport}) => {
if (shouldBlur(layer.id)) return viewport.id === 'blurred';
else return viewport.id !== 'blurred';
}
}) The downside of this approach is that all the layers that belong to one view are drawn together, so it's harder to reorder 2D layers. Is this what you have in mind? |
Beta Was this translation helpful? Give feedback.
-
Yes it is exactly the kind of thing I had in mind. However, I fear the above API is a little complex however?
|
Beta Was this translation helpful? Give feedback.
-
If I need to apply effects to most layers , but not all, what options do I have?
I am currently assuming that I will be able to implement this by instantiating 2 deck GL instances, one with the effects and most layers and then on with no effects and the single layer which I do not want the effects applied to. I am assuming I can then keep the 2 in sync somehow, in a similar way to the harpgl examples posted recently.
However I also wonder if there is any way to implement this with a single instance - using views possibly?
Beta Was this translation helpful? Give feedback.
All reactions