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

Draft
wants to merge 28 commits into
base: ff/GeometryBasics_refactor
Choose a base branch
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 and others added 26 commits September 16, 2024 01:19
* show data inspector on NaN if nan_color is set

* clean up

* Update inspector.jl

---------

Co-authored-by: Ben Arthur <bjarthur70@gmail.com>
* Use `Base.depwarn()` exclusively, and fix deprecation tests

A few changes:
- Use `Base.depwarn()` instead of `Base.@deprecate_binding` to avoid warnings
  when importing symbols.
- Pass the missing `funcsym` argument to `Base.depwarn()` in `Combined()`.
- Fix the deprecation tests. Most of them were actually getting skipped because
  `@depwarn_message` had a `return` statement, causing the entire testset to
  return early as soon as the passed expression was evaluated.

* fixup! Use `Base.depwarn()` exclusively, and fix deprecation tests
* Linestyle

* Changelog

* adjust another refimg test instead of adding a new one

---------

Co-authored-by: ffreyer <frederic481994@hotmail.de>
* consistently clip based on voxel centers

* make test more stable

* update changelog
* support images with reversed axes

* changelog

* add reference tests

* fix reverse heatmap

* squash refimages and also test surface

* fix typo

---------

Co-authored-by: Simon <sdanisch@protonmail.com>
Co-authored-by: ffreyer <frederic481994@hotmail.de>
@ffreyer
Copy link
Collaborator Author

ffreyer commented Oct 3, 2024

I need to stop using rebase...

I added this as a refimg test:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Work in progress
Development

Successfully merging this pull request may close these issues.

5 participants