[visionegg] Re: Multiple viewports, put_pixels

  • From: Tony Arkles <tony@xxxxxxxxx>
  • To: visionegg@xxxxxxxxxxxxx
  • Date: Tue, 06 Jun 2006 07:22:51 -0600

I'm not sure how much VisionEgg supports this natively, but I've been doing some work on an entirely unrelated problem that has been working ok for me :)

I've been taking the projections that I've drawn and using some form of get_pixels to pull them off the screen, and then I'm copying them each to a texture. When I go to draw the final stimulus, I set the viewport to the entire screen, and draw quads with the appropriate textures on them. This allows full control over the entire screen.

Like I said, I'm not sure how much VisionEgg supports this natively. I'd be willing to help out with this though if you're interested.

Tony


On 6-Jun-06, at 7:07 AM, Graeme Phillipson wrote:

Hello,
I'm trying to filter the output of vision egg on a per pixel basis and I'm having a few problems. I am doing stereostopic back projection, and the way it works is that one large screen sends the left half of the screen to the left eye projector and the right half to the right projector. So I have two viewport objects connected to one screen, and that works very nicely.


However because I am back projecting there is a very bright spot in the screen, this isn't all bad as we wanted a gaussian shaped mask over the stimulus anyway, so I have written code that uses get_framebuffer_as_array/put_pixels to adjust the bright spot into a nice gaussian shaped mask (incidently I don't care about speed as my stimuli are static, but I do care about exactly what luminence I get at each pixel, which is why I have chosen this rather slow way of doing things).

Since get_framebuffer_as_array/put_pixels are screen method I thought I would get both viewports but what I actualy seem to get is the contents of what viewport I drew in last.
If I do this:
screen.clear()
left_viewport.set(stimuli = left_stimulus)
left_viewport.draw()
right_viewport.set(stimuli = right_stimulus)
right_viewport.draw()
output_filters.filter_screen(screen)
I get exactly what I want for the right eye. If I do this:
screen.clear()
left_viewport.set(stimuli = left_stimulus)
left_viewport.draw()
output_filters.filter_screen(screen)
right_viewport.set(stimuli = right_stimulus)
right_viewport.draw()
I get mostly the right thing for the left eye but the right half of the left eye is black.
If I do this:
screen.clear()
left_viewport.set(stimuli = left_stimulus)
left_viewport.draw()
output_filters.filter_screen(screen)
right_viewport.set(stimuli = right_stimulus)
right_viewport.draw()
output_filters.filter_screen(screen)
It mostly looks correct excet that the right half of the left eye is black and the right eye has the left half black.


So my question is, is this the right approach to useing put_pixels with multiple viewports? If so what am I doing wrong, and if not what should I be doing?

Any help would be greatly appreciated!

Thanks,
Graeme Phillipson.

======================================
The Vision Egg mailing list
Archives: //www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

====================================== The Vision Egg mailing list Archives: //www.freelists.org/archives/visionegg Website: http://www.visionegg.org/mailinglist.html

Other related posts: