Skip to content

fix(core): correct opacity in interleaved mode #9642

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

felixpalmer
Copy link
Collaborator

Background

When using PostProcessEffect with interleaved: true, due to clearing of the canvas the result is the basemap is completely cleared with a solid grey color:

Screenshot 2025-05-22 at 09 40 00

With this change, the clearing is applied only when needed, and the blending in ScreenPass is fixed to give correct results. Here is a layer, drawn with opacity with a ink postprocess applied, in interleaved mode.

Screen.Recording.2025-05-22.at.09.44.57.mov

In order to test, the layer browser has been enhanced to include a toggle for interleaved rendering

Change List

  • Do not clear canvas in deck-renderer when clearCanvas is explicitly set to false
  • Correct blending in ScreenPass (only used in PostProcessEffect)
  • Tidy up RasterLayer
  • Enhance layer browser to support interleaved

layers={layers.map(l => l.clone({beforeId: 'watername_ocean'}))}
initialViewState={INITIAL_VIEW_STATES}
layerFilter={this._layerFilter}
{...(!interleaved && {views})}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interleaved and the view prop do not play nicely together with postprocessing as the MapboxOverlay does a double render, thus applying the postprocess twice to the mapbox canvas.

Details: hasNonMapboxViews ends up being true due to the custom views: https://github.com/visgl/deck.gl/blob/master/modules/mapbox/src/deck-utils.ts#L340-L357

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

Successfully merging this pull request may close these issues.

1 participant