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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more..
    Dismiss Notice
  3. Dismiss Notice

Question Nadir/Zenith Seams

Discussion in 'VR' started by jthiess, Nov 16, 2022.

  1. jthiess

    jthiess

    Joined:
    Nov 5, 2018
    Posts:
    31
    Hello!

    I am having a heck of a time working with these 360 images.. I am working with stereoscopic 36o photos from the insta360 Pro 2. There are nasty x seams on the Nadir and Zentih that I can't seem to fix!
    Any help is appreciated.

    The seams can be seen here:
    upload_2022-11-16_12-23-13.png

    The original image stitches perfectly as seen here: upload_2022-11-16_12-22-25.png

    Here are my image settings:
    upload_2022-11-16_12-24-44.png

    and shader code:

    Code (CSharp):
    1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
    2.  
    3. Shader "LeftInsideVisible" {
    4.     Properties{
    5.         _MainTex("Base (RGB)", 2D) = "white" {}
    6.     }
    7.  
    8.         SubShader{
    9.             Tags { "RenderType" = "Opaque" }
    10.             Cull front    // ADDED BY BERNIE, TO FLIP THE SURFACES
    11.             LOD 100
    12.  
    13.             Pass {
    14.                 CGPROGRAM
    15.                     #pragma vertex vert
    16.                     #pragma fragment frag
    17.  
    18.                     #include "UnityCG.cginc"
    19.  
    20.                     struct appdata_t {
    21.                         float4 vertex : POSITION;
    22.                         float2 texcoord : TEXCOORD0;
    23.                     };
    24.  
    25.                     struct v2f {
    26.                         float4 vertex : SV_POSITION;
    27.                         half2 texcoord : TEXCOORD0;
    28.                     };
    29.  
    30.                     sampler2D _MainTex;
    31.                     float4 _MainTex_ST;
    32.  
    33.                     v2f vert(appdata_t v)
    34.                     {
    35.                         v2f o;
    36.                         o.vertex = UnityObjectToClipPos(v.vertex);
    37.                         // ADDED BY BERNIE:
    38.                         v.texcoord.x = 1 - v.texcoord.x;
    39.                         o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
    40.                         return o;
    41.                     }
    42.  
    43.                     fixed4 frag(v2f i) : SV_Target
    44.                     {
    45.                         fixed4 col = tex2D(_MainTex, i.texcoord);
    46.                         return col;
    47.                     }
    48.                 ENDCG
    49.             }
    50.     }
    51.  
    52. }
     
  2. EdBlais

    EdBlais

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    303
    This looks like the two textures are using different coordinate origin points and coordinate direction/systems. You should double check what Unity is using vs what the original image nadir/zenith is using for their coordinate system.
     
  3. jthiess

    jthiess

    Joined:
    Nov 5, 2018
    Posts:
    31
    I will do that. Where do you see the different values? How would I double-check the coordinates?