Jump to content

[SOLVED] Direct pixel copy (BLT) to output buffer


photo

Recommended Posts

Hi,

  I am using a visual display that allows embedded pixel buffers to be interpreted by the hardware to enable digital outputs (it just turns that row of pixels black before hitting the monitor).  This allows precise synchronization of particular video frames with other hardware in our system.  My question is, what's the most sensible way to attach a direct "blt" at the end of the rendering pipeline so I can ensure that my desired pixel "string" gets to the hardware without any AA or other modifications?  in OpenGL, I'd do a glDrawPixels at a set 2DRasterPos.  I wasn't sure what the most "portable" way of doing this in Unigine was.  Ideally I would create the short block of pixels in a script and attach to particular frames.  Alternatively, I can create a new node type for this as a C++ plugin?

 

David Sheinberg

Brown University

Link to comment

Hello, David!

 

Please take my apologies for late reply, we're having local zombie apocalypse here. You know, typical Siberia, nothing special. ;)

 

I don't think creating a new node type will help you a lot with that, because node might be rendered in the middle of the frame as well as rendered many times for different passes. What you can use instead is Unigine::Ffp class on C++ side (https://developer.unigine.com/en/docs/1.0/cpp_api/reference/api_ffp_class). All you need to do is to set orthographic projection properly and render line primitive after engine rendering is done (after render but before swap).

 

You can try to set different rendering modes via Ffp::setMode to get rid of AA if you'll have problems with it.

Link to comment

Thanks!  Is the Ffp Class bound to UnigineScript or should I create the specialized extension of the Ffp Class and then bind that (or can I not call from a script at all)?

Link to comment

David,

 

Ffp class is C++ only. You're able to wrap it by writing a plugin and export your wrapper to the script but it's better to do all the stuff on C++ side.

Link to comment
  • 2 weeks later...

If I want to make an OpenGL only call just before the buffer swap, will I want to use this Ffp class or if I check that my render mode is OpenGL, will I be able to actually make these OpenGL calls directly from C++?  I actually need glDrawPixels (as opposed a vertex defined line segment).

Link to comment
×
×
  • Create New...