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

One AR Plane/Mesh Shader To Rule Them All

Discussion in 'AR' started by edwon, Jun 2, 2020.

  1. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    260
    I’ve noticed that in 3 AR projects in a row, an issue I’ve run into over and over is that making a good AR Plane shader is trickier than at first imagined. I’ve harvested, hacked, and combined multiple other shaders from the examples in ARFoundationExamples or random forum posts, but I still can’t get everything working at the same time on one performant shader.

    What I (and probably 95% of AR devs) want from Unity by default is one shader for AR Planes and Meshes that can do all of the following at the same, and also toggle each on and off at any time via shader parameters:
    1. render shadows without rendering the surface
    2. block shadows without casting shadows (stop shadows from going through doubled over surfaces aka a table over the floor)
    3. Occlude itself
    4. render a repeating texture but have soft faded edges near the edge (a previous shader in the ARCore package did this)

    the issue is that a lot of AR devs out there don’t have the advanced shader writing skill to make one shader that can do all this performantly. Why make everyone repeat that work or be forced to hire a shader programmer? When they could just be scripting their app.

    please make this someone at Unity!
     
    monoganog, Saicopate and Protagonist like this.
  2. TomsDC

    TomsDC

    Joined:
    Apr 25, 2017
    Posts:
    9
    I second this, a shader with soft edges for ARPlanes would be great!
     
  3. Kholeslaw

    Kholeslaw

    Joined:
    May 7, 2013
    Posts:
    35
    This would be great!
     
  4. DanMillerU3D

    DanMillerU3D

    Unity Technologies

    Joined:
    May 12, 2017
    Posts:
    26
    Sounds like you've hacked some together in the past but for others looking at a start and where to find some of this functionality here are some individual shaders that cover the requested features.

    A feathered edge shader is available in AR Foundation samples here
    Occlusion shader here
    Shadow shader here