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

transparency and overdraw do not adjust render order in WGLMakie #4673

Open
ffreyer opened this issue Dec 16, 2024 · 0 comments
Open

transparency and overdraw do not adjust render order in WGLMakie #4673

ffreyer opened this issue Dec 16, 2024 · 0 comments
Labels
bug rendering typically backend specific WGLMakie This relates to WGLMakie.jl, the Web-based WebGL backend for Makie.

Comments

@ffreyer
Copy link
Collaborator

ffreyer commented Dec 16, 2024

Plots with transparency = true should be rendered after opaque plots, since they don't write to the depth buffer. If they don't they end up behind later drawn opaque plots even if they shouldn't be, because they don't communicate their depth value.

Plots with overdraw = true don't depth test at all (no read or write) so that they draw over every already drawn plot. They again don't have a way to communicate being at min depth, so if something is drawn later it can draw over an overdraw = true plot.

Both of these should have their own pass (or at least be sorted such that all the both-false plots render first.)

Example of it being a problem:

using WGLMakie
fig = Figure()
for (i, overdraw) in enumerate([false, true])
    for (j, transparency) in enumerate([false, true])
        Label(fig[i,j][1,1], "overdraw = $overdraw, transparency = $transparency", tellwidth=false)
        ax = LScene(fig[i, j][2,1])
        linesegments!(ax, Rect3f(Point3f(-1), Vec3f(2)), overdraw = overdraw, transparency = transparency)
        mesh!(ax, Sphere(Point3f(0), 1f0), color = :orange)
    end
end
fig

Image

@ffreyer ffreyer added bug rendering typically backend specific WGLMakie This relates to WGLMakie.jl, the Web-based WebGL backend for Makie. labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug rendering typically backend specific WGLMakie This relates to WGLMakie.jl, the Web-based WebGL backend for Makie.
Projects
None yet
Development

No branches or pull requests

1 participant