buffer - Vuforia & Unity readpixels frame -


past month i've been working unity , vuforia create augmented reality game android/tablet. i've been working unity-pro trial , since today i've got full unity pro license. don't know if has change trial full, ever since i'm getting error:

readpixels called read pixels system frame buffer, while not inside drawing frame. unityengine.texture2d:readpixels(rect, int32, int32, boolean) webcamimpl:getpixels32andbufferframe(int32) (at assets/qualcomm augmented reality/scripts/internal/webcamimpl.cs:250) qcarmanagerimpl:injectcameraframe() (at assets/qualcomm augmented reality/scripts/internal/qcarmanagerimpl.cs:452) qcarmanagerimpl:update(screenorientation) (at assets/qualcomm augmented reality/scripts/internal/qcarmanagerimpl.cs:195) qcarbehaviour:update() (at assets/qualcomm augmented reality/scripts/qcarbehaviour.cs:418)

and

trying read pixel out of bounds

leaving me unable run game in editor. works fine when build towards android or switch platform pc. takes lots of time , want keep bugtesting in editor instead of building everytime test new.

i've tried lots of things (complete new projects, exporting , importing packages , added external webcam well).

(also: im getting webcam profile nog found! error webcambehaviour script, might have it)

thanks in advance,

twei

you must use waitforendofframe() before use readpixels(). here:

private ienumerator rpixels(){     yield return new waitforendofframe();     // create texture size of screen, rgb24 format     int width = screen.width;     int height = screen.height;     texture2d tex = new texture2d(width, height, textureformat.rgb24, false);     // read screen contents texture     tex.readpixels(new rect(0, 0, width, height), 0, 0);     tex.apply();} 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -