# Alpha Blending Not Working

**URL:** <https://psychtoolbox.discourse.group/t/alpha-blending-not-working/1726>\
**Category:** Uncategorized\
**Created:** [October 30, 2006, 6:17pm UTC](https://psychtoolbox.discourse.group/t/alpha-blending-not-working/1726 "2006-10-30T18:17:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [October 30, 2006, 6:17pm UTC](https://psychtoolbox.discourse.group/t/alpha-blending-not-working/1726/1 "2006-10-30T18:17:46Z")

</div>

Hi!  
  
I'm just now switching to the OSX PTB, and I've noticed that on our G5 analysis machine,   
the alpha blending works just fine (with the screen DrawDots function), but only if I draw   
'online'. If I choose to draw offscreen windows, then the alpha blending works only on the   
first presentation of all of the frames. Also, I'm attempting to use our experimental   
computer (Dual 1.25GHz, PowerPC G4, OSX 10.3.9, a machine that we've been using OS9   
PTB on for a few years now), but the alpha blending does not work at all on this machine.  
  
I have the following questions:  
1) Is the alpha blending necessary for every offscreen window, or is it only needed once?   
When redrawing on a frame, why isn't alpha-blending enabled?  
2) Could the latter of my problems be a result of the hardware? operating system?  
  
Thanks!  
javi

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [October 31, 2006, 1:35am UTC](https://psychtoolbox.discourse.group/t/alpha-blending-not-working/1726/2 "2006-10-31T01:35:33Z")

</div>

Hi,  
  
1) Two answers: First, i found a small bug in the offscreen window  
switching code that could create some funky effects when using  
offscreen windows in conjunction with alpha blending, but only under  
very special circumstances, so i don't think that's your problem -  
Thanks for pointing me to it anyway ;-) -- will be fixed in next update.  
  
Second, alpha-blending can be a bit mind-bending, so i don't know what  
you want to do, or what you do, but as a starter if you just want to  
store images of your anti-aliased dots in offscreen windows and later  
just blit those images to the screen, you would need to disable alpha  
blending after you've drawn your offscreen windows and before blitting  
them to the onscreen window, ie, Screen('Blendfunction', win, GL\_ONE,  
GL\_ZERO);  
  
2) Some features are dependent on OS version, how modern your gfx-hw  
is, type of gfx-card and how much video ram it has, so this could be a  
reason. E.g., reg. point anti-aliasing as in DotDemo.m: NVidia cards  
support point-sizes between 1 and 64 pixels, whereas many older ATI  
cards only support a range of 1 to 10 pixels. PTB would abort with  
some error message if you tried to draw bigger dots than that diameter.  
  
-mario  
  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "ejavidotcom" \<javi@...\> wrote:  
> \>  
> \> Hi!  
> \>   
> \> I'm just now switching to the OSX PTB, and I've noticed that on our  
> G5 analysis machine,   
> \> the alpha blending works just fine (with the screen DrawDots  
> function), but only if I draw   
> \> 'online'. If I choose to draw offscreen windows, then the alpha  
> blending works only on the   
> \> first presentation of all of the frames. Also, I'm attempting to  
> use our experimental   
> \> computer (Dual 1.25GHz, PowerPC G4, OSX 10.3.9, a machine that we've  
> been using OS9   
> \> PTB on for a few years now), but the alpha blending does not work at  
> all on this machine.  
> \>   
> \> I have the following questions:  
> \> 1) Is the alpha blending necessary for every offscreen window, or is  
> it only needed once?   
> \> When redrawing on a frame, why isn't alpha-blending enabled?  
> \> 2) Could the latter of my problems be a result of the hardware?   
> operating system?  
> \>   
> \> Thanks!  
> \> javi  
> \>
