Showing the changes to libraries/render-utils/src/MeshPartPayload.cpp (1 of 30 files). Show all
Unified · Split
| @@ -77,7 +77,7 @@ void MeshPartPayload::removeMaterial(graphics::MaterialPointer material) { · 76 unmodified lines | ||
| 77 | 77 | _drawMaterials.remove(material); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | −void MeshPartPayload::updateKey(bool isVisible, bool isLayered, uint8_t tagBits, bool isGroupCulled) { | |
| 80 | +void MeshPartPayload::updateKey(bool isVisible, bool isLayered, bool canCastShadow, uint8_t tagBits, bool isGroupCulled) { | |
| 81 | 81 | ItemKey::Builder builder; |
| 82 | 82 | builder.withTypeShape(); |
| 83 | 83 | |
| @@ -91,6 +91,10 @@ void MeshPartPayload::updateKey(bool isVisible, bool isLayered, uint8_t tagBits, · 7 unmodified lines | ||
| 91 | 91 | builder.withLayered(); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | + if (canCastShadow) { | |
| 95 | + builder.withShadowCaster(); | |
| 96 | + } | |
| 97 | + | |
| 94 | 98 | if (isGroupCulled) { |
| 95 | 99 | builder.withSubMetaCulled(); |
| 96 | 100 | } |
| @@ -328,7 +332,8 @@ void ModelMeshPartPayload::updateTransformForSkinnedMesh(const Transform& render · 231 unmodified lines | ||
| 328 | 332 | _worldBound.transform(boundTransform); |
| 329 | 333 | } |
| 330 | 334 | |
| 331 | −void ModelMeshPartPayload::updateKey(bool isVisible, bool isLayered, uint8_t tagBits, bool isGroupCulled) { | |
| 335 | +// Note that this method is called for models but not for shapes | |
| 336 | +void ModelMeshPartPayload::updateKey(bool isVisible, bool isLayered, bool canCastShadow, uint8_t tagBits, bool isGroupCulled) { | |
| 332 | 337 | ItemKey::Builder builder; |
| 333 | 338 | builder.withTypeShape(); |
| 334 | 339 | |
| @@ -342,6 +347,10 @@ void ModelMeshPartPayload::updateKey(bool isVisible, bool isLayered, uint8_t tag · 7 unmodified lines | ||
| 342 | 347 | builder.withLayered(); |
| 343 | 348 | } |
| 344 | 349 | |
| 350 | + if (canCastShadow) { | |
| 351 | + builder.withShadowCaster(); | |
| 352 | + } | |
| 353 | + | |
| 345 | 354 | if (isGroupCulled) { |
| 346 | 355 | builder.withSubMetaCulled(); |
| 347 | 356 | } |