10
$\begingroup$

This is a little odd but I need to save a screen-shot as an array (numpy array for eg) without writing to disk. The idea here is to create and then call the array once per frame in an external script so doing this...

bge.render.makeScreenshot("frame.png")

...and then converting the png takes too long to be feasible mostly due to saving the image (which is something I don't need anyway).

I'm trying to avoid digging into the rasterizer's source as it's completely foreign to me so I figured I'd ask here first. Any thoughts or suggestions would be greatly appreciated.

$\endgroup$
5
  • $\begingroup$ Still can't decide if this is more appropriate here or SO. Kind of in between. $\endgroup$
    – Snesticle
    Nov 20, 2014 at 21:20
  • 3
    $\begingroup$ Look into: glReadPixels, combine with this PNG writing function, stackoverflow.com/a/19174800/432509 $\endgroup$
    – ideasman42
    Nov 21, 2014 at 13:47
  • $\begingroup$ Thank you! A quick proof of concept worked perfectly. When I have a full script I'll post it as the answer in the off chance that someone else needs to do this. $\endgroup$
    – Snesticle
    Nov 21, 2014 at 15:14
  • 2
    $\begingroup$ you could post the script you ended up with as an answer, I'm sure others would find interesting. $\endgroup$
    – ideasman42
    Nov 21, 2014 at 15:18
  • $\begingroup$ Did you make it? $\endgroup$ May 13, 2016 at 7:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.