Skip to content

Commit

Permalink
Background image preview sphere labels (#700)
Browse files Browse the repository at this point in the history
* We can't rotate the spheres because it messes up the labels

* Shader tweaks

* Apply same fix to stereo code path
  • Loading branch information
andybak authored Apr 30, 2024
1 parent a419190 commit 7d0579c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
54 changes: 27 additions & 27 deletions Assets/Prefabs/Panels/ReferencePanel/ReferencePanel.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.w
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -1405,7 +1405,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -1420,7 +1420,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand Down Expand Up @@ -1650,7 +1650,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.w
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -1660,7 +1660,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -1675,7 +1675,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand Down Expand Up @@ -1725,7 +1725,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.w
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -1735,7 +1735,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -1750,7 +1750,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand Down Expand Up @@ -1895,7 +1895,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.w
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -1905,7 +1905,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -1920,7 +1920,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand Down Expand Up @@ -2074,7 +2074,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.w
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -2084,7 +2084,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -2099,7 +2099,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand Down Expand Up @@ -2311,7 +2311,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.w
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -2321,7 +2321,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -2336,7 +2336,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand Down Expand Up @@ -2386,7 +2386,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.w
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -2396,7 +2396,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -2411,7 +2411,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand Down Expand Up @@ -2461,7 +2461,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.w
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -2471,7 +2471,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -2486,7 +2486,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand Down Expand Up @@ -2686,7 +2686,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.w
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -2696,7 +2696,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalRotation.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand All @@ -2711,7 +2711,7 @@ PrefabInstance:
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9,
type: 3}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Transform:
m_GameObject: {fileID: 2479500690962267317}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.216, y: 0.4159999, z: 0.05}
m_LocalScale: {x: 0.35, y: 0.35, z: 0.35}
m_ConstrainProportionsScale: 0
m_LocalScale: {x: 0.47, y: 0.47, z: 0.47}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
Expand All @@ -42,7 +42,7 @@ MeshFilter:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2479500690962267317}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
m_Mesh: {fileID: 4300000, guid: 457cf4e57f9d13848bff1ab794fd6445, type: 3}
--- !u!23 &2479500690960277569
MeshRenderer:
m_ObjectHideFlags: 0
Expand Down
12 changes: 6 additions & 6 deletions Assets/Shaders/360PanoramaWarp.shader
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ Shader "Custom/360PanoramaWarp"
{
sphereCoords = float2(longitude, latitude) * float2(1.0 / UNITY_PI, 0.5 / UNITY_PI);
sphereCoords.y = fmod(sphereCoords.y * 2.0 + 1.0, 1.0) - 0.5;
return float2(1.0, 0.5) - sphereCoords;
return float2(sphereCoords.x * 0.5 + 0.5, 0.5 - sphereCoords.y);
}
else
{
sphereCoords = float2(longitude, latitude) * float2(1.0 / UNITY_PI, 1.0 / UNITY_PI);
return float2(1.0, 1.0) - sphereCoords;
sphereCoords = float2(longitude, latitude) * 1.0 / UNITY_PI;
return float2(sphereCoords.x * 0.5 + 0.5, 1 - sphereCoords.y);
}
}

Expand All @@ -99,11 +99,11 @@ Shader "Custom/360PanoramaWarp"
float2 uv = ToRadialCoords(vdir);
if (_Stereoscopic == 1)
{
uv = uv * fixed2(1.0, 0.5) + fixed2(0, unity_StereoEyeIndex * 0.5);
uv *= fixed2(1.0, 0.5) + fixed2(0, unity_StereoEyeIndex * 0.5);
}

uv.x = uv.x * _MainTex_ST.x + _MainTex_ST.z;
uv.y = uv.y * _MainTex_ST.y + _MainTex_ST.w;
uv.x *= _MainTex_ST.x + _MainTex_ST.z;
uv.y *= _MainTex_ST.y + _MainTex_ST.w;
return tex2D(_MainTex, uv, ddx(0), ddy(0));
}

Expand Down

0 comments on commit 7d0579c

Please sign in to comment.