public Texture <Spectrum> GetSpectrumTexture(string n, Spectrum defaultValue) { var name = _geomParams.FindTexture(n); if (string.IsNullOrEmpty(name)) { name = _materialParams.FindTexture(n); } if (!string.IsNullOrEmpty(name)) { if (_spectrumTextures.ContainsKey(name)) { return(_spectrumTextures[name]); } throw new InvalidOperationException(string.Format("Couldn't find spectrum texture named '{0}' for parameter '{1}'", name, n)); } var value = _geomParams.FindSpectrum(n, _materialParams.FindSpectrum(n, defaultValue)); return(new ConstantTexture <Spectrum>(value)); }