Artifact while presenting textures simultaneously

Dear community members,

I am now programming an experiment that required fast(<100ms) presentation of gratings (i.e., two superimposed gabors) at two different locations (A and B). I noticed that the luminescence always increase quite noticeably whenever two textures/gratings presented simultaneously. In other words, all other things being equal, the luminescence only remained consistent while single gratings being flipped. I was wondering whether this is a hardware, software driven issue or some problem with my script. As shown below:

My general strategy is to cover up previously flipped textures using FillRect, then draw new ones with my custom function Greatings in a huge for loop (not shown).

         %% Covering up the previously flipped textures
  FusionAid(windowPtr,destination_A,destination_B);
  Screen('FillRect', windowPtr,[128 128 128], destinationRect_A);
  Screen('FillRect', windowPtr,[128 128 128], destinationRect_B );
  Screen('DrawDots', windowPtr, destination_dot_A, 5, [255 0 0], [0 0], 1, 1);
  Screen('DrawDots', windowPtr, destination_dot_B, 5, [255 0 0], [0 0], 1, 1);
  Screen('BlendFunction', windowPtr, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  Screen('Flip', windowPtr);
  WaitSecs(2);

          %% Draw and flip the new gratings 
  FusionAid(windowPtr,destination_A,destination_B););
  Gratings(windowPtr, gabor_size, destination_A)
  Gratings(windowPtr, gabor_size, destination_B)
  Screen('DrawDots', windowPtr, destination_dot_A, 5, [255 0 0], [0 0], 1, 1);
  Screen('DrawDots', windowPtr, destination_dot_B, 5, [255 0 0], [0 0], 1, 1);
  Screen('BlendFunction', windowPtr, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  Screen('Flip', windowPtr);
  WaitSecs(0.04); 
         % luminescence increase!! 

Some troubleshooting attemps

  1. Under the following condition the luminescence DO NOT increase (gratings only at either A or B location)

    FusionAid(windowPtr,destination_A,destination_B););
    Gratings(windowPtr, gabor_size, destination_B)
    Screen(‘DrawDots’, windowPtr, destination_dot_A, 5, [255 0 0], [0 0], 1, 1);
    Screen(‘DrawDots’, windowPtr, destination_dot_B, 5, [255 0 0], [0 0], 1, 1);
    Screen(‘BlendFunction’, windowPtr, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    Screen(‘Flip’, windowPtr);
    WaitSecs(0.04);
    % NO luminescence increase!!

  2. NO luminescence increase in the following condition either. (B location FillRect + A location gratings)

    FusionAid(windowPtr,destination_A,destination_B););
    Gratings(windowPtr, gabor_size, destination_A)
    Screen('FillRect', windowPtr,[128 128 128], destinationRect_B );
    Screen('DrawDots', windowPtr, destination_dot_A, 5, [255 0 0], [0 0], 1, 1);
    Screen('DrawDots', windowPtr, destination_dot_B, 5, [255 0 0], [0 0], 1, 1);
    Screen('BlendFunction', windowPtr, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    Screen('Flip', windowPtr);
    WaitSecs(0.04); 
             % NO luminescence increase!! 
    
  3. I also use VRR function for more accurate timing with:
    PsychImaging(‘AddTask’, ‘General’, ‘UseFineGrainedTiming’);
    However, the issue persisted even after disabling the function altogether.

Any comment or suggestions would be appreciated.
Thanks in advance.

Additional info:
The size of the gratings and FillRect are just 200x200 pixels. I imagine RX580 should be powerful enough to drive the given task?

Hardware
intel i7 10700
AMD RX580
MSI MAG motherboard 8460M
MSI 240Hz FreeSync compatible Monitor

Software environment
Ubuntu 20.04 LTS
Matlab 2019b
GPU Driver : xf86-videoamdgpu-pro DOX video driver (latest gpu driver i can find)
Psychtoolbox3 Version 3.0.16

ITs a bit unclear to me what you are doing and observing. Do you mean the whole screen is brighter, or just that the grating looks brighter? I assume the latter. Are the gratings semi-transparent? Then it would make sense that two on top of each other is brighter (whiter white, but also darker black by the way) than a single one, since less of the background middle grays still shines through.

This should not be an issue of presentation time (short 100 ms), or graphics card power (by faaaaar powerful enough).

Cheers,
Dee

Thanks for the quick reply, you’re right, only the gratings are brighter.

Sorry for not specifying clearly, the “being brighter” that I was referring to is that comparing to having just one gratings at one of the two locations(i.e., A grating at A location; “nothing” at B location ), having two gratings at two respective locations (i.e., A* grating at A location; B grating at B location) somehow makes A* gratings brighter than A gratings.

Which is odd, since all the gratings(i.e., A, A* and B ) are generated using identical function, the only difference being either one(the former case) or two(the latter case) was drawn and flipped.

The two superimposed gabor that I mentioned here is that I use two gabors, one upright, the other rotated 90 degrees to the right, each at 50% contrast, stack them up to create a mesh-like stimuli.

Multiple comments:

  1. Mysterious!

  2. The way you do stimulus presentation timing is about as unreliable and suboptimal as it could possibly get. Please look at our demos and tutorials how to do this properly.

  3. VRR mode for fine-grained timing – apart from requiring you to follow step 2 - **will not work with the amdgpu-pro driver ** as i explained to you about 1.5 months ago here:
    XOrgConfCreator not prompting VRR settings for fine-grained visual stimulation timing
    so it isn’t surprising that that does nothing.

  4. Without a simple self-contained script that shows in detail what your are doing, and that somebody can easily run on their Linux setup, this sounds hopeless to diagnose.

That said, if you wanted me to give it a try, your lab would have to buy priority support, as this sounds like something intricate and time consuming, easily eating up an hour of work.

-mario

Sorry for the confusion, that was a type, I did reinstall both toolbox and system without the AMD provided driver, it works just great without issue, thanks again for the help!

Thanks for the suggestion, I’ll check it out.

I’ll post comments here once I figure out the issue.