needle-tools / needle-engine-support

Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development, and can be deployed anywhere. It is flexible, extensible and includes networking and XR - across platforms. Documentation at https://docs.needle.tools
547 stars 46 forks source link

When exiting AR while using Post Processing - 'No camera in scene found or available yet - can not create postprocessing effects' #135

Closed ROBYER1 closed 1 year ago

ROBYER1 commented 1 year ago

Describe the bug πŸ’¬

I have an AR Demo project, you can also find it here but you need to update to Needle Exporter 2.67.0-pre: https://github.com/ROBYER1/Needle-AR-Demo

When entering and exiting AR in this project on mobile or desktop, you get this error: 'No camera in scene found or available yet - can not create postprocessing effects' I also get some endless console spam of this after exiting AR: '1 LayersΒ {mask: 1}' image

Operating System πŸ‘©β€πŸ’»

Windows

What browsers are you seeing the problem on? πŸ„β€β™‚οΈ

Chrome, Mozilla XR

Editor Version 🎲

2022.x

Needle Exporter version

2.67.0-pre

Project Info (Unity only) πŸ“œ

{
  "ExportInfoGameObjectName": "Export Info",
  "ExportInfoGameObjectIsEnabled": true,
  "UnityProjectPath": "C:/Unity_Projects/NeedleARDemo/Assets",
  "UnityVersion": "2022.2.12f1",
  "SceneName": "ARDemo",
  "ProjectPath": "Needle/ARDemo",
  "ProjectDirectoryExists": true,
  "ProjectIsInstalled": true,
  "NeedleEngineInstalled": true,
  "HasNodeInstalled": true,
  "NodeVersion": "v18.15.0",
  "NpmVersion": "9.6.2",
  "HasTokTxInstalled": true,
  "HasMinimumToktxVersionInstalled": true,
  "RenderPipeline": "UniversalRenderPipelineAsset (UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset)",
  "GzipEnabled": false,
  "NeedleEngineExporterVersion": "2.67.0-pre",
  "NeedleEngineVersion": "2.67.0-pre",
  "NeedleEngineExporterPath": "Packages/com.needle.engine-exporter/package.json",
  "NeedleEnginePath": "Packages/com.needle.engine/package.json",
  "FileStats": "By Type:\r\nβ€’\t.glb β†’  x 3 = 0.5 mb\r\nβ€’\t<b>Total = 0.5 mb</b>\r\n----\r\nBy Directory:\r\nβ€’\tassets β†’  x 3 = 0.5 mb\r\n",
  "NeedleComponentsInScene": [
    "Needle.Engine.ExportInfo",
    "Needle.Engine.Codegen.ComponentGenerator",
    "Needle.Engine.Deployment.DeployToGlitch",
    "Needle.Engine.Components.GltfObject",
    "Needle.Engine.Components.WebARSessionRoot",
    "Needle.Engine.Components.TeleportTarget",
    "Needle.Engine.Components.ObjectRaycaster",
    "Needle.Engine.AdditionalData.LightShadowData",
    "Needle.Engine.Components.WebXR",
    "Needle.Engine.Components.WebXRSync",
    "Needle.Typescript.GeneratedComponents.WebXRInterface",
    "Needle.Engine.Components.OrbitControls",
    "Needle.Engine.AdditionalData.CameraARData",
    "Needle.Typescript.GeneratedComponents.AlignHeightToGround",
    "Needle.Typescript.GeneratedComponents.ARControls",
    "Needle.Typescript.GeneratedComponents.IsGround"
  ],
  "TypeCacheIsDirty": true,
  "TypeScriptTypes": []
}

Steps to reproduce πŸ”’

1. Hit Play in Scenes > ARDemo
2. On a phone with AR support accessing the build, or using WebXR API Simulation Extension in Chrome, Enter then Exit AR
3. See the error:

No camera in scene found or available yet - can not create postprocessing effects


### Reproduction β™»

[Bugreport-ARDemo-230327-051458_uw.zip](https://github.com/needle-tools/needle-engine-support/files/11080816/Bugreport-ARDemo-230327-051458_uw.zip)

### Validations 🩹

- [X] Follow our [Code of Conduct](https://github.com/needle-tools/needle-engine-support/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [docs](https://docs.needle.tools).
- [X] Check that there isn't [already an issue](https://github.com/needle-tools/needle-engine-support/issues) that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Needle-Engine-specific issue. For example if it's a Unity related bug, it should be reported to [Unity](https://unity3d.com/unity/qa/bug-reporting) instead.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/needle-tools/needle-engine-support/discussions) or join our [Discord Chat Server](https://discord.needle.tools).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
marwie commented 1 year ago

Thanks for the feedback - will check

ROBYER1 commented 1 year ago

Here is a more complete log, I am only using Tonemapping: Neutral in the scene, I wasn't able to copy/paste it tidily from Chrome Dev Console: image

marwie commented 1 year ago

Hi, thank you. Both issues should be fixed in the next version