diff --git a/Assets/Materials/360 Panorama Sphere.mat b/Assets/Materials/360 Panorama Sphere.mat new file mode 100644 index 0000000000..f97ba89a76 --- /dev/null +++ b/Assets/Materials/360 Panorama Sphere.mat @@ -0,0 +1,89 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 360 Panorama Sphere + m_Shader: {fileID: 4800000, guid: 2acb44a1aabdeb44ca27f9dd497c779a, type: 3} + m_ValidKeywords: [] + m_InvalidKeywords: + - _STEREOSCOPIC_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _H: 360 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _Shininess: 20 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _Stereoscopic: 1 + - _UVSec: 0 + - _V: 180 + - _WarpEnd: 1 + - _WarpStart: 6 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} + - _WarpParams: {r: 6, g: 0.5, b: 0.3, a: 0.1} + m_BuildTextureStacks: [] diff --git a/Assets/Materials/360 Panorama Sphere.mat.meta b/Assets/Materials/360 Panorama Sphere.mat.meta new file mode 100644 index 0000000000..e921796ffd --- /dev/null +++ b/Assets/Materials/360 Panorama Sphere.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 43d295ee902e9fb4a9d8289e6f7cf0db +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Panels/ReferencePanel/ReferencePanel.prefab b/Assets/Prefabs/Panels/ReferencePanel/ReferencePanel.prefab index b2d04df2a5..97721baf6b 100644 --- a/Assets/Prefabs/Panels/ReferencePanel/ReferencePanel.prefab +++ b/Assets/Prefabs/Panels/ReferencePanel/ReferencePanel.prefab @@ -1137,7 +1137,7 @@ MonoBehaviour: m_VertexBufferAutoSizeReduction: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 - m_margin: {x: 0, y: 0.12746334, z: -0.20665479, w: -0.05648184} + m_margin: {x: 0, y: 0.12746334, z: -0.37754095, w: -0.05648184} m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 _SortingLayer: 0 @@ -1395,22 +1395,22 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.w - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -1420,7 +1420,7 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalEulerAnglesHint.y - value: 0 + value: 180 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -1650,22 +1650,22 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.w - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -1675,7 +1675,7 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalEulerAnglesHint.y - value: 0 + value: 180 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -1725,22 +1725,22 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.w - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -1750,7 +1750,7 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalEulerAnglesHint.y - value: 0 + value: 180 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -1895,22 +1895,22 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.w - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -1920,7 +1920,7 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalEulerAnglesHint.y - value: 0 + value: 180 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -2074,22 +2074,22 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.w - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -2099,7 +2099,7 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalEulerAnglesHint.y - value: 0 + value: 180 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -2311,22 +2311,22 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.w - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -2336,7 +2336,7 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalEulerAnglesHint.y - value: 0 + value: 180 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -2386,22 +2386,22 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.w - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -2411,7 +2411,7 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalEulerAnglesHint.y - value: 0 + value: 180 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -2461,22 +2461,22 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.w - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -2486,7 +2486,7 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalEulerAnglesHint.y - value: 0 + value: 180 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -2686,22 +2686,22 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.w - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} @@ -2711,7 +2711,7 @@ PrefabInstance: - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} propertyPath: m_LocalEulerAnglesHint.y - value: 0 + value: 180 objectReference: {fileID: 0} - target: {fileID: 2479500690962014025, guid: c74f031eb9cac3d4ea6ac436d619d6c9, type: 3} diff --git a/Assets/Prefabs/Panels/ReferencePanel/ReferencePanelIconBackgroundImage.prefab b/Assets/Prefabs/Panels/ReferencePanel/ReferencePanelIconBackgroundImage.prefab index c55da49678..7e5bd3b952 100644 --- a/Assets/Prefabs/Panels/ReferencePanel/ReferencePanelIconBackgroundImage.prefab +++ b/Assets/Prefabs/Panels/ReferencePanel/ReferencePanelIconBackgroundImage.prefab @@ -31,8 +31,7 @@ Transform: 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_Children: - - {fileID: 2478881130405730377} + m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -43,7 +42,7 @@ MeshFilter: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2479500690962267317} - m_Mesh: {fileID: 4300000, guid: 5501f437160666942ae970f3648fbeb8, type: 3} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!23 &2479500690960277569 MeshRenderer: m_ObjectHideFlags: 0 @@ -64,7 +63,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 8abca4e4c3fe53347928928c0b64d985, type: 2} + - {fileID: 2100000, guid: 43d295ee902e9fb4a9d8289e6f7cf0db, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -140,7 +139,7 @@ MonoBehaviour: m_ToggleButton: 0 m_LongPressReleaseButton: 0 m_ButtonHasPressedAudio: 1 - m_ZAdjustHover: -0.08 + m_ZAdjustHover: -0.15 m_ZAdjustClick: 0.05 m_HoverScale: 1.2 m_HoverBoxColliderGrow: 0.2 @@ -148,86 +147,3 @@ MonoBehaviour: references: version: 2 RefIds: [] ---- !u!1 &2480209320706341279 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2478881130405730377} - - component: {fileID: 2458342986616302945} - - component: {fileID: 2466075774046088327} - m_Layer: 16 - m_Name: Background - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2478881130405730377 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2480209320706341279} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0.01} - m_LocalScale: {x: 1.0499998, y: 1.0499998, z: 1.0499998} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 2479500690962014025} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &2458342986616302945 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2480209320706341279} - m_Mesh: {fileID: 4300000, guid: 5501f437160666942ae970f3648fbeb8, type: 3} ---- !u!23 &2466075774046088327 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2480209320706341279} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_StaticShadowCaster: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: 8145c7e1ab2e5f14693c854f953484c1, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} diff --git a/Assets/Scripts/GUI/LoadBackgroundImageButton.cs b/Assets/Scripts/GUI/LoadBackgroundImageButton.cs index 603875e999..e4af884b2e 100644 --- a/Assets/Scripts/GUI/LoadBackgroundImageButton.cs +++ b/Assets/Scripts/GUI/LoadBackgroundImageButton.cs @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +using UnityEngine; namespace TiltBrush { @@ -52,5 +53,14 @@ override public void ResetState() SetButtonAvailable(available); } } + + public void Set360ButtonTexture(Texture2D rTexture, float aspect = -1) + { + float isStereo = aspect > 1f ? 0f : 1f; + m_CurrentButtonTexture = rTexture; + m_ButtonRenderer.material.mainTexture = rTexture; + m_ButtonRenderer.material.SetFloat("_Stereoscopic", isStereo); + } + } } // namespace TiltBrush diff --git a/Assets/Scripts/ReferencePanelBackgroundImageTab.cs b/Assets/Scripts/ReferencePanelBackgroundImageTab.cs index b355e7520a..fac1cd6efe 100644 --- a/Assets/Scripts/ReferencePanelBackgroundImageTab.cs +++ b/Assets/Scripts/ReferencePanelBackgroundImageTab.cs @@ -107,6 +107,7 @@ public override void UpdateTab() for (int i = 0; i < m_Icons.Length; ++i) { var imageIcon = m_Icons[i] as BackgroundImageIcon; + var btn = imageIcon.Button as LoadBackgroundImageButton; if (!imageIcon.TextureAssigned) { int iMapIndex = m_IndexOffset + i; @@ -114,7 +115,7 @@ public override void UpdateTab() Texture2D rTexture = BackgroundImageCatalog.m_Instance.GetImageIcon(iMapIndex, out aspect); if (rTexture != null) { - imageIcon.Button.SetButtonTexture(rTexture, aspect); + btn.Set360ButtonTexture(rTexture, aspect); imageIcon.TextureAssigned = true; } else diff --git a/Assets/Shaders/360PanoramaWarp.shader b/Assets/Shaders/360PanoramaWarp.shader new file mode 100644 index 0000000000..70ef2b4084 --- /dev/null +++ b/Assets/Shaders/360PanoramaWarp.shader @@ -0,0 +1,130 @@ +Shader "Custom/360PanoramaWarp" +{ + Properties + { + [MaterialToggle] _Stereoscopic("Stereoscopic",float) = 1.0 + _MainTex ("Texture", 2D) = "white" {} + _WarpStart ("Warp Start Distance", Float) = 1.5 + _WarpEnd ("Warp End Distance", Float) = 0.5 + _SpecularColor ("Specular Color", Color) = (1,1,1,1) + _Shininess ("Shininess", Float) = 20.0 + } + SubShader + { + Tags + { + "RenderType"="Opaque" + } + LOD 100 + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + struct appdata + { + float4 vertex : POSITION; + float3 normal : NORMAL; + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float3 worldNormal : TEXCOORD0; + float3 normal : NORMAL; + float3 worldViewDir : TEXCOORD1; + float warpAlpha : TEXCOORD2; + float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO + }; + + float4 _SpecularColor; + float _Shininess; + float _Stereoscopic; + + sampler2D _MainTex; + float4 _MainTex_ST; + float4 _WarpParams; + float _WarpStart; + float _WarpEnd; + + v2f vert(appdata v) + { + v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + float4 zeroPos = mul(unity_ObjectToWorld, float4(0.0, 0.0, 0.0, 1.0)); + float distToZero = length(_WorldSpaceCameraPos - zeroPos.xyz); + float dd = (distToZero - _WarpStart) / (_WarpEnd - _WarpStart); + o.warpAlpha = clamp(dd, 0.0, 1.0); + float4 worldPos = mul(unity_ObjectToWorld, v.vertex); + o.worldViewDir = worldPos.xyz - _WorldSpaceCameraPos; + o.vertex = UnityObjectToClipPos(v.vertex); + o.worldNormal = mul((float3x3)unity_ObjectToWorld, v.normal); + o.normal = v.normal; + return o; + } + + inline float2 ToRadialCoords(float3 coords) + { + float3 normalizedCoords = normalize(coords); + float latitude = acos(normalizedCoords.y); + float longitude = atan2(normalizedCoords.z, normalizedCoords.x); + + float2 sphereCoords; + if (_Stereoscopic == 1) + { + 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; + } + else + { + sphereCoords = float2(longitude, latitude) * float2(1.0 / UNITY_PI, 1.0 / UNITY_PI); + return float2(1.0, 1.0) - sphereCoords; + } + } + + float3 panoMap(float3 vdir, float4 _MainTex_ST) + { + float2 uv = ToRadialCoords(vdir); + if (_Stereoscopic == 1) + { + uv = 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; + return tex2D(_MainTex, uv, ddx(0), ddy(0)); + } + + + fixed4 frag(v2f i) : SV_Target + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + + float3 nn = normalize(i.worldNormal); + float3 ndir = normalize(i.worldViewDir); + float3 sampleDir = i.warpAlpha * ndir + (1.0 - i.warpAlpha) * i.normal; + float3 color = panoMap(sampleDir, _MainTex_ST); + + float3 lightDir = normalize(float3(-1.5, -1, -1)); + float3 reflectDir = reflect(-lightDir, nn); + float spec = pow(max(dot(reflectDir, ndir), 0.0), _Shininess); + float3 specular = _SpecularColor.rgb * spec; + + return float4(color + specular, 1.0); + } + ENDCG + } + } +} \ No newline at end of file diff --git a/Assets/Shaders/360PanoramaWarp.shader.meta b/Assets/Shaders/360PanoramaWarp.shader.meta new file mode 100644 index 0000000000..aa324f0889 --- /dev/null +++ b/Assets/Shaders/360PanoramaWarp.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 2acb44a1aabdeb44ca27f9dd497c779a +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: