psychopy.org | Reference | Downloads | Github

"Mouse-contingent" window in Pavlovia/PsychoJS without exploding RAM

Hey there,

I’m trying to implement a task for Pavlovia which would most likely be ran with eyetracking in the lab. Since we want to test participants online we want to somehow control for what they can see.

Now, since the aperture component is not yet implemented in PsychoJS, I was wondering whether there is a way to implement the aperture feature for online experiments without making the participants computer blow up - I’ve tried overlaying a PNG image with a transparent hole in the center and updating the position continuously (each frame); my browser did not handle this approach very well. I guess WebGL is not designed for rendering an image in a new position each frame, or I missed out on a lifehack related to good memory usage.

So here’s my question in a more concise manner: is there a good way to draw a mouse-contingent-window for online experiments? Has anyone else solved this problem before?

Best wishes

hi @mkallmayer, there is actually a demo showing how you could do this:

https://run.pavlovia.org/demos/dynamic_selective_inspect/html/

This should run on your browser with no problems. You can download the task (here) and see how it works, but it is essentially a plain white image with a circle image mask with the image position set to the mouse position.

1 Like

Thanks for the response.
Inspired by your example I got it done by highly compressing the mask image to 260B (gif saved the day).
Works like a charm, cheers.