コード例 #1
0
        void OnEnable()
        {
            if (profile == null)
            {
                profile = new DiffusionProfile("Diffusion Profile");
            }

            profile.Validate();
            UpdateCache();
        }
コード例 #2
0
        void OnEnable()
        {
            if (profile == null)
            {
                profile = new DiffusionProfile(true);
            }

            profile.Validate();
            UpdateCache();

#if UNITY_EDITOR
            if (m_Version != Version.Last)
            {
                TryToUpgrade();
            }
            UnityEditor.Experimental.Rendering.HDPipeline.DiffusionProfileHashTable.UpdateDiffusionProfileHashNow(this);
#endif
        }
        void OnEnable()
        {
            // The neutral profile is not a part of the array.
            int profileArraySize = DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT - 1;

            if (profiles != null && profiles.Length != profileArraySize)
            {
                Array.Resize(ref profiles, profileArraySize);
            }

            if (profiles == null)
            {
                profiles = new DiffusionProfile[profileArraySize];
            }

            for (int i = 0; i < profileArraySize; i++)
            {
                if (profiles[i] == null)
                {
                    profiles[i] = new DiffusionProfile("Profile " + (i + 1));
                }

                profiles[i].Validate();
            }

            ValidateArray(ref thicknessRemaps, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT);
            ValidateArray(ref worldScales, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT);
            ValidateArray(ref shapeParams, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT);
            ValidateArray(ref transmissionTintsAndFresnel0, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT);
//forest-begin: Tweakable transmission
            ValidateArray(ref transmissionDirectAndIndirectScales, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT);
//forest-end:
            ValidateArray(ref disabledTransmissionTintsAndFresnel0, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT);
            ValidateArray(ref filterKernels, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT * DiffusionProfileConstants.SSS_N_SAMPLES_NEAR_FIELD);

            // Old SSS Model >>>
            ValidateArray(ref halfRcpWeightedVariances, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT);
            ValidateArray(ref halfRcpVariancesAndWeights, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT * 2);
            ValidateArray(ref filterKernelsBasic, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT * DiffusionProfileConstants.SSS_BASIC_N_SAMPLES);

            Debug.Assert(DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT <= 32, "Transmission and Texture flags (32-bit integer) cannot support more than 32 profiles.");

            UpdateCache();
        }
コード例 #4
0
        void OnEnable()
        {
            // The neutral profile is not a part of the array.
            int profileArraySize = DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT - 1;

            if (profiles != null && profiles.Length != profileArraySize)
            {
                Array.Resize(ref profiles, profileArraySize);
            }

            if (profiles == null)
            {
                profiles = new DiffusionProfile[profileArraySize];
            }

            for (int i = 0; i < profileArraySize; i++)
            {
                if (profiles[i] == null)
                {
                    profiles[i] = new DiffusionProfile("Diffusion Profile " + (i + 1));
                }

                profiles[i].Validate();
            }

            ValidateArray(ref thicknessRemaps, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT);
            ValidateArray(ref worldScales, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT);
            ValidateArray(ref shapeParams, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT);
            ValidateArray(ref transmissionTintsAndFresnel0, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT);
            ValidateArray(ref disabledTransmissionTintsAndFresnel0, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT);
            ValidateArray(ref filterKernels, DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT * DiffusionProfileConstants.SSS_N_SAMPLES_NEAR_FIELD);

            Debug.Assert(DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT <= 32, "Transmission and Texture flags (32-bit integer) cannot support more than 32 profiles.");

            UpdateCache();
        }