// --- Public Methods ---

        public SubsurfaceScatteringParameters()
        {
            m_NumProfiles    = 1;
            m_Profiles       = new SubsurfaceScatteringProfile[m_NumProfiles];
            m_BilateralScale = 0.1f;

            for (int i = 0; i < m_NumProfiles; i++)
            {
                m_Profiles[i] = new SubsurfaceScatteringProfile();
            }
        }
Example #2
0
        // --- Public Methods ---

        public SubsurfaceScatteringSettings()
        {
            numProfiles = 1;
            profiles    = new SubsurfaceScatteringProfile[numProfiles];

            for (int i = 0; i < numProfiles; i++)
            {
                profiles[i] = new SubsurfaceScatteringProfile();
            }

            OnValidate();
        }
Example #3
0
        // --- Public Methods ---

        public SubsurfaceScatteringParameters()
        {
            m_NumProfiles = 1;
            m_Profiles    = new SubsurfaceScatteringProfile[m_NumProfiles];

            for (int i = 0; i < m_NumProfiles; i++)
            {
                m_Profiles[i] = new SubsurfaceScatteringProfile();
            }

            OnValidate();
        }
Example #4
0
        void OnEnable()
        {
            // The neutral profile is not a part of the array.
            int profileArraySize = SssConstants.SSS_N_PROFILES - 1;

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

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

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

                profiles[i].Validate();
            }

            ValidateArray(ref thicknessRemaps, SssConstants.SSS_N_PROFILES);
            ValidateArray(ref worldScales, SssConstants.SSS_N_PROFILES);
            ValidateArray(ref shapeParams, SssConstants.SSS_N_PROFILES);
            ValidateArray(ref transmissionTints, SssConstants.SSS_N_PROFILES);
            ValidateArray(ref filterKernels, SssConstants.SSS_N_PROFILES * SssConstants.SSS_N_SAMPLES_NEAR_FIELD);

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

            Debug.Assert(SssConstants.SSS_NEUTRAL_PROFILE_ID < 16, "Transmission flags (32-bit integer) cannot support more than 16 profiles (2 bits per profile).");

            UpdateCache();
        }