Exemple #1
0
 public WaveShiftShaderProgram(Vector waveVector, Vector polarizationVector)
     : base(VertexShader.Default, WaveShiftFragmentShader)
 {
     _phase            = new UniformFloat(this, "phase");
     _waveVector       = new UniformVec2(this, "waveVector", waveVector);
     _wavePolarization = new UniformVec2(this, "wavePolarization", polarizationVector);
 }
 public CausticShaderProgram(Rectangle region, double intensity = 1)
     : base(VertexShader.Default, _causticFragmentShader)
 {
     _phase     = new UniformFloat(this, "phase");
     _intensity = new UniformFloat(this, "intensity", intensity);
     _offset    = new UniformVec2(this, "offset", region.TopLeft);
     _scale     = new UniformVec2(this, "scale", region.Size);
 }
 public ShockwaveShaderProgram(double width)
     : base(VertexShader.Default, ShockwaveFragmentShader)
 {
     _amplitude = new UniformFloat(this, "amplitude", 0.01);
     _radius    = new UniformFloat(this, "radius");
     _width     = new UniformFloat(this, "width", width);
     _origin    = new UniformVec2(this, "origin");
 }
 public SpotlightShaderProgram(double innerRadius, double outerRadius)
     : base(VertexShader.Default, _fragmentShader)
 {
     _origin        = new UniformVec2(this, "origin");
     _scale         = new UniformVec2(this, "scale");
     Scale          = (1, 1);
     _innerRadius   = new UniformFloat(this, "innerRadius", innerRadius);
     _outerRadius   = new UniformFloat(this, "outerRadius", outerRadius);
     _darknessColor = new UniformColor(this, "darknessColor", Colors.Black);
 }
        public SoundVisualizerShaderProgram(byte[] data, Vector scale)
            : base(VertexShader.Default, _fragShader(data.Length))
        {
            _origin      = new UniformVec2(this, "origin");
            _scale       = new UniformVec2(this, "scale", scale);
            _orientation = new UniformFloat(this, "orientation");
            _offset      = new UniformInt32(this, "offset");
            _data        = new UniformTexture(this, "data", 1);

            _dataBuffer = new SamplerBuffer(data);
            _dataBuffer.BindToLocation(1);
        }