Skip to content

Commit

Permalink
Add public API for transparent picking
Browse files Browse the repository at this point in the history
  • Loading branch information
show50726 committed Oct 17, 2024
1 parent e9f8085 commit f12d701
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
20 changes: 20 additions & 0 deletions filament/include/filament/View.h
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,26 @@ class UTILS_PUBLIC View : public FilamentAPI {
*/
bool isFrontFaceWindingInverted() const noexcept;

/**
* Enables or disables transparent picking. Disabled by default.
*
* When transparent picking is enabled, View::pick() will pick from both
* transparent and opaque renderables. When disabled, View::pick() will only
* pick from opaque renderables.
*
* @param enabled true enables transparent picking, false disables it.
*
* @note Transparent picking will create an extra pass for rendering depth
* from both transparent and opaque renderables.
*/
void setTransparentPickingEnabled(bool enabled) noexcept;

/**
* Returns true if transparent picking is enabled.
* See setTransparentPickingEnabled() for more information.
*/
bool isTransparentPickingEnabled() const noexcept;

/**
* Enables use of the stencil buffer.
*
Expand Down
8 changes: 8 additions & 0 deletions filament/src/View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,14 @@ bool View::isFrontFaceWindingInverted() const noexcept {
return downcast(this)->isFrontFaceWindingInverted();
}

void View::setTransparentPickingEnabled(bool enabled) noexcept {
downcast(this)->setTransparentPickingEnabled(enabled);
}

bool View::isTransparentPickingEnabled() const noexcept {
return downcast(this)->isTransparentPickingEnabled();
}

void View::setDynamicLightingOptions(float zLightNear, float zLightFar) noexcept {
downcast(this)->setDynamicLightingOptions(zLightNear, zLightFar);
}
Expand Down

0 comments on commit f12d701

Please sign in to comment.