Skip to content

Conversation

@piotrintes
Copy link
Contributor

Fix for #15296 - the canvas opacity change changes the opacity for all WebGL rendered layers instead only the current one. Removing the 4 lines that do that doesn't seem to break anything and it fixes the issue.

@mike-000
Copy link
Contributor

This also fixes a previously unnoticed bug. With just one layer the opacity was applied twice, so when specified opacity was 0.5 the result was 0.25. Additional rendering tests based on https://github.com/openlayers/openlayers/tree/main/test/rendering/cases/webgl-vector would be useful.

@github-actions
Copy link

📦 Preview the website for this branch here: https://deploy-preview-16382--ol-site.netlify.app/.

Copy link
Contributor

@jahow jahow left a comment

Choose a reason for hiding this comment

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

Thank you! This was indeed an overlook, the layer opacity is applied at the end during the final post processing pass.

Could you please update the "webgl-multiple-layers" example to use a VectorLayer instead of PointsLayer? with this fix the output should be similar.

@piotrintes
Copy link
Contributor Author

Ok, I've updated the test to use the VectorLayer. One thing to note here: I don't see a dedicated WebGL VectorLayer (there's WebGLPoints and WebGLTile, but no WebGLVector) . The only way to get WebGL rendered VectorLayer I know of, is to extend the VectorLayer and override createRenderer to create and return WebGLVectorLayerRenderer instance (or a class extending it) - is in webgl-vector test for example.

@mike-000
Copy link
Contributor

#16394 recently added WebGLVectorLayer, so the test can be updated if you rebase.

@piotrintes
Copy link
Contributor Author

Ah, ok. I didn't see it then. That explains it.

Fix for openlayers#15296 - the canvas opacity change changes the opacity for all WebGL rendered layers instead only the current one. Removing the 4 lines that do that doesn't seem to break anything and it fixes the issue.
@piotrintes
Copy link
Contributor Author

Ok, I've updated it and the webgl-multiple-layers test passes with the WebGLVector.

@jahow
Copy link
Contributor

jahow commented Nov 28, 2024

Looks like the lint step is failing, could you please try and fix it? thanks

Copy link
Contributor

@jahow jahow left a comment

Choose a reason for hiding this comment

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

Thank you for the fix!

@jahow jahow merged commit 154a3f9 into openlayers:main Nov 28, 2024
8 checks passed
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.

3 participants