Exemplo n.º 1
0
        private void OnGUI()
        {
            // Display any errors at the top of our GUI.
            // Error will have one frame of latency.
            ErrorDisplay();

            if (ErrorCapture(ComputeAndDisplaySettings(ref settings)))
            {
                return;
            }

            if (ErrorCapture(ComputeAndDisplayTextureSource(ref textureSource, ref textureSourceData)))
            {
                return;
            }

            if (GUILayout.Button(SAVE_BUTTON_NAME))
            {
                Texture3D texture3D = null;
                if (ErrorCapture(HDRSkyEditor.ComputeTextureDestinationFromSource(ref textureDestination, ref textureDestinationData, ref textureSource, ref textureSourceData, settings)))
                {
                    return;
                }

                if (ErrorCapture(HDRSkyEditor.SaveEXRFromTextureDestination(textureDestination, settings)))
                {
                    return;
                }
            }
        }
Exemplo n.º 2
0
        private static Matrix4x4 ComputeVonKriesChromaticAdaptationMatrixFromTemperature(float temperatureDestination, float temperatureSource)
        {
            Vector3 whitepointSourceCie1931      = Vector3.zero;
            Vector3 whitepointDestinationCie1931 = Vector3.zero;

            HDRSkyEditor.Cie1931FromTemperatureApproximate(ref whitepointSourceCie1931, temperatureSource, 64);
            HDRSkyEditor.Cie1931FromTemperatureApproximate(ref whitepointDestinationCie1931, temperatureDestination, 64);

            Vector2 whitepointChromacitySourceCie1931      = Vector2.zero;
            Vector2 whitepointChromatityDestinationCie1931 = Vector2.zero;

            HDRSkyEditor.Cie1931ChromacityFromCie1931(ref whitepointChromacitySourceCie1931, whitepointSourceCie1931);
            HDRSkyEditor.Cie1931ChromacityFromCie1931(ref whitepointChromatityDestinationCie1931, whitepointDestinationCie1931);

            return(HDRSkyEditor.ComputeVonKriesChromaticAdaptationMatrix(whitepointChromacitySourceCie1931, whitepointChromatityDestinationCie1931));
        }
Exemplo n.º 3
0
        public static void ShowWindow()
        {
            HDRSkyEditor window = EditorWindow.GetWindow <HDRSkyEditor>(true, GUI_NAME_WINDOW, true);

            window.Show();
        }