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

Make Makie.mesh compatible with MultiMesh (GeometryBasics refactor) #4368

Closed
wants to merge 0 commits into from

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Sep 15, 2024

Description

This is test/prototype for using MetaMesh from JuliaGeometry/GeometryBasics.jl#219 to render a mesh with materials loaded with JuliaIO/MeshIO.jl#98. This is effectively a continuation of #4319.

With this branch (and the related MeshIO, ShaderAbstractions & GeometryBasics branches), using https://free3d.com/3d-model/girl-blind-703979.html:

filepath = "path/to/14-girl-obj/girl OBJ.obj"
metamesh = load(filepath)

# Fix filename, convert white -> alpha
img = map(FileIO.load("path/to/14-girl-obj/tEXTURE/FACE Base Color apha.png")) do c
    Makie.RGBA{Makie.N0f8}(c.r, c.g, c.b, 1 - c.r)
end
metamesh[:materials]["FACE"]["diffuse map"]["image"] = img

# this splits up the mesh, extracts material parameters, loads the remaining textures and generates multiple mesh plots
f, a, p = Makie.mesh(metamesh)

image

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • Added an entry in CHANGELOG.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

@ffreyer
Copy link
Collaborator Author

ffreyer commented Oct 3, 2024

I need to stop using rebase...

I added this as a refimg test:

 begin
    m = load(Makie.assetpath("sponza/sponza.obj"))
    f, a, p = mesh(m)
    cameracontrols(a).settings.center[] = false
    cameracontrols(a).settings.fixed_axis[] = false # irrelevant for test
    update_cam!(a.scene, Vec3f(-15, 7, 1), Vec3f(3, 5, 0), Vec3f(0,1,0))
    f
end

grafik

I think we can also use this as a example for further lighting improvements in the future, e.g. adding an ambient multiplier or adding normal maps, bump maps etc. The model is the Sponza model from https://casual-effects.com/data/, about 6MB in total, loosely licensed for non-commerical use.

@ffreyer ffreyer mentioned this pull request Oct 14, 2024
9 tasks
Base automatically changed from ff/GeometryBasics_refactor to breaking-0.22 October 16, 2024 11:36
@ffreyer ffreyer closed this Oct 17, 2024
@ffreyer ffreyer force-pushed the ff/MetaMesh_integration branch from d3e39e6 to adef598 Compare October 17, 2024 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

1 participant