Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool SetRenderingFeatures()
- {
- // Set subshader pipeline tag
- Shader.globalRenderPipeline = "HDRenderPipeline";
- // HD use specific GraphicsSettings
- GraphicsSettings.lightsUseLinearIntensity = true;
- GraphicsSettings.lightsUseColorTemperature = true;
- // HD should always use the new batcher - TODO once fix are backport in 2018.2/staging
- //GraphicsSettings.useScriptableRenderPipelineBatching = true;
- SupportedRenderingFeatures.active = new SupportedRenderingFeatures()
- {
- reflectionProbeSupportFlags = SupportedRenderingFeatures.ReflectionProbeSupportFlags.Rotation,
- defaultMixedLightingMode = SupportedRenderingFeatures.LightmapMixedBakeMode.IndirectOnly,
- supportedMixedLightingModes = SupportedRenderingFeatures.LightmapMixedBakeMode.IndirectOnly | SupportedRenderingFeatures.LightmapMixedBakeMode.Shadowmask,
- supportedLightmapBakeTypes = LightmapBakeType.Baked | LightmapBakeType.Mixed | LightmapBakeType.Realtime,
- supportedLightmapsModes = LightmapsMode.NonDirectional | LightmapsMode.CombinedDirectional,
- rendererSupportsLightProbeProxyVolumes = true,
- rendererSupportsMotionVectors = true,
- rendererSupportsReceiveShadows = false,
- rendererSupportsReflectionProbes = true
- };
- Lightmapping.SetDelegate(GlobalIlluminationUtils.hdLightsDelegate);
- #if UNITY_EDITOR
- SceneViewDrawMode.SetupDrawMode();
- if (UnityEditor.PlayerSettings.colorSpace == ColorSpace.Gamma)
- {
- Debug.LogError("High Definition Render Pipeline doesn't support Gamma mode, change to Linear mode");
- }
- #endif
- if (!IsSupportedPlatform())
- {
- CoreUtils.DisplayUnsupportedAPIMessage();
- return false;
- }
- #if !UNITY_SWITCH
- // VR is not supported currently in HD
- if (XRSettings.isDeviceActive)
- {
- CoreUtils.DisplayUnsupportedXRMessage();
- return false;
- }
- #endif
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement