fixing my bugs on vissibility

This commit is contained in:
samcake 2018-01-24 18:07:35 -08:00
parent 38242072e5
commit ae6a95ec0d
4 changed files with 19 additions and 7 deletions

View file

@ -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);

View file

@ -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;

View file

@ -389,7 +389,7 @@ protected:
QUrl _url;
bool _isVisible;
uint8_t _viewVisibilityMask { 0 };
uint8_t _viewVisibilityMask { render::ItemKey::VISIBLE_MASK_ALL };
gpu::Buffers _blendedVertexBuffers;

View file

@ -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);
}