Beispiel #1
0
 /// <summary>
 /// Allows the execution of code whenever the <see cref="Effect"/> has been loaded
 /// </summary>
 protected override void OnLoaded()
 {
     Stream glslStream;
     Shader shader;
     base.OnLoaded();
     this.ShaderProgram = new ShaderProgram();
     glslStream = ResourceManager.GetResourceStream(new Uri(PixelateEffect.SHADER_GLSLFILE_PATH, UriKind.Relative));
     shader = new Shader(OpenTK.Graphics.OpenGL.ShaderType.FragmentShader, glslStream);
     this.ShaderProgram.Shaders.Add(shader);
     this.ShaderProgram.SetUniform(PixelateEffect.UNIFORM_PIXELTHRESHOLD, (float)this.PixelThreshold);
 }
Beispiel #2
0
 /// <summary>
 /// Allows the execution of code whenever the <see cref="Effect"/> has been loaded
 /// </summary>
 protected override void OnLoaded()
 {
     Stream glslStream;
     Shader shader;
     base.OnLoaded();
     this.ShaderProgram = new ShaderProgram();
     glslStream = ResourceManager.GetResourceStream(new Uri(ColorizeEffect.FRAGSHADER_GLSLFILE_PATH, UriKind.Relative));
     shader = new Shader(OpenTK.Graphics.OpenGL.ShaderType.FragmentShader, glslStream);
     this.ShaderProgram.Shaders.Add(shader);
     this.ShaderProgram.SetUniform(ColorizeEffect.UNIFORM_COLOR, this.Color);
     this.ShaderProgram.SetUniform(ColorizeEffect.UNIFORM_COLOR, this.Color);
     this.ShaderProgram.SetUniform(ColorizeEffect.UNIFORM_INTENSITY, this.IntensityF);
     this.ShaderProgram.SetUniform(ColorizeEffect.UNIFORM_INTENSITY, this.IntensityF);
 }
Beispiel #3
0
 /// <summary>
 /// Detaches the specified <see cref="Shader"/> from the <see cref="ShaderProgram"/>
 /// </summary>
 /// <param name="shader">The <see cref="Shader"/> to detach from the <see cref="ShaderProgram"/></param>
 private void Detach(Shader shader)
 {
     GL.DetachShader(this.Id, shader.Id);
 }
Beispiel #4
0
 /// <summary>
 /// Attaches the specified <see cref="Shader"/> to the <see cref="ShaderProgram"/>
 /// </summary>
 /// <param name="shader">The <see cref="Shader"/> to attach to the <see cref="ShaderProgram"/></param>
 private void Attach(Shader shader)
 {
     GL.AttachShader(this.Id, shader.Id);
 }