【发布时间】:2015-08-24 13:57:59
【问题描述】:
我在psychopy 中使用blendMode="add" - 不幸的是GratingStim 对比度只有在窗口中没有绘制文本时才能正常工作。绘制文本后 - 跟随 GratingStims 对比看起来好像从它中减去 1(查看屏幕截图)。 avg blendMode 没有遇到这个问题,但我真的需要blendMode="add"。
这是在绘制文本之前 GratingStim 的外观:
这是绘制一些文本后的样子:
在将文本绘制到窗口后,任何跟随的 GratingStim 都会像这样呈现对比度。只有打开另一个窗口才有帮助。
我想这可以通过将一些着色器注入 pyglet 来解决,但我不知道该怎么做(related issue on github)。
下面的代码重现了这个问题:
from psychopy import visual, event, core
win = visual.Window(monitor='testMonitor', useFBO=True,
blendMode='add', units='deg')
g = visual.GratingStim(win, tex='sin', mask='gauss', size=4.5, pos=(0,6))
t = visual.TextStim(win=win, text='Hello blendMode="add"!')
draw_order = [[g], [g, t], [g, t]]
for draw_now in draw_order:
for stim in draw_now:
stim.draw()
win.flip()
event.waitKeys()
core.quit()
我使用的是 Windows - 我在 Windows 7 和 8 上都有这个问题。
【问题讨论】:
-
+1 表示可重现的示例。同样的事情也会发生,用 TextStim 代替新的 TextBox 刺激,这是我唯一的建议......
标签: python opengl pyglet psychopy