Exemplo n.º 1
0
 public XBRShader()
 {
     Console.WriteLine("{0}", String.Join("\n", Assembly.GetExecutingAssembly().GetManifestResourceNames()));
     Shader = new GLShader(
         GLShaderFilter.DefaultVertexShader,
         Assembly.GetExecutingAssembly().GetManifestResourceStream("CSPspEmu.Gui.XBR.Shader.Shader_2xBR.frag").ReadAllContentsAsString()
     );
     Filter = GLShaderFilter.Create(1, 1, Shader);
 }
Exemplo n.º 2
0
 protected GlUniformAttribute(GLShader shader, string name, int location, int arrayLength,
                              GLValueType valueType)
 {
     Shader      = shader;
     Name        = name;
     Location    = location;
     ArrayLength = arrayLength;
     ValueType   = valueType;
 }
Exemplo n.º 3
0
 private GLShaderFilter(int Width, int Height, GLShader Shader)
 {
     this.Shader = Shader;
     SetSize(Width, Height);
     this.PositionBuffer = GLBuffer.Create().SetData<float>(new float[] {
         -1f, -1f,
         +1f, -1f,
         -1f, +1f,
         +1f, +1f,
     });
     this.TexcoordsBuffer = GLBuffer.Create().SetData<float>(new float[] {
         0f, 0f,
         1f, 0f,
         0f, 1f,
         1f, 1f,
     });
 }
 private GLShaderFilter(int Width, int Height, GLShader Shader)
 {
     this.Shader = Shader;
     SetSize(Width, Height);
     PositionBuffer = GLBuffer.Create().SetData(new[]
     {
         -1f, -1f,
         +1f, -1f,
         -1f, +1f,
         +1f, +1f
     });
     TexcoordsBuffer = GLBuffer.Create().SetData(new[]
     {
         0f, 0f,
         1f, 0f,
         0f, 1f,
         1f, 1f
     });
 }
Exemplo n.º 5
0
 public GlUniform(GLShader shader, string name, int location, int arrayLength, GLValueType valueType)
     : base(shader, name, location, arrayLength, valueType)
 {
 }
 public static GLShaderFilter Create(int Width, int Height, GLShader Shader)
 {
     return(new GLShaderFilter(Width, Height, Shader));
 }
Exemplo n.º 7
0
        private void Initialize()
        {
            Smaa = new Smaa();

            Shader = new GLShader(
                "attribute vec4 position; attribute vec4 texCoords; varying vec2 v_texCoord; void main() { gl_Position = position; v_texCoord = texCoords.xy; }",
                "uniform sampler2D texture; varying vec2 v_texCoord; void main() { gl_FragColor = texture2D(texture, v_texCoord); }"
            );

            VertexBuffer = GLBuffer.Create().SetData(CSharpPlatform.RectangleF.FromCoords(-1, -1, +1, +1).GetFloat2TriangleStripCoords());

            Shader.BindUniformsAndAttributes(ShaderInfo);

            // TestTexture = GLTexture.Create().SetFormat(TextureFormat.RGBA).SetSize(2, 2).SetData(new uint[] { 0xFF0000FF, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFFFF });
        }
Exemplo n.º 8
0
 public static GLShaderFilter Create(int Width, int Height, GLShader Shader)
 {
     return new GLShaderFilter(Width, Height, Shader);
 }