regl icon indicating copy to clipboard operation
regl copied to clipboard

regl.clear({scissor})

Open dy opened this issue 7 years ago • 3 comments

Sometimes we deal with clearing just a part of canvas, as in parcoords example.

var gl = regl._gl;
    gl.enable(gl.SCISSOR_TEST);
    gl.scissor(x, y, width, height);
    regl.clear({color: [0, 0, 0, 0], depth: 1});

That does not seem like a regl way. Possibly enabling scissor property for regl.clear would be a nice improvement:

regl.clear({color: [0,0,0,0], scissor: [x,y, width,height]})

Related to #425

dy avatar Sep 14 '17 22:09 dy

This is a reasonable enhancement and would be a good first issue.

CC @gregtatum

mikolalysenko avatar Jan 11 '18 21:01 mikolalysenko

I will take this in the next week or two.

gregtatum avatar Jan 12 '18 20:01 gregtatum

Also on the first point: you could create a scope to set the scissor box.

mikolalysenko avatar Jan 12 '18 20:01 mikolalysenko