예제 #1
0
        private void InitShader()
        {
            if (_shader.IsCompiled == false)
            {
                _shader.Compile();
            }

            this._mainColorUniform = _shader.GetUniform(MainColorUniformName) as Vector4Uniform;
            if (this._mainColorUniform != null)
            {
                this.Color = this._mainColorUniform.Value;
            }

            this._textures = new List <TextureUniform>(this._shader.Textures.Count);
            this.Textures  = this._textures.AsReadOnly();

            for (int i = 0; i < this._shader.Textures.Count; i++)
            {
                var uniform = this._shader.Textures[i];

                var unit = new TextureUniform(uniform);
                _textures.Add(unit);

                if (MainTextureUniformName.Equals(uniform.Name))
                {
                    _mainTextureUnit = unit;
                }
            }
        }
예제 #2
0
 private void initOverlay(ShaderManager shaders)
 {
     this.Overlay = new PostProcessSurface();
     this.Overlay.AddSettings(
         SurfaceBlendSetting.PremultipliedAlpha,
         this.overlayFadePercentage = new FloatUniform("fadePercentage"),
         this.overlayColor          = new Vector4Uniform("color")
         );
     shaders.Overlay.UseOnSurface(this.Overlay);
 }
예제 #3
0
 public Vector4UniformViewModel(Vector4Uniform uniform)
     : base(uniform)
 {
 }