Skip to content

Add interactive bind to cycle backface culling modes#3126

Open
isaccunha wants to merge 3 commits into
f3d-app:masterfrom
isaccunha:feat/backface-culling-bind
Open

Add interactive bind to cycle backface culling modes#3126
isaccunha wants to merge 3 commits into
f3d-app:masterfrom
isaccunha:feat/backface-culling-bind

Conversation

@isaccunha

Copy link
Copy Markdown

Describe your changes

This PR adds a command and a bind to control backface culling.

Issue ticket number and link if any

#2697

Checklist for finalizing the PR

  • I have performed a self-review of my code
  • I have added tests for new features and bugfixes
  • I have added documentation for new features
  • If it is a modifying the libf3d API, I have updated bindings
  • If it is a modifying the .github/workflows/versions.json, I have updated docker_timestamp

AI Disclosure

  • I did not use AI to generate any of the content of that pull request
  • I used AI to generate code in that pull request, if yes please disclose which part of the code was generated and with which model.
  • ...

Continuous integration

Please write a comment to run CI, eg: \ci fast.
See here for more info.

@mwestphal mwestphal linked an issue May 7, 2026 that may be closed by this pull request
@mwestphal mwestphal self-requested a review May 7, 2026 05:44
Comment thread vtkext/private/module/vtkF3DRenderer.cxx

@mwestphal mwestphal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, please add tests and doc :)

@mwestphal mwestphal requested review from mwestphal and removed request for mwestphal May 14, 2026 13:34
@isaccunha isaccunha requested a review from a team as a code owner June 4, 2026 09:35
Comment thread vtkext/private/module/vtkF3DRenderer.cxx
std::string CachePath;

std::optional<std::string> BackfaceType;
std::map<vtkProperty*, bool> OriginalBackfaceCulling;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need a bool on top of the property ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the vtkProperty acts as a key for each material. We need the bool as a backup so when we cycle back to default, we can fully recover the original state for each part of the object.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im really confused. the original vtkProperty should contain all the info you need, should it not ?


vtkProperty* prop = coloring.Actor->GetProperty();
vtkProperty* origProp = coloring.OriginalActor->GetProperty();
if (this->OriginalBackfaceCulling.count(prop) == 0)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find should be enough, no need to use count

@mwestphal mwestphal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

questions and remarks

@mwestphal

Copy link
Copy Markdown
Member

Need any help moving forward @isaccunha ? :)

@isaccunha

Copy link
Copy Markdown
Author

I just pushed some changes, do you think it is ready and I can move on to testing and docs?

@mwestphal

Copy link
Copy Markdown
Member

I just pushed some changes, do you think it is ready and I can move on to testing and docs?

Ill take a look :)

@mwestphal mwestphal self-requested a review June 14, 2026 05:37
this->addBinding({mod_t::NONE, "P"}, "cycle_blending", "Scene", docBlend, f3d::interactor::BindingType::CYCLIC);
this->addBinding({mod_t::NONE, "Q"}, "toggle render.effect.ambient_occlusion","Scene", std::bind(docTgl, "Ambient occlusion", std::cref(opts.render.effect.ambient_occlusion)), f3d::interactor::BindingType::TOGGLE);
this->addBinding({mod_t::NONE, "A"}, "cycle_anti_aliasing","Scene", docAA, f3d::interactor::BindingType::CYCLIC);
this->addBinding({mod_t::CTRL, "B"},"cycle_backface_type","Scene",docBackface,f3d::interactor::BindingType::CYCLIC);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this->addBinding({mod_t::CTRL, "B"},"cycle_backface_type","Scene",docBackface,f3d::interactor::BindingType::CYCLIC);
this->addBinding({mod_t::CTRL, "B"},"cycle_backface_type", "Scene",docBackface,f3d::interactor::BindingType::CYCLIC);

@mwestphal mwestphal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still unclear in regards to the vtkProperty thing.

Lets discuss on discord if you can :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a bind to control backface culling

3 participants