Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Troubleshooting Marker-Based AR water plane rising in cities? Please help!

Discussion in 'AR' started by JParkr, Jun 30, 2023.

  1. JParkr

    JParkr

    Joined:
    Jun 26, 2023
    Posts:
    2
    Hi I am a student trying to assess the capabilities of AR being in use in accordance to existing buildings and streets. I wanted to make a tool to be able to imagine water being flooded within our cities. However, I was having trouble with a number of things and I was hoping someone could give some advice/insight.

    Initially I was thinking Marker-based AR would be an easy tool for me starting off in this project because I don't really have coding or AR experience. I have drafting and 3d modelling experience coming from my field of studies. So coming from this, My initial plan was to create an invisible 3D game object that would be a digital twin of the existing buildings, to use it to clip the water plane. However, I could not find any way that would explain to be step by step how to perform this. So I moved on with my plan by simply making holes to the water plane where the buildings would be, and then to rise that water plane up using ui buttons.

    And then I realized I didn't take into account the occlusion where the water plan should be hidden from existing buildings. Therefore I started to manipulate the water plane itself and cut it more and more to essentially just fit the street.

    When I was testing this app, the calibration of the object was VERY difficult. I got to a point where when I'm adjusting the position of the object within the prefab, I was moving around in increments of 10000. Also even if I tried to adjust the size of the object or the camera in unity, the end result object in the built app seemed to never become large enough to cover the whole street. The object is also very jittery and does not stay on the same spot(marker). it moves when I move my phone camera.

    Now I am thinking maybe my methodology was wrong. Should I continue with this in marker based AR? or should I switch to something Markerless(location)? Also, is there a way to make an invisible model to clip the water plane, while taking into account also occlusion?

    Please, if you have any sort of input or help in what may be the best approach to do this, or if you have a link to a thread or video where this could be performed, that would be great help.

    Thanks so much for reading through this long thread.
    app image 1.PNG app image 2.PNG app image 3.PNG
    prefab edit.PNG unity page.PNG
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    If you use AR Foundation or Lightship ARDK you can use depth occlusion.
    Then just spawn the water in world space and it will occlude it if behind objects.
    ARCore/google has great geospacial data if you want to make it based on location. For specific location lightship VPS would be cool as well.
    You can also use a plane manager to detect the ground plane and use that to decide how high the water should be
     
    JParkr and andyb-unity like this.
  3. JParkr

    JParkr

    Joined:
    Jun 26, 2023
    Posts:
    2
    Thank you for your response!! I will definately try what you have recommended.
    Is there a method to make existing building model become invisible when it is spawned? I I want the water to be occluded by the invisible building object so that it looks like it is being occluded by actual existing buildings in the camera frame.
     
  4. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    774