Search Unity

ARFoundation Skybox camera or background

Discussion in 'AR' started by Edur-Games, Jan 15, 2019.

  1. Edur-Games

    Edur-Games

    Joined:
    Nov 21, 2017
    Posts:
    48
    Hi!
    Can I use a skybox as a background in the camera for ARFoundation?

    Thanks
     
    Agent0023 likes this.
  2. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    The ARCameraBackground script is what renders the camera feed to the background. You do not need to use this in order to enable pose tracking. The default Unity Camera (without this script) will give you a skybox. Is that what you mean? No camera feed at all?
     
    newguy123 likes this.
  3. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    This sounds like something I want to do. Is it possible to switch between a camera feed and a skybox during runtime, ie switch of the ARCameraBackground and display the skybox, and vica versa?
     
  4. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    Sure. You can either
    1. Have two cameras with different setups and toggle them OR
    2. Have one camera and disable the ARBackgroundCamera and switch the CameraClearFlags from solid color to skybox.
     
    newguy123 likes this.
  5. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Is it possible to do a LERP kind of thing between the two?
    Instead of the switch to just be instant, I'd like to fade between them
     
  6. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    if you make your own material you can grab the feed in a shader and apply many types of effect to the feed including fading it out
     
  7. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Could you give me some more info on this please? Just a standard material, then stick that into the camera background?
    Or what kind of material and where do I put it?
     
  8. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    You’d need to write your own shader
     
  9. alexkeroro1319

    alexkeroro1319

    Joined:
    Mar 7, 2021
    Posts:
    1
    Hi yea, did you figure out how to work this out?
     
  10. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    This was a while back now, but if I remember correctly, I could not make it work as they suggested.

    However I worked around it, by simply adding a large 3D sphere over my scene and applying a texture to it (I inverted the sphere's normals in 3ds Max so they point inward)

    At start of my app I would disable the sphere, and when I want to show it, I simply enabled it.
     
    alexkeroro1319 likes this.