mirror of
https://github.com/overte-org/overte.git
synced 2025-08-14 11:09:38 +02:00
fixing my bugs on vissibility
This commit is contained in:
parent
38242072e5
commit
ae6a95ec0d
4 changed files with 19 additions and 7 deletions
|
@ -205,7 +205,7 @@ public:
|
|||
|
||||
void SecondaryCameraRenderTask::build(JobModel& task, const render::Varying& inputs, render::Varying& outputs, render::CullFunctor cullFunctor, bool isDeferred) {
|
||||
const auto cachedArg = task.addJob<SecondaryCameraJob>("SecondaryCamera");
|
||||
const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor);
|
||||
const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor, render::ItemKey::VISIBLE_MASK_1, render::ItemKey::VISIBLE_MASK_1);
|
||||
assert(items.canCast<RenderFetchCullSortTask::Output>());
|
||||
if (!isDeferred) {
|
||||
task.addJob<RenderForwardTask>("Forward", items);
|
||||
|
|
|
@ -87,7 +87,7 @@ void ModelOverlay::update(float deltatime) {
|
|||
if (_visibleDirty) {
|
||||
_visibleDirty = false;
|
||||
// don't show overlays in mirrors
|
||||
_model->setVisibleInScene(getVisible(), scene, render::ItemKey::VISIBLE_MASK_0 * getVisible());
|
||||
_model->setVisibleInScene(getVisible(), scene, render::ItemKey::VISIBLE_MASK_0);
|
||||
}
|
||||
if (_drawInFrontDirty) {
|
||||
_drawInFrontDirty = false;
|
||||
|
|
|
@ -389,7 +389,7 @@ protected:
|
|||
|
||||
QUrl _url;
|
||||
bool _isVisible;
|
||||
uint8_t _viewVisibilityMask { 0 };
|
||||
uint8_t _viewVisibilityMask { render::ItemKey::VISIBLE_MASK_ALL };
|
||||
|
||||
gpu::Buffers _blendedVertexBuffers;
|
||||
|
||||
|
|
|
@ -96,6 +96,18 @@ public:
|
|||
Builder& withViewSpace() { _flags.set(VIEW_SPACE); return (*this); }
|
||||
Builder& withDynamic() { _flags.set(DYNAMIC); return (*this); }
|
||||
Builder& withDeformed() { _flags.set(DEFORMED); return (*this); }
|
||||
Builder& withVisible(uint8_t maskIndex = NUM_VISIBLE_MASK_INDICES) {
|
||||
if (maskIndex == NUM_VISIBLE_MASK_INDICES) {
|
||||
_flags.reset(INVISIBLE0);
|
||||
_flags.reset(INVISIBLE1);
|
||||
_flags.reset(INVISIBLE2);
|
||||
_flags.reset(INVISIBLE3);
|
||||
}
|
||||
else {
|
||||
_flags.reset(INVISIBLE0 + maskIndex);
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
Builder& withInvisible(uint8_t maskIndex = NUM_VISIBLE_MASK_INDICES) {
|
||||
if (maskIndex == NUM_VISIBLE_MASK_INDICES) {
|
||||
_flags.set(INVISIBLE0);
|
||||
|
@ -109,16 +121,16 @@ public:
|
|||
}
|
||||
Builder& withViewVisibilityMask(uint8_t mask) {
|
||||
if (mask & render::ItemKey::VISIBLE_MASK_0) {
|
||||
_flags.set(INVISIBLE0);
|
||||
_flags.reset(INVISIBLE0);
|
||||
}
|
||||
if (mask & render::ItemKey::VISIBLE_MASK_1) {
|
||||
_flags.set(INVISIBLE1);
|
||||
_flags.reset(INVISIBLE1);
|
||||
}
|
||||
if (mask & render::ItemKey::VISIBLE_MASK_2) {
|
||||
_flags.set(INVISIBLE2);
|
||||
_flags.reset(INVISIBLE2);
|
||||
}
|
||||
if (mask & render::ItemKey::VISIBLE_MASK_3) {
|
||||
_flags.set(INVISIBLE3);
|
||||
_flags.reset(INVISIBLE3);
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue