示例#1
0
        private IColorType SampleProfile(ref LightSample ls, EmissionProfile profile)
        {
            if (profile.ProfileMode == ProfileMode.EmissionValue)
            {
                return ColorManager.Instance.Convert(profile.EmissionSpectra, SpectrumType.Illuminant);
            }

            var c = (RgbSpectrum)profile.EmissionTexture.Sample(ls.U, ls.V);
            return ColorManager.Instance.Convert(ref c);
        }
示例#2
0
        private readonly IValueTexture emissionTexture; // consider option with iwavelengthdependent

        public LightMaterial(EmissionProfile profile)
        {
            if (profile.EmissionTexture != null)
            {
                emissionTexture =
                    TextureFactory.Instance.CreateImageTexture((RgbSpectrumTexture) profile.EmissionTexture);
            }
            else
            {
                var color = ColorManager.Instance.Convert(profile.EmissionSpectra, SpectrumType.Illuminant);
                emissionTexture = TextureFactory.Instance.CreateConstTexture(color);
            }            
        }
 public void AddProfile(EmissionProfile profile)
 {
     this.dic.Add(profile.Name.ToLowerInvariant(), profile);
 }