Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

disable bvh, fix layer for shadow component #7660

Merged
merged 1 commit into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/engine/src/scene/components/ModelComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ function ModelReactor({ root }: EntityReactorProps) {
scene.traverse(generateMeshBVH)
}
setBoundingBoxComponent(entity)
enableObjectLayer(scene, ObjectLayers.Camera, modelComponent.generateBVH.value)
/** @todo - improve BVH implementation */
// enableObjectLayer(scene, ObjectLayers.Camera, modelComponent.generateBVH.value)
removeComponent(entity, SceneAssetPendingTagComponent)

return () => removeObjectFromGroup(entity, scene)
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/src/scene/systems/ShadowSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export default async function ShadowSystem(world: World) {
const shadowOffset = new Vector3(0, 0.01, 0)

const execute = () => {
sceneObjects = Array.from(Engine.instance.currentWorld.objectLayerList[ObjectLayers.Scene] || [])
sceneObjects = Array.from(Engine.instance.currentWorld.objectLayerList[ObjectLayers.Camera] || [])

const useShadows = getShadowsEnabled()
if (!useShadows && !Engine.instance.isEditor) {
Expand Down