浏览代码

Updating LWRP to work with the new standalone subsystems.

/lwrp-support-2018.3-with-1.5
Todd Stinson 6 年前
当前提交
821bfd9c
共有 6 个文件被更改,包括 93 次插入27 次删除
  1. 2
      Assets/LWRPSupport/ARCoreBackgroundLWRP.shader
  2. 29
      Assets/LWRPSupport/LWRPBackgroundRendererAsset.cs
  3. 3
      Assets/LWRPSupport/Unity.XR.ARFoundation.LWRPSupport.asmdef
  4. 35
      Assets/Prefabs/LightweightRP.asset
  5. 48
      Assets/Scenes/SampleLWRPScene.unity
  6. 3
      ProjectSettings/EditorBuildSettings.asset

2
Assets/LWRPSupport/ARCoreBackgroundLWRP.shader


void main()
{
#ifdef SHADER_API_GLES3
gl_FragColor = texture(_MainTex, textureCoord);
gl_FragColor = vec4(texture(_MainTex, textureCoord).xyz, 1);
#endif
}

29
Assets/LWRPSupport/LWRPBackgroundRendererAsset.cs



using UnityEngine.XR.ARFoundation;
namespace UnityEngine.XR.ARFoundation
{

[SerializeField]
Material[] m_MaterialsUsed;
[SerializeField]
ARCameraManager m_CameraManager;
public override ARFoundationBackgroundRenderer CreateARBackgroundRenderer()
{
return useRenderPipeline ? new LWRPBackgroundRenderer() : new ARFoundationBackgroundRenderer();

{
m_CameraManager = cameraGameObject.GetComponent<ARCameraManager>();
Debug.Assert(m_CameraManager != null, "camera manager must be non-null");
if (useRenderPipeline)
{
var lwrpBeforeCameraRender = cameraGameObject.GetComponent<LWRPBeforeCameraRender>();

public override Material CreateCustomMaterial()
{
var cameraSubsystem = ARSubsystemManager.cameraSubsystem;
if (cameraSubsystem == null)
if (m_CameraManager == null)
{
Debug.Log("camera manager is null");
}
var shaderName = "";
if (!cameraSubsystem.TryGetShaderName(ref shaderName))
return null;
var shaderName = m_CameraManager.shaderName + "LWRP";
Debug.LogFormat("Creating material for shader '{0}'", shaderName);
shaderName = shaderName + "LWRP";
var shader = Shader.Find(shaderName);
if (shader == null)
{

cameraSubsystem.SubsystemDescriptor.id));
m_CameraManager.descriptor.id));
}
}

3
Assets/LWRPSupport/Unity.XR.ARFoundation.LWRPSupport.asmdef


"name": "Unity.XR.ARFoundation.LWRPSupport",
"references": [
"Unity.XR.ARFoundation",
"Unity.XR.ARSubsystems",
"Unity.RenderPipelines.Core.Runtime",
"Unity.RenderPipelines.Lightweight.Runtime"
],

"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": []
}
}

35
Assets/Prefabs/LightweightRP.asset


--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0

kAssetVersion: 2
m_MaxPixelLights: 4
m_SupportsVertexLight: 0
k_AssetVersion: 4
m_RequireSoftParticles: 0
m_RequireOpaqueTexture: 0
m_OpaqueDownsampling: 1
m_MSAA: 4
m_MSAA: 1
m_ShadowType: 1
m_ShadowAtlasResolution: 2048
m_ShadowNearPlaneOffset: 2
m_MainLightRenderingMode: 1
m_MainLightShadowsSupported: 1
m_MainLightShadowmapResolution: 2048
m_AdditionalLightsRenderingMode: 1
m_AdditionalLightsPerObjectLimit: 4
m_AdditionalLightShadowsSupported: 0
m_AdditionalLightsShadowmapResolution: 512
m_ShadowDepthBias: 1
m_ShadowNormalBias: 1
m_SoftShadowsSupported: 0
m_SupportsDynamicBatching: 1
m_MixedLightingSupported: 1
m_ShadowType: 1
m_LocalShadowsSupported: 0
m_LocalShadowsAtlasResolution: 256
m_MaxPixelLights: 4
m_ShadowAtlasResolution: 2048
m_ShaderVariantLogLevel: 0

48
Assets/Scenes/SampleLWRPScene.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.496413, b: 0.5748175, a: 1}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.49641287, b: 0.5748173, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:

- component: {fileID: 282840811}
- component: {fileID: 282840815}
- component: {fileID: 282840812}
- component: {fileID: 282840817}
- component: {fileID: 282840816}
m_Layer: 0
m_Name: AR Camera

m_Name:
m_EditorClassIdentifier:
m_UseCustomMaterial: 0
m_CustomMaterial: {fileID: 2100000, guid: e77eba92b3f8949a8ba25b8d98a8f694, type: 2}
m_CustomMaterial: {fileID: 0}
m_UseCustomRendererAsset: 1
m_CustomRendererAsset: {fileID: 11400000, guid: 2310b94e2d8f5463ab592fa99eefbe6f,
type: 2}

m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2
--- !u!114 &282840817
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 282840810}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4966719baa26e4b0e8231a24d9bd491a, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FocusMode: 1
m_LightEstimationMode: 0
--- !u!1 &427002218
GameObject:
m_ObjectHideFlags: 0

m_Component:
- component: {fileID: 427002220}
- component: {fileID: 427002219}
- component: {fileID: 427002222}
- component: {fileID: 427002221}
m_Layer: 0
m_Name: AR Session
m_TagString: Untagged

m_Script: {fileID: 11500000, guid: 3859a92a05d4f5d418cb6ca605290e74, type: 3}
m_Name:
m_EditorClassIdentifier:
m_LightEstimation: 0
m_AttemptUpdate: 1
--- !u!4 &427002220
Transform:

m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &427002221
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 427002218}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1eb9777efa8174381b01d319232f7df5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_TargetFrameRate: 60
--- !u!114 &427002222
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 427002218}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fa850fbd5b8aded44846f96e35f1a9f5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1015722065
GameObject:
m_ObjectHideFlags: 0

m_EditorClassIdentifier:
m_PlanePrefab: {fileID: 1568414836858200, guid: b588636d005074635b1c79eb606780fa,
type: 3}
m_DetectionMode: -1
--- !u!114 &1335839538
MonoBehaviour:
m_ObjectHideFlags: 0

3
ProjectSettings/EditorBuildSettings.asset


path: Assets/Scenes/Plane Detection/TogglePlaneDetection.unity
guid: eb4bbb3a5e81acc41a903b1c5f1c827b
- enabled: 0
path: Assets/Scenes/SampleLWRPScene.unity
guid: f3beb74fe75ac4a0e9ed3d2e9950bba8
- enabled: 0
path: Assets/Scenes/Scale.unity
guid: 13ac91f677dc22f4ca320ef8ae727b68
- enabled: 0

正在加载...
取消
保存