示例#1
0
        public WaterWavesRenderer(IGraphicsService graphicsService)
        {
            if (graphicsService == null)
            throw new ArgumentNullException("graphicsService");
              if (graphicsService.GraphicsDevice.GraphicsProfile == GraphicsProfile.Reach)
            throw new NotSupportedException("The WaterWavesRenderer does not support the Reach profile.");

              _graphicsService = graphicsService;

              _effect = graphicsService.Content.Load<Effect>("DigitalRune/Water/Ocean");
              _parameterSize = _effect.Parameters["Size"];
              _parameterSpectrumParameters = _effect.Parameters["SpectrumParameters"];
              _parameterSourceTexture = _effect.Parameters["SourceTexture0"];
              _passSpectrum = _effect.Techniques[0].Passes["Spectrum"];

              _fft = new OceanFft(graphicsService);
        }
示例#2
0
        public WaterWavesRenderer(IGraphicsService graphicsService)
        {
            if (graphicsService == null)
            {
                throw new ArgumentNullException("graphicsService");
            }
            if (graphicsService.GraphicsDevice.GraphicsProfile == GraphicsProfile.Reach)
            {
                throw new NotSupportedException("The WaterWavesRenderer does not support the Reach profile.");
            }

            _graphicsService = graphicsService;

            _effect        = graphicsService.Content.Load <Effect>("DigitalRune/Water/Ocean");
            _parameterSize = _effect.Parameters["Size"];
            _parameterSpectrumParameters = _effect.Parameters["SpectrumParameters"];
            _parameterSourceTexture      = _effect.Parameters["SourceTexture0"];
            _passSpectrum = _effect.Techniques[0].Passes["Spectrum"];

            _fft = new OceanFft(graphicsService);
        }