private void SetupReferences() { urpAsset = GraphicsSettings.renderPipelineAsset as UniversalRenderPipelineAsset; Assert.IsNotNull(urpAsset, "urpAsset is null!"); lwrpaShadowField = urpAsset.GetType().GetField("m_MainLightShadowsSupported", BindingFlags.NonPublic | BindingFlags.Instance); Assert.IsNotNull(lwrpaShadowField, "lwrpaShadowField is null!"); lwrpaShadowResolutionField = urpAsset.GetType().GetField("m_MainLightShadowmapResolution", BindingFlags.NonPublic | BindingFlags.Instance); Assert.IsNotNull(lwrpaShadowResolutionField, "lwrpaShadowResolutionField is null!"); lwrpaSoftShadowField = urpAsset.GetType().GetField("m_SoftShadowsSupported", BindingFlags.NonPublic | BindingFlags.Instance); Assert.IsNotNull(lwrpaSoftShadowField, "lwrpaSoftShadowField is null!"); GeneralSettingsReferences generalSettingsReferences = GameObject.FindObjectOfType <GeneralSettingsReferences>(); QualitySettingsReferences qualitySettingsReferences = GameObject.FindObjectOfType <QualitySettingsReferences>(); Assert.IsNotNull(generalSettingsReferences, "GeneralSettingsReferences not found in scene"); Assert.IsNotNull(qualitySettingsReferences, "QualitySettingsReferences not found in scene"); freeLookCamera = generalSettingsReferences.thirdPersonCamera; Assert.IsNotNull(freeLookCamera, "GeneralSettingsController: thirdPersonCamera reference missing"); CinemachineVirtualCamera virtualCamera = generalSettingsReferences.firstPersonCamera; Assert.IsNotNull(virtualCamera, "GeneralSettingsController: firstPersonCamera reference missing"); povCamera = virtualCamera.GetCinemachineComponent <CinemachinePOV>(); Assert.IsNotNull(povCamera, "GeneralSettingsController: firstPersonCamera doesn't have CinemachinePOV component"); environmentLight = qualitySettingsReferences.environmentLight; Assert.IsNotNull(environmentLight, "QualitySettingsController: environmentLight reference missing"); postProcessVolume = qualitySettingsReferences.postProcessVolume; Assert.IsNotNull(postProcessVolume, "QualitySettingsController: postProcessVolume reference missing"); firstPersonCamera = qualitySettingsReferences.firstPersonCamera; Assert.IsNotNull(firstPersonCamera, "QualitySettingsController: firstPersonCamera reference missing"); Assert.IsNotNull(qualitySettingsReferences.thirdPersonCamera, "QualitySettingsController: thirdPersonCamera reference missing"); }
public override void Initialize() { base.Initialize(); lightweightRenderPipelineAsset = GraphicsSettings.renderPipelineAsset as UniversalRenderPipelineAsset; if (lightweightRenderPipelineAsset == null) { return; } lwrpaSoftShadowField = lightweightRenderPipelineAsset.GetType().GetField("m_SoftShadowsSupported", BindingFlags.NonPublic | BindingFlags.Instance); }
public override void Initialize() { base.Initialize(); lightweightRenderPipelineAsset = GraphicsSettings.renderPipelineAsset as UniversalRenderPipelineAsset; if (lightweightRenderPipelineAsset == null) { return; } lwrpaShadowResolutionField = lightweightRenderPipelineAsset.GetType().GetField("m_MainLightShadowmapResolution", BindingFlags.NonPublic | BindingFlags.Instance); }
protected RenderObjects GetRendererFeature() { UniversalRenderPipelineAsset pipeline = GraphicsSettings.renderPipelineAsset as UniversalRenderPipelineAsset; FieldInfo fieldInfo = pipeline.GetType().GetField("m_RendererDataList", BindingFlags.Instance | BindingFlags.NonPublic); ScriptableRendererData scriptableRendererData = ((ScriptableRendererData[])fieldInfo?.GetValue(pipeline))?[0]; foreach (RenderObjects renderObjects in scriptableRendererData.rendererFeatures.OfType <RenderObjects>()) { if (renderObjects.settings.overrideMaterial == atmosphereMaterial) { return(renderObjects); } } Debug.LogError("Atmosphere scattering renderer feature has not been added to Forward Renderer asset!"); return(null); }
void UpdateRendererDatas(UniversalRenderPipelineAsset pipeline) { FieldInfo propertyInfo = pipeline.GetType( ).GetField("m_RendererDataList", BindingFlags.Instance | BindingFlags.NonPublic); m_RendererDatas = ((ScriptableRendererData[])propertyInfo?.GetValue(pipeline)); }