Skip to content

Per-layer opacity and compositing #314

@artemp

Description

@artemp

Let's say I want to render a semi-transparent street overlay to render on top of an aerial image, and that I want to have the following layers:

  • Aerial image
  • Street overlay
  • Labels and point symbols

I would like the street overlay layer to be semi-transparent. If the individual symbolizers are semi-transparent, lots of rendering artifacts will appear:

  • Road casing and road fill will clash - the road casing will be visible through the road fill, and the road fill will be more opaque than the border.
  • Crossroads will be more opaque than the individual roads, as all roads will be rendered on top of each other.

Thus, the solution to this problem would be to have two new parameters for every layer: opacity and compositing mode.

Every layer should get its own canvas; once all elements in a layer have been rendered, that layer canvas is composed on top of the canvas for the resulting image.

For bonus points, instantiate canvases only for layers with 1.0 opacity and normal compositing, in order to not waste memory.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions