Is this feasible?

Hello, I am currently learning to use OpenGL and I was wondering if it was possible to have the hardware do something like the following: (as far as i understand it, you can only program vertex and pixel shaders, and the rest is hardcoded, am I right?). It’s a little experiment I would like to try:

Basically what i am trying to do is to render a frame in a buffer the usual way, except that I don’t need to render the whole screen, only a few random pixels. I guess I would have to use a stencil to do this but it seems like an inefficient way to do it in terms of performance since, as i understand it, i would rasterize a huge number of triangles for nothing.
To render the actual frame that will be shown on screen i would need to use the current frame, and the next one would be the sum of a darkened version of the current frame and of the few pixels in the buffer.

I’ve just started learning and i know i’m probably missing the whole picture here. But if you had any pointers for how i might be able to produce this effect or where i should try looking, i would be very grateful, thanks!

Even though I don’t have experience with shaders yet (though I’ve read the first few chaptes of OpenGL shading language) I think you could easily do this with shaders.