浏览代码

wip display examples, testing with different objects, enviromental probe placement

/main
Dan 4 年前
当前提交
43b2ef13
共有 8 个文件被更改,包括 169 次插入11 次删除
  1. 2
      Assets/AR Sample Objects/CoffeeMaker/Materials/CoffeeMaker_Kettle.mat
  2. 2
      Assets/Shaders/Materials/CameraGrainMat.mat
  3. 7
      Assets/Shaders/Materials/OldCameraGrain.mat
  4. 100
      Assets/Shaders/Prefabs/CoffeeMakerDouble.prefab
  5. 19
      Assets/UX/Scenes/UXManagerScene.unity
  6. 8
      UserSettings/EditorUserSettings.asset
  7. 31
      Assets/Common/Scripts/ProbePlacement.cs
  8. 11
      Assets/Common/Scripts/ProbePlacement.cs.meta

2
Assets/AR Sample Objects/CoffeeMaker/Materials/CoffeeMaker_Kettle.mat


- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 1
- _Smoothness: 0.3
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1

2
Assets/Shaders/Materials/CameraGrainMat.mat


m_Offset: {x: 0, y: 0}
m_Floats:
- Vector1_6334ABB5: 10
- Vector1_6B7D910E: 0.409
- Vector1_6B7D910E: 0.3
- Vector1_7840F96A: 0.285
- _AlphaClip: 0
- _Blend: 0

7
Assets/Shaders/Materials/OldCameraGrain.mat


m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: OldCameraGrain
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Shader: {fileID: 4800000, guid: 9c0985f921faf4a4fa8781c0a4a4eaa8, type: 3}
m_CustomRenderQueue: 2050
stringTagMap:
RenderType: Opaque
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3

100
Assets/Shaders/Prefabs/CoffeeMakerDouble.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &859833345
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 859833346}
- component: {fileID: 859833349}
- component: {fileID: 859833348}
- component: {fileID: 859833347}
m_Layer: 0
m_Name: Coffeepot (2)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &859833346
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 859833345}
m_LocalRotation: {x: 0.000000020686997, y: -0.3226259, z: -0.000000007051212, w: 0.9465266}
m_LocalPosition: {x: 0.065, y: 0.029, z: -0.213}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 5663396095965327980}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: -37.644, z: 0}
--- !u!33 &859833349
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 859833345}
m_Mesh: {fileID: 2444598424930166857, guid: b0238fb14b0e3834e9e0694092a0dbd4, type: 3}
--- !u!23 &859833348
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 859833345}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: a6d5637e71b3862408e1306da5fb4417, 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: 1
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}
--- !u!114 &859833347
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 859833345}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e2ffde1aea1c86643956cb210801977e, type: 3}
m_Name:
m_EditorClassIdentifier:
m_CameraManager: {fileID: 0}
--- !u!1 &2533340975916542749
GameObject:
m_ObjectHideFlags: 0

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5663396095965327969}
m_LocalRotation: {x: 0.000000020791129, y: -0.308294, z: -0.000000006737979, w: 0.9512912}
m_LocalRotation: {x: 0.000000020686997, y: -0.3226259, z: -0.000000007051212, w: 0.9465266}
m_LocalEulerAnglesHint: {x: 0, y: -35.913, z: 0}
m_LocalEulerAnglesHint: {x: 0, y: -37.644, z: 0}
--- !u!33 &5663396095965327977
MeshFilter:
m_ObjectHideFlags: 0

m_Children:
- {fileID: 5663396095965327970}
- {fileID: 8675869348419208808}
- {fileID: 859833346}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

19
Assets/UX/Scenes/UXManagerScene.unity


- component: {fileID: 1335839539}
- component: {fileID: 1335839540}
- component: {fileID: 1335839541}
- component: {fileID: 1335839542}
m_Layer: 0
m_Name: AR Session Origin
m_TagString: Untagged

m_Script: {fileID: 11500000, guid: 446fc7fee4cf2ad4daa02222a84869c4, type: 3}
m_Name:
m_EditorClassIdentifier:
m_PlacedPrefab: {fileID: 5663396095965327974, guid: 7589b43d0e7c342cca75766fd26fce89,
m_PlacedPrefab: {fileID: 6644777280766349587, guid: 4f35a1b73b8ec4d359bfb30868d552e4,
type: 3}
m_MaxNumberOfObjectsToPlace: 1
--- !u!114 &1335839540

m_Script: {fileID: 11500000, guid: 73a025b51106444e18fb408fde19ac53, type: 3}
m_Name:
m_EditorClassIdentifier:
m_AutomaticPlacement: 1
m_AutomaticPlacement: 0
--- !u!114 &1335839542
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1335839533}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 863a70230e6b84d53bf526189f949eef, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ProbeManager: {fileID: 1335839541}
m_RaycastManager: {fileID: 1335839538}
--- !u!1 &2146458540
GameObject:
m_ObjectHideFlags: 0

8
UserSettings/EditorUserSettings.asset


m_ObjectHideFlags: 0
serializedVersion: 4
m_ConfigSettings:
RecentlyUsedScenePath-0:
value: 2242470311464668050f0827023010231512162f3f6715382c2d1821f1d4312bf6c533eda92f31352d1b
flags: 0
RecentlyUsedScenePath-1:
value: 224247031146466e35413f21152d5a03592220072d262737283b2e30e7ee3176f7e93ffdfe
flags: 0
value: 181344140043005e1a220d3b1f364b524c0c5a27130c293326201334cee5322ca0bd30e8eb293a707b0fd0180b3d0a36fc0d3d04e649500d1002ee0b5dbd1d2c27c00ad113cb1e10e41f1addc80993b9849887b98bb8b38b8b8ff5aaa1a9bdafa0bde7f69580f3d2a3b5f1bfbbc3cbebc7cca4c1d8849397f4829d91b3ece1dac3d3c78cc2c5c09983d9f0dcecc9fefdcaf2fccfc3f1c1ffcec9cbfe22aaed3a32343df4efebe5d3eceb34db2a22dcd920209b643bc88d808891748e9b8f838b6e9b8094538fd8c17adc40a145406368685b6f796f5e7b2e017d7e4b5821637e1a022b792372792f1a2020001e546c5d400d7746050e49422e364d00337d5152425f13160607170746602c1c262c302a33291b32281b072d2f0e350970ba6564ad6178a4e80ada32f7ebae58eb4127b2aca4ab5942584a52144ba74690975a48dfda5a8bca1b0c081cf0ff0ee108e81ac5d9e0f1d3a9b0f0b3f69fb4a58fa0bda1f5a8f5acf9afaffea8a9f8ffaafd81acf4ee9ee89b89e8eeefd08184859f8f8086dd8a9795
value: 181344140043005e1a220d3b1f364b524c0c5a27130c293326201334cee5322ca0bd30e8eb293a707b0fd0180b3d0a36fc0d3d04e649500d1002ee0b5dbd1d2c27c00ad113cb1e10e41f1addc80993b9849884a69ae6d8f0d1cda9e8fbfefaf9f9dea3fdb9ade882f0ffb0e1e380cafbf2c3adc18e9cd285a2908b87ee819c8395949c9483d38b8c97ddbd90eed2a5a892a2af949aa48bafb19f85bd75a7ed3a7d25658598b7b58bb4b76aaf777690ca2863946c72c6cd81b6b6708f9f879f88769589d91c8f888e64d20f935e796571755c6b546677696a486c781c073c6f23696429450074652134203e56454c514e4352305f78621e00746f0243326d645d4b5f450e471441155071727040736e6130644f737b40667b34007c5f3fe12420e62304f4e023e03efadde518f54165ebb4efba505858565e5d45bf0a809a4048928946d4da
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650

31
Assets/Common/Scripts/ProbePlacement.cs


using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.ARFoundation;
public class ProbePlacement : MonoBehaviour
{
[SerializeField]
AREnvironmentProbeManager m_ProbeManager;
[SerializeField]
ARRaycastManager m_RaycastManager;
List<ARRaycastHit> k_Hits = new List<ARRaycastHit>();
void Update()
{
if (Input.touchCount > 0)
{
Touch touch = Input.GetTouch(0);
if (touch.phase == TouchPhase.Began)
{
if (m_RaycastManager.Raycast(new Vector2(Screen.width / 2, Screen.height / 2), k_Hits))
{
Pose hitPose = k_Hits[0].pose;
m_ProbeManager.AddEnvironmentProbe(hitPose, Vector3.one, Vector3.one);
}
}
}
}
}

11
Assets/Common/Scripts/ProbePlacement.cs.meta


fileFormatVersion: 2
guid: 863a70230e6b84d53bf526189f949eef
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存