Advertisement
Guest User

Features

a guest
Jul 17th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.26 KB | None | 0 0
  1.         bool SetRenderingFeatures()
  2.         {
  3.             // Set subshader pipeline tag
  4.             Shader.globalRenderPipeline = "HDRenderPipeline";
  5.  
  6.             // HD use specific GraphicsSettings
  7.             GraphicsSettings.lightsUseLinearIntensity = true;
  8.             GraphicsSettings.lightsUseColorTemperature = true;
  9.             // HD should always use the new batcher - TODO once fix are backport in 2018.2/staging
  10.             //GraphicsSettings.useScriptableRenderPipelineBatching = true;
  11.  
  12.             SupportedRenderingFeatures.active = new SupportedRenderingFeatures()
  13.             {
  14.                 reflectionProbeSupportFlags = SupportedRenderingFeatures.ReflectionProbeSupportFlags.Rotation,
  15.                 defaultMixedLightingMode = SupportedRenderingFeatures.LightmapMixedBakeMode.IndirectOnly,
  16.                 supportedMixedLightingModes = SupportedRenderingFeatures.LightmapMixedBakeMode.IndirectOnly | SupportedRenderingFeatures.LightmapMixedBakeMode.Shadowmask,
  17.                 supportedLightmapBakeTypes = LightmapBakeType.Baked | LightmapBakeType.Mixed | LightmapBakeType.Realtime,
  18.                 supportedLightmapsModes = LightmapsMode.NonDirectional | LightmapsMode.CombinedDirectional,
  19.                 rendererSupportsLightProbeProxyVolumes = true,
  20.                 rendererSupportsMotionVectors = true,
  21.                 rendererSupportsReceiveShadows = false,
  22.                 rendererSupportsReflectionProbes = true
  23.             };
  24.  
  25.             Lightmapping.SetDelegate(GlobalIlluminationUtils.hdLightsDelegate);
  26.  
  27. #if UNITY_EDITOR
  28.             SceneViewDrawMode.SetupDrawMode();
  29.  
  30.             if (UnityEditor.PlayerSettings.colorSpace == ColorSpace.Gamma)
  31.             {
  32.                 Debug.LogError("High Definition Render Pipeline doesn't support Gamma mode, change to Linear mode");
  33.             }
  34. #endif
  35.  
  36.             if (!IsSupportedPlatform())
  37.             {
  38.                 CoreUtils.DisplayUnsupportedAPIMessage();
  39.  
  40.                 return false;
  41.             }
  42.  
  43. #if !UNITY_SWITCH
  44.             // VR is not supported currently in HD
  45.             if (XRSettings.isDeviceActive)
  46.             {
  47.                 CoreUtils.DisplayUnsupportedXRMessage();
  48.  
  49.                 return false;
  50.             }
  51. #endif
  52.  
  53.             return true;
  54.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement