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

The future of loading files with F3D and the libf3d #653

Closed
Tracked by #1243
mwestphal opened this issue Mar 24, 2023 · 0 comments · Fixed by #1609
Closed
Tracked by #1243

The future of loading files with F3D and the libf3d #653

mwestphal opened this issue Mar 24, 2023 · 0 comments · Fixed by #1609
Labels
type:enhancement New feature or request
Milestone

Comments

@mwestphal
Copy link
Contributor

In the context of resolving #597, some discussions happened on discord and offline, so I will try to summarize it here.

Currently, F3D and the libf3d dinstinguish between fullscene loading and geometry loading. Some formats even do not support both.
Almost all format support geometry loading and only a handful support fullscene loading.

The fact that some format do not support the to be opened as a full scene makes sense from a dev POV of the file does not contains any scene information, only geometries.

The fact that some format can't be opened only as geometries is an limitation of VTK and F3D file readers.

From a user POV, loading a file as a geometry should not be much more different than loading a fullscene that happens to not have any lights, cameras or texture.

Of course, implementation wise, there must be some difference, but they should not be so fundamental as impacting as much the architecture and user experience of f3d and the libf3d.

How would that look like as a F3D user ?

  • geometry-only and group-geometries option will disapear
  • A new option for group file together appears, whatever their types and support of fullscene or not, probably regex based
  • Switching between geometry mode and fullscene mode will just be an interactive binding, with a corresponding command line option to choose the mode at start

eg:

f3d ./path/to/folder --group="*.fbx" --rendering-mode="geometry"

or

f3d ./path/to/folder --group=".fbx" --rendering-mode="scene"

How would that look like as a libf3d user ?

The loader API that was reworked here: #634, but it will be reworked much further it would look as simple as this:

loader.add("a.obj"); // ok (A is visible)
loader.add("b.obj"); // ok (A and B are visible)
loader.reset();
loader.add("b.obj"); // ok (B is visible)

the rendering mode will simply be controlled by an option.

What do we need to do implement it ?

  1. vtkImporter API improvement

First and foremost, an improvement should be made on the vtkImporter to be able to recover individual component easily and implement such API on all importers that VTK needs. This is a change that should be made in VTK and it should be made before the next VTK minor release. It will let us do something like:

importer->GetGeometries()

  1. vtk 9.0 compatibility

Even if we have a nice API in vtkImporter, we will need to find a way to implement this with older version of VTK. It seems possible to do that by doing some smart bookeeping of the actors on the renderer. This needs to be tested and designed

  1. Importer just imports now

While we already have the vtkF3DGenericImporter, most of its logic rendering style of rendering (point gaussian, volume..) will havbe to be taken out and be put in the renderer, so that the logic could be applied on any importer providing geometries

  1. Importer do not load multiple geometries

In #634 we introduced the possibilities to load multiples geometries. This logic will be taken out of the importer and handled in the loader by manipulating multiple importer instead of only two (generic and standard) as currently

  1. Rework rendering

All of this will have lots of impact on how rendering is handled and we do not foresee everything. We will try our best though.

Wait ? What happens when I do this ? f3d my_plyl_with_normals.ply, can I still show the normals ?

Well, yes, but with one more step. Indeed, the default rendering mode will be scene mode, which focus on texture and nice rendering. One will have to switch to geometry rendering mode. So this change is not retro compatible, even for F3D users.

So we will probably go into a major version change for this. F3D 3.0 here we come. We could even start to say that the libf3d API is coming out of beta and may start to be stable now, but this yet another can of worm.

When will that happen

Not before 2024 for sure. We already have tons of stuff to deliver in 2.0.

Hav

@mwestphal mwestphal added the type:enhancement New feature or request label Apr 23, 2023
@mwestphal mwestphal added this to the 3.0.0 milestone Jul 5, 2023
@mwestphal mwestphal mentioned this issue Jan 31, 2024
23 tasks
@mwestphal mwestphal added this to F3D Feb 3, 2024
@mwestphal mwestphal modified the milestone: 3.0.0 Feb 3, 2024
@mwestphal mwestphal moved this to Investigate in F3D Feb 4, 2024
@mwestphal mwestphal moved this from Investigate to To do in F3D Feb 4, 2024
@mwestphal mwestphal mentioned this issue Oct 5, 2024
36 tasks
mwestphal added a commit that referenced this issue Oct 8, 2024
Add a meta importer to support easy grouping of file and model options on all files, even full scene files.
 - Fix #653
 - Reduce the scope of vtkF3DGenericImporter, now single file and no coloring, just easy access to internal datasets
 - Add a vtkF3DMetaImporter to recover all actors from multiple importers and add point sprites/volume actors on top
 - Update vtkF3DRendererWithColoring to recover the data from meta importer
 - libf3d: Make many model options optionals
 - window: Use model option on all files
 - loader: rework API to support adding files easily
 - F3DApplication: Remove geometry-only and group-geometries and add multi-file-mode
 - F3DStarter: Add grouping logic for multi-file-mode
 - Remove unused VTK_READER from plugins
 - Add tons of tests
 - Update doc
@github-project-automation github-project-automation bot moved this from To do to Done in F3D Oct 8, 2024
Yogesh9000 pushed a commit to Yogesh9000/f3d that referenced this issue Nov 15, 2024
Add a meta importer to support easy grouping of file and model options on all files, even full scene files.
 - Fix f3d-app#653
 - Reduce the scope of vtkF3DGenericImporter, now single file and no coloring, just easy access to internal datasets
 - Add a vtkF3DMetaImporter to recover all actors from multiple importers and add point sprites/volume actors on top
 - Update vtkF3DRendererWithColoring to recover the data from meta importer
 - libf3d: Make many model options optionals
 - window: Use model option on all files
 - loader: rework API to support adding files easily
 - F3DApplication: Remove geometry-only and group-geometries and add multi-file-mode
 - F3DStarter: Add grouping logic for multi-file-mode
 - Remove unused VTK_READER from plugins
 - Add tons of tests
 - Update doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant