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
Textured meshscatter #1406
base: master
Are you sure you want to change the base?
Textured meshscatter #1406
Conversation
don't forget this PR, it's a nice addition 😄 |
#1436 would also add this but it'll take me some time to figure what each shader/plot primitive should include |
since #1436 was close, any change of having this? |
Hey, just wanted to bump this - I'm working on some plots using meshscatter and this would definitely be nice to have! Does this work in RPRMakie out of the box by any chance? (or can it be made to?) |
Hey, wanted to pick this up again. Is there anything stopping this from being merged? |
I think this was in a working/mostly done state, so you probably just need to work out the merge conflicts. |
bump |
763d71a
to
d108570
Compare
The branch should be up to date with master again. It seems that something about using GeometryBasics, ColorSchemes, GLMakie
texture = reshape(get(colorschemes[:Spectral_11], 0:0.01:1), 1, 101)
prim = FRect3D(Vec3f0(-0.5, -0.5, 0), Vec3f0(1, 1, 1))
rectmesh = GeometryBasics.normal_mesh(prim)
uvs = [Point2f(p[3], 0) for p in coordinates(rectmesh)] # normalize this so zmax = 1
rectmesh = GeometryBasics.Mesh(
meta(collect(coordinates(prim)); normals=normals(rectmesh), uv = uvs),
faces(rectmesh)
)
pos = [Point3f(i, j, 0) for i in 1:10 for j in 1:10]
z = rand(10,10)
fig = Figure(resolution=(1200, 800), fontsize=26)
ax = Axis3(fig[1, 1]; aspect=(1, 1, 1), elevation=π / 6, perspectiveness=0.5)
meshscatter!(
ax, pos, marker = rectmesh, markersize = Vec3f.(1, 1, z[:]),
uv_scale = Vec2f.(1, z[:]), color = texture, shading = false
)
ax.limits[] = ((0, 11), (0, 11), (0, 1.2))
fig @SimonDanisch Do you think it would be a good idea to generalize |
Compile Times benchmarkNote, that these numbers may fluctuate on the CI servers, so take them with a grain of salt. All benchmark results are based on the mean time and negative percent mean faster than the base branch. Note, that GLMakie + WGLMakie run on an emulated GPU, so the runtime benchmark is much slower. Results are from running: using_time = @ctime using Backend
# Compile time
create_time = @ctime fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @ctime Makie.colorbuffer(display(fig))
# Runtime
create_time = @benchmark fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @benchmark Makie.colorbuffer(display(fig))
|
In response to https://discourse.julialang.org/t/3d-bars-makie-colors-and-meshes/70283.
This enables passing of textures and per instance/marker
uv_scale
s tomeshscatter
with GLMakie. With that and the trick from #1368 you can do