mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 21:03:17 +02:00
WIP - clean-up.
This commit is contained in:
parent
81c9e449e6
commit
6a9bbaf0a5
4 changed files with 5 additions and 7 deletions
|
@ -159,7 +159,7 @@ Item::Bound EntityRenderer::getBound() {
|
|||
|
||||
ItemKey EntityRenderer::getKey() {
|
||||
if (isTransparent()) {
|
||||
return ItemKey::Builder::transparentShape().withTypeMeta().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1).withNoShadowCaster();
|
||||
return ItemKey::Builder::transparentShape().withTypeMeta().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1);
|
||||
}
|
||||
|
||||
return ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1).withShadowCaster();
|
||||
|
|
|
@ -87,8 +87,6 @@ void MeshPartPayload::updateKey(bool isVisible, bool isLayered, bool canCastShad
|
|||
|
||||
if (canCastShadow) {
|
||||
builder.withShadowCaster();
|
||||
} else {
|
||||
builder.withNoShadowCaster();
|
||||
}
|
||||
|
||||
if (isGroupCulled) {
|
||||
|
@ -413,6 +411,7 @@ void ModelMeshPartPayload::updateTransformForSkinnedMesh(const Transform& render
|
|||
_worldBound.transform(boundTransform);
|
||||
}
|
||||
|
||||
// Note that this method is called for models but not for shapes
|
||||
void ModelMeshPartPayload::updateKey(bool isVisible, bool isLayered, bool canCastShadow, uint8_t tagBits, bool isGroupCulled) {
|
||||
ItemKey::Builder builder;
|
||||
builder.withTypeShape();
|
||||
|
@ -429,8 +428,6 @@ void ModelMeshPartPayload::updateKey(bool isVisible, bool isLayered, bool canCas
|
|||
|
||||
if (canCastShadow) {
|
||||
builder.withShadowCaster();
|
||||
} else {
|
||||
builder.withNoShadowCaster();
|
||||
}
|
||||
|
||||
if (isGroupCulled) {
|
||||
|
|
|
@ -223,7 +223,10 @@ void RenderShadowTask::build(JobModel& task, const render::Varying& input, rende
|
|||
const auto setupOutput = task.addJob<RenderShadowSetup>("ShadowSetup");
|
||||
const auto queryResolution = setupOutput.getN<RenderShadowSetup::Outputs>(2);
|
||||
// Fetch and cull the items from the scene
|
||||
|
||||
// Enable models to not cast shadows (otherwise, models will always cast shadows)
|
||||
static const auto shadowCasterFilter = ItemFilter::Builder::visibleWorldItems().withTypeShape().withOpaque().withoutLayered().withTagBits(tagBits, tagMask).withShadowCaster();
|
||||
|
||||
const auto fetchInput = FetchSpatialTree::Inputs(shadowCasterFilter, queryResolution).asVarying();
|
||||
const auto shadowSelection = task.addJob<FetchSpatialTree>("FetchShadowTree", fetchInput);
|
||||
const auto selectionInputs = FetchSpatialSelection::Inputs(shadowSelection, shadowCasterFilter).asVarying();
|
||||
|
|
|
@ -123,7 +123,6 @@ public:
|
|||
Builder& withDeformed() { _flags.set(DEFORMED); return (*this); }
|
||||
Builder& withInvisible() { _flags.set(INVISIBLE); return (*this); }
|
||||
Builder& withShadowCaster() { _flags.set(SHADOW_CASTER); return (*this); }
|
||||
Builder& withNoShadowCaster() { _flags.reset(SHADOW_CASTER); return (*this); }
|
||||
Builder& withLayered() { _flags.set(LAYERED); return (*this); }
|
||||
Builder& withMetaCullGroup() { _flags.set(META_CULL_GROUP); return (*this); }
|
||||
Builder& withSubMetaCulled() { _flags.set(SUB_META_CULLED); return (*this); }
|
||||
|
@ -227,7 +226,6 @@ public:
|
|||
Builder& withVisible() { _value.reset(ItemKey::INVISIBLE); _mask.set(ItemKey::INVISIBLE); return (*this); }
|
||||
Builder& withInvisible() { _value.set(ItemKey::INVISIBLE); _mask.set(ItemKey::INVISIBLE); return (*this); }
|
||||
|
||||
Builder& withNoShadowCaster() { _value.reset(ItemKey::SHADOW_CASTER); _mask.set(ItemKey::SHADOW_CASTER); return (*this); }
|
||||
Builder& withShadowCaster() { _value.set(ItemKey::SHADOW_CASTER); _mask.set(ItemKey::SHADOW_CASTER); return (*this); }
|
||||
|
||||
Builder& withoutLayered() { _value.reset(ItemKey::LAYERED); _mask.set(ItemKey::LAYERED); return (*this); }
|
||||
|
|
Loading…
Reference in a new issue