コード例 #1
0
ファイル: PixelateEffect.cs プロジェクト: yonglehou/Photon
 /// <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);
 }
コード例 #2
0
ファイル: ColorizeEffect.cs プロジェクト: yonglehou/Photon
 /// <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);
 }
コード例 #3
0
ファイル: ShaderProgram.cs プロジェクト: yonglehou/Photon
 /// <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);
 }
コード例 #4
0
ファイル: ShaderProgram.cs プロジェクト: yonglehou/Photon
 /// <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);
 }