mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 22:21:16 +02:00
Added don't castr shadow flag to entity and shape classes.
This commit is contained in:
parent
34aab4a9c8
commit
23a29b8d4b
9 changed files with 80 additions and 5 deletions
|
@ -128,6 +128,7 @@ public:
|
||||||
DEFINE_PROPERTY_REF(PROP_SCRIPT, Script, script, QString, ENTITY_ITEM_DEFAULT_SCRIPT);
|
DEFINE_PROPERTY_REF(PROP_SCRIPT, Script, script, QString, ENTITY_ITEM_DEFAULT_SCRIPT);
|
||||||
DEFINE_PROPERTY(PROP_SCRIPT_TIMESTAMP, ScriptTimestamp, scriptTimestamp, quint64, ENTITY_ITEM_DEFAULT_SCRIPT_TIMESTAMP);
|
DEFINE_PROPERTY(PROP_SCRIPT_TIMESTAMP, ScriptTimestamp, scriptTimestamp, quint64, ENTITY_ITEM_DEFAULT_SCRIPT_TIMESTAMP);
|
||||||
DEFINE_PROPERTY_REF(PROP_COLLISION_SOUND_URL, CollisionSoundURL, collisionSoundURL, QString, ENTITY_ITEM_DEFAULT_COLLISION_SOUND_URL);
|
DEFINE_PROPERTY_REF(PROP_COLLISION_SOUND_URL, CollisionSoundURL, collisionSoundURL, QString, ENTITY_ITEM_DEFAULT_COLLISION_SOUND_URL);
|
||||||
|
DEFINE_PROPERTY(PROP_DONT_CAST_SHADOW, CanCastShadow, canCastShadow, bool, ENTITY_ITEM_DEFAULT_DONT_CAST_SHADOW);
|
||||||
DEFINE_PROPERTY_REF(PROP_COLOR, Color, color, xColor, particle::DEFAULT_COLOR);
|
DEFINE_PROPERTY_REF(PROP_COLOR, Color, color, xColor, particle::DEFAULT_COLOR);
|
||||||
DEFINE_PROPERTY_REF(PROP_COLOR_SPREAD, ColorSpread, colorSpread, xColor, particle::DEFAULT_COLOR_SPREAD);
|
DEFINE_PROPERTY_REF(PROP_COLOR_SPREAD, ColorSpread, colorSpread, xColor, particle::DEFAULT_COLOR_SPREAD);
|
||||||
DEFINE_PROPERTY_REF(PROP_COLOR_START, ColorStart, colorStart, xColor, particle::DEFAULT_COLOR);
|
DEFINE_PROPERTY_REF(PROP_COLOR_START, ColorStart, colorStart, xColor, particle::DEFAULT_COLOR);
|
||||||
|
|
|
@ -46,6 +46,7 @@ const quint32 ENTITY_ITEM_DEFAULT_STATIC_CERTIFICATE_VERSION = 0;
|
||||||
const float ENTITY_ITEM_DEFAULT_ALPHA = 1.0f;
|
const float ENTITY_ITEM_DEFAULT_ALPHA = 1.0f;
|
||||||
const float ENTITY_ITEM_DEFAULT_LOCAL_RENDER_ALPHA = 1.0f;
|
const float ENTITY_ITEM_DEFAULT_LOCAL_RENDER_ALPHA = 1.0f;
|
||||||
const bool ENTITY_ITEM_DEFAULT_VISIBLE = true;
|
const bool ENTITY_ITEM_DEFAULT_VISIBLE = true;
|
||||||
|
const bool ENTITY_ITEM_DEFAULT_DONT_CAST_SHADOW { false };
|
||||||
|
|
||||||
const QString ENTITY_ITEM_DEFAULT_SCRIPT = QString("");
|
const QString ENTITY_ITEM_DEFAULT_SCRIPT = QString("");
|
||||||
const quint64 ENTITY_ITEM_DEFAULT_SCRIPT_TIMESTAMP = 0;
|
const quint64 ENTITY_ITEM_DEFAULT_SCRIPT_TIMESTAMP = 0;
|
||||||
|
|
|
@ -31,6 +31,7 @@ enum EntityPropertyList {
|
||||||
PROP_SCRIPT,
|
PROP_SCRIPT,
|
||||||
|
|
||||||
// these properties are supported by some derived classes
|
// these properties are supported by some derived classes
|
||||||
|
PROP_DONT_CAST_SHADOW,
|
||||||
PROP_COLOR,
|
PROP_COLOR,
|
||||||
|
|
||||||
// these are used by models only
|
// these are used by models only
|
||||||
|
|
|
@ -53,6 +53,8 @@ void ModelEntityItem::setTextures(const QString& textures) {
|
||||||
|
|
||||||
EntityItemProperties ModelEntityItem::getProperties(EntityPropertyFlags desiredProperties) const {
|
EntityItemProperties ModelEntityItem::getProperties(EntityPropertyFlags desiredProperties) const {
|
||||||
EntityItemProperties properties = EntityItem::getProperties(desiredProperties); // get the properties from our base class
|
EntityItemProperties properties = EntityItem::getProperties(desiredProperties); // get the properties from our base class
|
||||||
|
|
||||||
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(canCastShadow, getCanCastShadow);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(color, getXColor);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(color, getXColor);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(modelURL, getModelURL);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(modelURL, getModelURL);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(compoundShapeURL, getCompoundShapeURL);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(compoundShapeURL, getCompoundShapeURL);
|
||||||
|
@ -64,6 +66,7 @@ EntityItemProperties ModelEntityItem::getProperties(EntityPropertyFlags desiredP
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(jointTranslations, getJointTranslations);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(jointTranslations, getJointTranslations);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(relayParentJoints, getRelayParentJoints);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(relayParentJoints, getRelayParentJoints);
|
||||||
_animationProperties.getProperties(properties);
|
_animationProperties.getProperties(properties);
|
||||||
|
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,6 +74,7 @@ bool ModelEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = false;
|
bool somethingChanged = false;
|
||||||
somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
||||||
|
|
||||||
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(canCastShadow, setCanCastShadow);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(modelURL, setModelURL);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(modelURL, setModelURL);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(compoundShapeURL, setCompoundShapeURL);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(compoundShapeURL, setCompoundShapeURL);
|
||||||
|
@ -112,6 +116,7 @@ int ModelEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data,
|
||||||
const unsigned char* dataAt = data;
|
const unsigned char* dataAt = data;
|
||||||
bool animationPropertiesChanged = false;
|
bool animationPropertiesChanged = false;
|
||||||
|
|
||||||
|
READ_ENTITY_PROPERTY(PROP_DONT_CAST_SHADOW, bool, setCanCastShadow);
|
||||||
READ_ENTITY_PROPERTY(PROP_COLOR, rgbColor, setColor);
|
READ_ENTITY_PROPERTY(PROP_COLOR, rgbColor, setColor);
|
||||||
READ_ENTITY_PROPERTY(PROP_MODEL_URL, QString, setModelURL);
|
READ_ENTITY_PROPERTY(PROP_MODEL_URL, QString, setModelURL);
|
||||||
READ_ENTITY_PROPERTY(PROP_COMPOUND_SHAPE_URL, QString, setCompoundShapeURL);
|
READ_ENTITY_PROPERTY(PROP_COMPOUND_SHAPE_URL, QString, setCompoundShapeURL);
|
||||||
|
@ -148,6 +153,7 @@ int ModelEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data,
|
||||||
EntityPropertyFlags ModelEntityItem::getEntityProperties(EncodeBitstreamParams& params) const {
|
EntityPropertyFlags ModelEntityItem::getEntityProperties(EncodeBitstreamParams& params) const {
|
||||||
EntityPropertyFlags requestedProperties = EntityItem::getEntityProperties(params);
|
EntityPropertyFlags requestedProperties = EntityItem::getEntityProperties(params);
|
||||||
|
|
||||||
|
requestedProperties += PROP_DONT_CAST_SHADOW;
|
||||||
requestedProperties += PROP_MODEL_URL;
|
requestedProperties += PROP_MODEL_URL;
|
||||||
requestedProperties += PROP_COMPOUND_SHAPE_URL;
|
requestedProperties += PROP_COMPOUND_SHAPE_URL;
|
||||||
requestedProperties += PROP_TEXTURES;
|
requestedProperties += PROP_TEXTURES;
|
||||||
|
@ -172,6 +178,7 @@ void ModelEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBit
|
||||||
|
|
||||||
bool successPropertyFits = true;
|
bool successPropertyFits = true;
|
||||||
|
|
||||||
|
APPEND_ENTITY_PROPERTY(PROP_DONT_CAST_SHADOW, getCanCastShadow());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_COLOR, getColor());
|
APPEND_ENTITY_PROPERTY(PROP_COLOR, getColor());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_MODEL_URL, getModelURL());
|
APPEND_ENTITY_PROPERTY(PROP_MODEL_URL, getModelURL());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_COMPOUND_SHAPE_URL, getCompoundShapeURL());
|
APPEND_ENTITY_PROPERTY(PROP_COMPOUND_SHAPE_URL, getCompoundShapeURL());
|
||||||
|
@ -191,8 +198,6 @@ void ModelEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBit
|
||||||
APPEND_ENTITY_PROPERTY(PROP_JOINT_TRANSLATIONS, getJointTranslations());
|
APPEND_ENTITY_PROPERTY(PROP_JOINT_TRANSLATIONS, getJointTranslations());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// added update function back for property fix
|
// added update function back for property fix
|
||||||
void ModelEntityItem::update(const quint64& now) {
|
void ModelEntityItem::update(const quint64& now) {
|
||||||
|
|
||||||
|
@ -290,6 +295,7 @@ void ModelEntityItem::updateFrameCount() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelEntityItem::debugDump() const {
|
void ModelEntityItem::debugDump() const {
|
||||||
|
qCDebug(entities) << " can cast shadow" << getCanCastShadow();
|
||||||
qCDebug(entities) << "ModelEntityItem id:" << getEntityItemID();
|
qCDebug(entities) << "ModelEntityItem id:" << getEntityItemID();
|
||||||
qCDebug(entities) << " edited ago:" << getEditedAgo();
|
qCDebug(entities) << " edited ago:" << getEditedAgo();
|
||||||
qCDebug(entities) << " position:" << getWorldPosition();
|
qCDebug(entities) << " position:" << getWorldPosition();
|
||||||
|
@ -571,15 +577,16 @@ QVector<bool> ModelEntityItem::getJointTranslationsSet() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
xColor ModelEntityItem::getXColor() const {
|
xColor ModelEntityItem::getXColor() const {
|
||||||
xColor color = { _color[RED_INDEX], _color[GREEN_INDEX], _color[BLUE_INDEX] }; return color;
|
xColor color = { _color[RED_INDEX], _color[GREEN_INDEX], _color[BLUE_INDEX] }; return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModelEntityItem::hasModel() const {
|
bool ModelEntityItem::hasModel() const {
|
||||||
return resultWithReadLock<bool>([&] {
|
return resultWithReadLock<bool>([&] {
|
||||||
return !_modelURL.isEmpty();
|
return !_modelURL.isEmpty();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModelEntityItem::hasCompoundShapeURL() const {
|
bool ModelEntityItem::hasCompoundShapeURL() const {
|
||||||
return !_compoundShapeURL.get().isEmpty();
|
return !_compoundShapeURL.get().isEmpty();
|
||||||
}
|
}
|
||||||
|
@ -722,3 +729,25 @@ bool ModelEntityItem::isAnimatingSomething() const {
|
||||||
(_animationProperties.getFPS() != 0.0f);
|
(_animationProperties.getFPS() != 0.0f);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ModelEntityItem::getCanCastShadow() const {
|
||||||
|
bool result;
|
||||||
|
withReadLock([&] {
|
||||||
|
result = _canCastShadow;
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ModelEntityItem::setCanCastShadow(bool value) {
|
||||||
|
bool changed = false;
|
||||||
|
withWriteLock([&] {
|
||||||
|
if (_canCastShadow != value) {
|
||||||
|
changed = true;
|
||||||
|
_canCastShadow = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
emit requestRenderUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -131,6 +131,9 @@ public:
|
||||||
QVector<glm::vec3> getJointTranslations() const;
|
QVector<glm::vec3> getJointTranslations() const;
|
||||||
QVector<bool> getJointTranslationsSet() const;
|
QVector<bool> getJointTranslationsSet() const;
|
||||||
|
|
||||||
|
bool getCanCastShadow() const;
|
||||||
|
void setCanCastShadow(bool value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setAnimationSettings(const QString& value); // only called for old bitstream format
|
void setAnimationSettings(const QString& value); // only called for old bitstream format
|
||||||
ShapeType computeTrueShapeType() const;
|
ShapeType computeTrueShapeType() const;
|
||||||
|
@ -171,6 +174,8 @@ protected:
|
||||||
|
|
||||||
ShapeType _shapeType = SHAPE_TYPE_NONE;
|
ShapeType _shapeType = SHAPE_TYPE_NONE;
|
||||||
|
|
||||||
|
bool _canCastShadow{ ENTITY_ITEM_DEFAULT_DONT_CAST_SHADOW };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64_t _lastAnimated{ 0 };
|
uint64_t _lastAnimated{ 0 };
|
||||||
AnimationPropertyGroup _previousAnimationProperties;
|
AnimationPropertyGroup _previousAnimationProperties;
|
||||||
|
|
|
@ -91,6 +91,8 @@ EntityItemProperties ShapeEntityItem::getProperties(EntityPropertyFlags desiredP
|
||||||
EntityItemProperties properties = EntityItem::getProperties(desiredProperties); // get the properties from our base class
|
EntityItemProperties properties = EntityItem::getProperties(desiredProperties); // get the properties from our base class
|
||||||
properties.setColor(getXColor());
|
properties.setColor(getXColor());
|
||||||
properties.setShape(entity::stringFromShape(getShape()));
|
properties.setShape(entity::stringFromShape(getShape()));
|
||||||
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(canCastShadow, getCanCastShadow);
|
||||||
|
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,6 +131,7 @@ bool ShapeEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(alpha, setAlpha);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(alpha, setAlpha);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(shape, setShape);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(shape, setShape);
|
||||||
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(canCastShadow, setCanCastShadow);
|
||||||
|
|
||||||
if (somethingChanged) {
|
if (somethingChanged) {
|
||||||
bool wantDebug = false;
|
bool wantDebug = false;
|
||||||
|
@ -154,6 +157,7 @@ int ShapeEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data,
|
||||||
READ_ENTITY_PROPERTY(PROP_SHAPE, QString, setShape);
|
READ_ENTITY_PROPERTY(PROP_SHAPE, QString, setShape);
|
||||||
READ_ENTITY_PROPERTY(PROP_COLOR, rgbColor, setColor);
|
READ_ENTITY_PROPERTY(PROP_COLOR, rgbColor, setColor);
|
||||||
READ_ENTITY_PROPERTY(PROP_ALPHA, float, setAlpha);
|
READ_ENTITY_PROPERTY(PROP_ALPHA, float, setAlpha);
|
||||||
|
READ_ENTITY_PROPERTY(PROP_DONT_CAST_SHADOW, bool, setCanCastShadow);
|
||||||
|
|
||||||
return bytesRead;
|
return bytesRead;
|
||||||
}
|
}
|
||||||
|
@ -165,6 +169,8 @@ EntityPropertyFlags ShapeEntityItem::getEntityProperties(EncodeBitstreamParams&
|
||||||
requestedProperties += PROP_SHAPE;
|
requestedProperties += PROP_SHAPE;
|
||||||
requestedProperties += PROP_COLOR;
|
requestedProperties += PROP_COLOR;
|
||||||
requestedProperties += PROP_ALPHA;
|
requestedProperties += PROP_ALPHA;
|
||||||
|
requestedProperties += PROP_DONT_CAST_SHADOW;
|
||||||
|
|
||||||
return requestedProperties;
|
return requestedProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,6 +186,7 @@ void ShapeEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBit
|
||||||
APPEND_ENTITY_PROPERTY(PROP_SHAPE, entity::stringFromShape(getShape()));
|
APPEND_ENTITY_PROPERTY(PROP_SHAPE, entity::stringFromShape(getShape()));
|
||||||
APPEND_ENTITY_PROPERTY(PROP_COLOR, getColor());
|
APPEND_ENTITY_PROPERTY(PROP_COLOR, getColor());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_ALPHA, getAlpha());
|
APPEND_ENTITY_PROPERTY(PROP_ALPHA, getAlpha());
|
||||||
|
APPEND_ENTITY_PROPERTY(PROP_DONT_CAST_SHADOW, getCanCastShadow());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShapeEntityItem::setColor(const rgbColor& value) {
|
void ShapeEntityItem::setColor(const rgbColor& value) {
|
||||||
|
@ -259,6 +266,7 @@ void ShapeEntityItem::debugDump() const {
|
||||||
qCDebug(entities) << " dimensions:" << debugTreeVector(getScaledDimensions());
|
qCDebug(entities) << " dimensions:" << debugTreeVector(getScaledDimensions());
|
||||||
qCDebug(entities) << " getLastEdited:" << debugTime(getLastEdited(), now);
|
qCDebug(entities) << " getLastEdited:" << debugTime(getLastEdited(), now);
|
||||||
qCDebug(entities) << "SHAPE EntityItem Ptr:" << this;
|
qCDebug(entities) << "SHAPE EntityItem Ptr:" << this;
|
||||||
|
qCDebug(entities) << " can cast shadow" << getCanCastShadow();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShapeEntityItem::computeShapeInfo(ShapeInfo& info) {
|
void ShapeEntityItem::computeShapeInfo(ShapeInfo& info) {
|
||||||
|
@ -362,3 +370,24 @@ ShapeType ShapeEntityItem::getShapeType() const {
|
||||||
return _collisionShapeType;
|
return _collisionShapeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ShapeEntityItem::getCanCastShadow() const {
|
||||||
|
bool result;
|
||||||
|
withReadLock([&] {
|
||||||
|
result = _canCastShadow;
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShapeEntityItem::setCanCastShadow(bool value) {
|
||||||
|
bool changed = false;
|
||||||
|
withWriteLock([&] {
|
||||||
|
if (_canCastShadow != value) {
|
||||||
|
changed = true;
|
||||||
|
_canCastShadow = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
emit requestRenderUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -101,6 +101,9 @@ public:
|
||||||
virtual void computeShapeInfo(ShapeInfo& info) override;
|
virtual void computeShapeInfo(ShapeInfo& info) override;
|
||||||
virtual ShapeType getShapeType() const override;
|
virtual ShapeType getShapeType() const override;
|
||||||
|
|
||||||
|
bool getCanCastShadow() const;
|
||||||
|
void setCanCastShadow(bool value);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
float _alpha { 1 };
|
float _alpha { 1 };
|
||||||
|
@ -111,6 +114,8 @@ protected:
|
||||||
//! prior functionality where new or unsupported shapes are treated as
|
//! prior functionality where new or unsupported shapes are treated as
|
||||||
//! ellipsoids.
|
//! ellipsoids.
|
||||||
ShapeType _collisionShapeType{ ShapeType::SHAPE_TYPE_ELLIPSOID };
|
ShapeType _collisionShapeType{ ShapeType::SHAPE_TYPE_ELLIPSOID };
|
||||||
|
|
||||||
|
bool _canCastShadow { ENTITY_ITEM_DEFAULT_DONT_CAST_SHADOW };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_ShapeEntityItem_h
|
#endif // hifi_ShapeEntityItem_h
|
||||||
|
|
|
@ -224,7 +224,7 @@ void RenderShadowTask::build(JobModel& task, const render::Varying& input, rende
|
||||||
const auto setupOutput = task.addJob<RenderShadowSetup>("ShadowSetup");
|
const auto setupOutput = task.addJob<RenderShadowSetup>("ShadowSetup");
|
||||||
const auto queryResolution = setupOutput.getN<RenderShadowSetup::Outputs>(2);
|
const auto queryResolution = setupOutput.getN<RenderShadowSetup::Outputs>(2);
|
||||||
// Fetch and cull the items from the scene
|
// Fetch and cull the items from the scene
|
||||||
static const auto shadowCasterFilter = ItemFilter::Builder::visibleWorldItems().withTypeShape().withOpaque().withoutLayered().withTagBits(tagBits, tagMask);
|
static const auto shadowCasterFilter = ItemFilter::Builder::visibleWorldItems().withTypeShape().withOpaque().withoutLayered().withTagBits(tagBits, tagMask).withNoShadowCaster();
|
||||||
const auto fetchInput = FetchSpatialTree::Inputs(shadowCasterFilter, queryResolution).asVarying();
|
const auto fetchInput = FetchSpatialTree::Inputs(shadowCasterFilter, queryResolution).asVarying();
|
||||||
const auto shadowSelection = task.addJob<FetchSpatialTree>("FetchShadowTree", fetchInput);
|
const auto shadowSelection = task.addJob<FetchSpatialTree>("FetchShadowTree", fetchInput);
|
||||||
const auto selectionInputs = FetchSpatialSelection::Inputs(shadowSelection, shadowCasterFilter).asVarying();
|
const auto selectionInputs = FetchSpatialSelection::Inputs(shadowSelection, shadowCasterFilter).asVarying();
|
||||||
|
@ -398,7 +398,7 @@ void RenderShadowCascadeSetup::run(const render::RenderContextPointer& renderCon
|
||||||
|
|
||||||
const auto globalShadow = lightStage->getCurrentKeyShadow();
|
const auto globalShadow = lightStage->getCurrentKeyShadow();
|
||||||
if (globalShadow && _cascadeIndex<globalShadow->getCascadeCount()) {
|
if (globalShadow && _cascadeIndex<globalShadow->getCascadeCount()) {
|
||||||
output.edit0() = ItemFilter::Builder::visibleWorldItems().withTypeShape().withOpaque().withoutLayered().withTagBits(_tagBits, _tagMask).withShadowCaster();
|
output.edit0() = ItemFilter::Builder::visibleWorldItems().withTypeShape().withOpaque().withoutLayered().withTagBits(_tagBits, _tagMask).withNoShadowCaster();
|
||||||
|
|
||||||
// Set the keylight render args
|
// Set the keylight render args
|
||||||
auto& cascade = globalShadow->getCascade(_cascadeIndex);
|
auto& cascade = globalShadow->getCascade(_cascadeIndex);
|
||||||
|
|
|
@ -120,7 +120,10 @@ public:
|
||||||
Builder& withDynamic() { _flags.set(DYNAMIC); return (*this); }
|
Builder& withDynamic() { _flags.set(DYNAMIC); return (*this); }
|
||||||
Builder& withDeformed() { _flags.set(DEFORMED); return (*this); }
|
Builder& withDeformed() { _flags.set(DEFORMED); return (*this); }
|
||||||
Builder& withInvisible() { _flags.set(INVISIBLE); return (*this); }
|
Builder& withInvisible() { _flags.set(INVISIBLE); return (*this); }
|
||||||
|
|
||||||
|
Builder& withNoShadowCaster() { _flags.reset(SHADOW_CASTER); return (*this); }
|
||||||
Builder& withShadowCaster() { _flags.set(SHADOW_CASTER); return (*this); }
|
Builder& withShadowCaster() { _flags.set(SHADOW_CASTER); return (*this); }
|
||||||
|
|
||||||
Builder& withLayered() { _flags.set(LAYERED); return (*this); }
|
Builder& withLayered() { _flags.set(LAYERED); return (*this); }
|
||||||
|
|
||||||
Builder& withTag(Tag tag) { _flags.set(FIRST_TAG_BIT + tag); return (*this); }
|
Builder& withTag(Tag tag) { _flags.set(FIRST_TAG_BIT + tag); return (*this); }
|
||||||
|
@ -155,6 +158,7 @@ public:
|
||||||
bool isInvisible() const { return _flags[INVISIBLE]; }
|
bool isInvisible() const { return _flags[INVISIBLE]; }
|
||||||
|
|
||||||
bool isShadowCaster() const { return _flags[SHADOW_CASTER]; }
|
bool isShadowCaster() const { return _flags[SHADOW_CASTER]; }
|
||||||
|
bool isNotShadowCaster() const { return !_flags[SHADOW_CASTER]; }
|
||||||
|
|
||||||
bool isLayered() const { return _flags[LAYERED]; }
|
bool isLayered() const { return _flags[LAYERED]; }
|
||||||
bool isSpatial() const { return !isLayered(); }
|
bool isSpatial() const { return !isLayered(); }
|
||||||
|
|
Loading…
Reference in a new issue