Ejemplo n.º 1
0
 static void Drawer_FieldClippingPlanes(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     _.DrawMultipleFields(
         "Clipping Planes",
         new[] { p.nearClippingPlane, p.farClippingPlane },
         new[] { _.GetContent("Near|The closest point relative to the camera that drawing will occur."), _.GetContent("Far|The furthest point relative to the camera that drawing will occur.\n") });
 }
Ejemplo n.º 2
0
        static void Drawer_Projection(HDCameraUI s, SerializedHDCamera p, Editor owner)
        {
            ProjectionType projectionType = p.orthographic.boolValue ? ProjectionType.Orthographic : ProjectionType.Perspective;

            EditorGUI.BeginChangeCheck();
            EditorGUI.showMixedValue = p.orthographic.hasMultipleDifferentValues;
            projectionType           = (ProjectionType)EditorGUILayout.EnumPopup(_.GetContent("Projection|How the Camera renders perspective.\n\nChoose Perspective to render objects with perspective.\n\nChoose Orthographic to render objects uniformly, with no sense of perspective."), projectionType);
            EditorGUI.showMixedValue = false;
            if (EditorGUI.EndChangeCheck())
            {
                p.orthographic.boolValue = (projectionType == ProjectionType.Orthographic);
            }

            if (!p.orthographic.hasMultipleDifferentValues)
            {
                if (projectionType == ProjectionType.Orthographic)
                {
                    EditorGUILayout.PropertyField(p.orthographicSize, _.GetContent("Size"));
                }
                else
                {
                    EditorGUILayout.Slider(p.fieldOfView, 1f, 179f, _.GetContent("Field of View|The width of the Camera’s view angle, measured in degrees along the local Y axis."));
                }
            }
        }
Ejemplo n.º 3
0
 static void Drawer_CameraWarnings(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     foreach (Camera camera in p.serializedObject.targetObjects)
     {
         var warnings = GetCameraBufferWarnings(camera);
         if (warnings.Length > 0)
         {
             EditorGUILayout.HelpBox(string.Join("\n\n", warnings), MessageType.Warning, true);
         }
     }
 }
Ejemplo n.º 4
0
 static void Drawer_SectionMultiDisplay(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     if (ModuleManager_ShouldShowMultiDisplayOption())
     {
         var prevDisplay = p.targetDisplay.intValue;
         EditorGUILayout.IntPopup(p.targetDisplay, DisplayUtility_GetDisplayNames(), DisplayUtility_GetDisplayIndices(), _.GetContent("Target Display"));
         if (prevDisplay != p.targetDisplay.intValue)
         {
             UnityEditorInternal.InternalEditorUtility.RepaintAllViews();
         }
     }
 }
Ejemplo n.º 5
0
        static void Drawer_FieldClippingPlanes(HDCameraUI s, SerializedHDCamera p, Editor owner)
        {
            GUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel(_.GetContent("Clipping Planes"));
            GUILayout.BeginVertical();
            var labelWidth = EditorGUIUtility.labelWidth;

            EditorGUIUtility.labelWidth = 45;
            EditorGUILayout.PropertyField(p.nearClippingPlane, _.GetContent("Near|The closest point relative to the camera that drawing will occur."));
            EditorGUILayout.PropertyField(p.farClippingPlane, _.GetContent("Far|The furthest point relative to the camera that drawing will occur.\n"));
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
            EditorGUIUtility.labelWidth = labelWidth;
        }
Ejemplo n.º 6
0
        static void Drawer_FieldRenderTarget(HDCameraUI s, SerializedHDCamera p, Editor owner)
        {
            EditorGUILayout.PropertyField(p.targetTexture);

            // show warning if we have deferred but manual MSAA set
            // only do this if the m_TargetTexture has the same values across all target cameras
            if (!p.targetTexture.hasMultipleDifferentValues)
            {
                var targetTexture = p.targetTexture.objectReferenceValue as RenderTexture;
                if (targetTexture &&
                    targetTexture.antiAliasing > 1 &&
                    !p.frameSettings.enableForwardRenderingOnly.boolValue)
                {
                    EditorGUILayout.HelpBox("Manual MSAA target set with deferred rendering. This will lead to undefined behavior.", MessageType.Warning, true);
                }
            }
        }
Ejemplo n.º 7
0
 static void Drawer_FieldVR(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     if (s.canOverrideRenderLoopSettings)
     {
         EditorGUILayout.PropertyField(p.frameSettings.enableStereo, _.GetContent("Enable Stereo"));
     }
     else
     {
         var hdrp = GraphicsSettings.renderPipelineAsset as HDRenderPipelineAsset;
         Assert.IsNotNull(hdrp, "This Editor is valid only for HDRP");
         var enableStereo = hdrp.GetFrameSettings().enableStereo;
         GUI.enabled = false;
         EditorGUILayout.Toggle(_.GetContent("Enable Stereo (Set by HDRP)"), enableStereo);
         GUI.enabled = true;
     }
     EditorGUILayout.PropertyField(p.stereoSeparation, _.GetContent("Stereo Separation"));
     EditorGUILayout.PropertyField(p.stereoConvergence, _.GetContent("Stereo Convergence"));
 }
Ejemplo n.º 8
0
 static void Drawer_FieldTargetEye(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     EditorGUILayout.IntPopup(p.targetEye, k_TargetEyes, k_TargetEyeValues, _.GetContent("Target Eye"));
 }
 static void Drawer_FieldAperture(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.aperture, _.GetContent("Aperture"));
 }
Ejemplo n.º 10
0
 static void Drawer_FieldShutterSpeed(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     p.shutterSpeed.floatValue = 1f / p.shutterSpeed.floatValue;
     EditorGUILayout.PropertyField(p.shutterSpeed, _.GetContent("Shutter Speed (1 / x)"));
     p.shutterSpeed.floatValue = 1f / p.shutterSpeed.floatValue;
 }
Ejemplo n.º 11
0
 static void Drawer_FieldOcclusionCulling(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.occlusionCulling, _.GetContent("Occlusion Culling"));
 }
Ejemplo n.º 12
0
 static void Drawer_FieldRenderingPath(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.renderingPath, _.GetContent("Rendering Path"));
 }
Ejemplo n.º 13
0
 static void Drawer_FieldNormalizedViewPort(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.normalizedViewPortRect, _.GetContent("Viewport Rect|Four values that indicate where on the screen this camera view will be drawn. Measured in Viewport Coordinates (values 0–1)."));
 }
Ejemplo n.º 14
0
 static void Drawer_FieldDepth(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.depth, _.GetContent("Depth"));
 }
Ejemplo n.º 15
0
 static void Drawer_FieldBackgroundColorHDR(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.backgroundColorHDR, _.GetContent("Background Color|The BackgroundColor used to clear the screen when selecting BackgrounColor before rendering."));
 }
Ejemplo n.º 16
0
 static void Drawer_FieldIso(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.iso, _.GetContent("ISO"));
 }
Ejemplo n.º 17
0
 static void Drawer_FieldCullingMask(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.cullingMask, _.GetContent("Culling Mask"));
 }
Ejemplo n.º 18
0
 static void Drawer_FieldVolumeLayerMask(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.volumeLayerMask, _.GetContent("Volume Layer Mask"));
 }
Ejemplo n.º 19
0
 static void Drawer_FieldBackgroundColor(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.backgroundColor, _.GetContent("Background Color|The Camera clears the screen to this color before rendering."));
 }
Ejemplo n.º 20
0
 static void Drawer_FieldClearDepth(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.clearDepth, _.GetContent("ClearDepth|The Camera clears the depth buffer before rendering."));
 }
Ejemplo n.º 21
0
 static void Drawer_FieldClearColorMode(HDCameraUI s, SerializedHDCamera p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.clearColorMode, _.GetContent("Clear Mode|The Camera clears the screen to selected mode."));
 }