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

Plan the expansion of the options #32

Closed
mwestphal opened this issue Nov 12, 2021 · 6 comments · Fixed by #334
Closed

Plan the expansion of the options #32

mwestphal opened this issue Nov 12, 2021 · 6 comments · Fixed by #334
Labels
type:enhancement New feature or request
Milestone

Comments

@mwestphal
Copy link
Contributor

We are running out of short options and hotkeys, Let's plan how to tackle that.

A few possibilities:

  • Introduce modifies: Ctrl, Alt, Shift
  • Use vim like commands: :comp=2
@mwestphal mwestphal added type:enhancement New feature or request Priority:P1 labels Nov 12, 2021
@mwestphal
Copy link
Contributor Author

more info here: https://gitlab.kitware.com/f3d/f3d/-/issues/204

@mwestphal mwestphal added this to the 1.3.0 milestone Dec 6, 2021
@mwestphal
Copy link
Contributor Author

mwestphal commented Jan 9, 2022

With the introduction of named options, we can loop back on this.

I suggest to internally name options like this:

general.quiet
general.verbose
general.no-render
rendering.axis
rendering.depth-peeling
loading.geometry-only
loading.animation-index
testing.ref-threshold

(the idea is to categorize, we also could have multiples levels: rendering.elements.axis)

This will open to any number of options.

Regarding hotkeys, I think that modifiers are a bad idea. I'd keep the current number of hotkeys and add only very very important one to it (even remove some not important one).

Instead, a very simple command line wich will be used like this:

:rendering.axis=1
:rendering.up=+Z
:rendering.colormap.range=1,2

Of course, the actual naming of each options and categories will have to be discussed.

@Meakk
Copy link
Member

Meakk commented Jan 9, 2022

I agree with the vim-like commands, but I'm not sure about the category, I'd rather keep the option name short... Or at least, provide short aliases (g.quiet == general.quiet)
Ideally, I also would like to provide a :save .stl command to save the current non-default options values to the user config file.

@mwestphal
Copy link
Contributor Author

g.quiet == general.quiet

That would work.

I we do not introduce categories, how do you plan to support more options ?

:save .stl : that would make sense, but that means that we need actually a command
:save_config
:set

and more later

@mwestphal mwestphal mentioned this issue Jan 10, 2022
32 tasks
mwestphal added a commit that referenced this issue Jan 13, 2022
In the context of #52 , Introduce a first element, f3d::options and start using it when possible without refactoring the whole of F3D for now.

TODO in other PRs:
- doc
- F3DLoader refacto
- options names #32
@mwestphal
Copy link
Contributor Author

So here is the current listing of options and how they should be modified

// Application
// These options will not be part of libf3d
// but will only be command line options for F3D
"config"
"dry-run"
"no-render"
"interaction-test-play"
"interaction-test-record"
"output"
"ref-threshold"
"reference"
"no-background"

// General
// These options apply everywhere but should be set before creating the loader
"general.quiet"
"general.verbose"

// Loader
// These options apply on the loader and can be set before loading a file
"loader.animation-index"
"loader.geometry-only"
"loader.progress"
"loader.camera-index"
"loader.color"
"loader.emissive-factor"
"loader.line-width"
"loader.metallic"
"loader.normal-scale"
"loader.opacity"
"loader.point-size"
"loader.roughness"
"loader.texture-base-color"
"loader.texture-emissive"
"loader.texture-material"
"loader.texture-normal"

// Loading but should be window
// These options apply on the loader and can be set before loading a file
// They should be moved to window when possible
"loader.cells"
"loader.scalars"
"loader.component"
"loader.fullscreen"
"loader.resolution"
"loader.hdri"
"loader.background-color"
"loader.up"
"loader.font-file"

// Window
// These options apply on the window, for rendering, and can be set before loading
// a file or calling update on the window
"window.axis"
"window.bar"
"window.blur-background"
"window.camera-azimuth-angle"
"window.camera-elevation-angle"
"window.camera-focal-point"
"window.camera-position"
"window.camera-view-angle"
"window.camera-view-up"
"window.colormap"
"window.denoise"
"window.depth-peeling"
"window.edges"
"window.filename"
"window.fps"
"window.fxaa"
"window.grid"
"window.inverse"
"window.metadata"
"window.point-sprites"
"window.range"
"window.raytracing"
"window.samples"
"window.ssao"
"window.tone-mapping"
"window.trackball"
"window.volume"

@mwestphal
Copy link
Contributor Author

mwestphal commented Jul 11, 2022

Here is the new list of libf3d options

  // Loader
  this->Internals->init("loader.animation.index", 0); 
  this->Internals->init("loader.camera.index", -1);
  this->Internals->init("loader.up-direction", std::string("+Y"));

  this->Internals->init("loader.geometry-only", false);
  this->Internals->init("loader.show-progress", false);

  this->Internals->init("loader.default.line-width", 1.0);
  this->Internals->init("loader.default.point-size", 10.0);

  this->Internals->init("loader.default.color.rgb", std::vector<double>{ 1., 1., 1. }); 
  this->Internals->init("loader.default.color.opacity", 1.0);
  this->Internals->init("loader.default.color.texture", std::string());

  this->Internals->init("loader.default.emissive.factor", std::vector<double>{ 1., 1., 1. }); 
  this->Internals->init("loader.default.emissive.texture", std::string());

  this->Internals->init("loader.default.normal.texture", std::string());
  this->Internals->init("loader.default.normal.scale", 1.0);

  this->Internals->init("loader.default.material.metallic", 0.0);
  this->Internals->init("loader.default.material.roughness", 0.3);
  this->Internals->init("loader.default.material.texture",
    std::string()); // XXX this seems to override, is that expected ?

  // Window
  this->Internals->init("window.background.color", std::vector<double>{ 0.2, 0.2, 0.2 }); 
  this->Internals->init("window.background.hdri", std::string()); // TODO check it overrides
  this->Internals->init("window.background.blur", false);

  this->Internals->init("window.camera.azimuth-angle", 0.0);
  this->Internals->init("window.camera.elevation-angle", 0.0);
  this->Internals->init("window.camera.focal-point", std::vector<double>());
  this->Internals->init("window.camera.position", std::vector<double>());
  this->Internals->init("window.camera.view-angle", 0.0);
  this->Internals->init("window.camera.view-up", std::vector<double>());

  this->Internals->init("window.coloring.cells", false);
  this->Internals->init("window.coloring.name", F3D_RESERVED_STRING);
  this->Internals->init("window.coloring.component", -1);
  this->Internals->init("window.coloring.colormap",
    std::vector<double>{
      0.0, 0.0, 0.0, 0.0, 0.4, 0.9, 0.0, 0.0, 0.8, 0.9, 0.9, 0.0, 1.0, 1.0, 1.0, 1.0 }); 
  this->Internals->init("window.coloring.range", std::vector<double>());

  this->Internals->init("window.raytracing.enable", false);
  this->Internals->init("window.raytracing.denoise", false);
  this->Internals->init("window.raytracing.samples", 5);
  this->Internals->init("window.actor.bar", false); // XXX coloring maybe ?
  this->Internals->init("window.actor.edges", false);
  this->Internals->init("window.actor.filename", false);
  this->Internals->init("window.actor.fps", false);
  this->Internals->init("window.actor.grid", false);
  this->Internals->init("window.actor.cheatsheet", false);
  this->Internals->init("window.actor.metadata", false);

  this->Internals->init("window.render.depth-peeling", false);
  this->Internals->init("window.render.fxaa", false);
  this->Internals->init("window.render.ssao", false);
  this->Internals->init("window.render.tone-mapping", false);

  this->Internals->init("window.fullscreen", false); // TODO rework this option as it is broken
  this->Internals->init("window.font-file", std::string());

  // TODO: Rename into a "rendering-mode" option
  this->Internals->init("window.point-sprites.enable", false);
  this->Internals->init("window.volume.enable", false);
  this->Internals->init("window.volume.inverse", false);

  // Interactor
  this->Internals->init("interactor.axis", false);
  this->Internals->init("interactor.trackball", false);

mwestphal added a commit that referenced this issue Aug 5, 2022
mwestphalnew pushed a commit to mwestphalnew/f3d that referenced this issue Feb 10, 2024
In the context of f3d-app#52 , Introduce a first element, f3d::options and start using it when possible without refactoring the whole of F3D for now.

TODO in other PRs:
- doc
- F3DLoader refacto
- options names f3d-app#32
mwestphalnew pushed a commit to mwestphalnew/f3d that referenced this issue Feb 10, 2024
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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants