public PostProcessingEffect(string fragmentShader, string fragmentShaderObsolete = null, bool useDepth = false, int depthSize = 16) { string[] attribs = null; if (fragmentShaderObsolete != null) { attribs = new string[] { "screen_vertex", "screen_uv" }; } screenMesh = new Mesh(new Shader(vertexShader, fragmentShader, vertexShaderObsolete, fragmentShaderObsolete, attribs)); screenMesh.hasVertexColors = false; this.useDepth = useDepth; this.depthSize = depthSize; screenMesh.v = new float[] { -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, 1 }; screenMesh.uv = new float[] { 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1 }; // upload both vertices and uvs screenMesh.Update(); screenMesh.noMatrix = true; // enabled by default this.enabled = true; }
public PostProcessingEffect(string fragmentShader, string fragmentShaderObsolete = null) { string[] attribs = null; if (fragmentShaderObsolete != null) { attribs = new string[] { "screen_vertex", "screen_uv" }; } screenMesh = new Mesh(new Shader(vertexShader, fragmentShader, vertexShaderObsolete, fragmentShaderObsolete, attribs)); screenMesh.hasVertexColors = false; screenMesh.v = new float[] { -1, 1, 1, 1, 1, -1, 1,-1, -1, -1, -1, 1 }; screenMesh.uv = new float[] { 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1 }; // upload both vertices and uvs screenMesh.Update(); screenMesh.noMatrix = true; // enabled by default this.enabled = true; }