Log in or register to post comments

Unity Render to Texture

December 28, 2011 - 1:38pm #1

Setting the ARCamera's Target Texture to a unity Render Texture it seems to make it angry. after the unity splash screen i can exit and enter the application to see a still image of whatever the camera is viewing. Is Render to texture supposed to or going to be supported.

thanks for your help

Unity Render to Texture

October 27, 2014 - 12:28pm #8

Have you had any problems building out to a device using this method?  It works perfectly in the simulator but when built out to Android or iOS, I see a black screen instead of the background camera's render texture. The augment does become visible when either device is pointed at the marker, however, it is over a black screen. Furthermore, the augment is not clearing off of the screen at the end of each frame, resulting in an anomaly which looks like a deck of cards being pushed out on a table.

Been working on this one for some time now and this is the closest I've gotten it to display properly on a mobile device. 

Unity Render to Texture

October 25, 2014 - 8:27am #7
RenderTexture on ARCamera doesn't work... but RenderTexture on the "BackgroundCamera" gameObject that is instantiated at runtime does work.  A little slow, but not as slow as reading the pixels to texture manually.
 
After you define a rendertexture and a material that uses it, place that material on your camera plane(or planes if you are trying dual rendering for Google Cardboard/Durovis Dive AR) and add this script somewhere in the scene and assign its rendertexture member to see this all working:
 
public RenderTexture mRenderTexture;
bool mSet = false;
 
// Update is called once per frame
void Update () 
{
  if ( !mSet )
  {
    GameObject BackgroundCamera = GameObject.Find( "BackgroundCamera(Clone)" );
    Camera bgCam = BackgroundCamera.GetComponent<Camera>();
    bgCam.SetTargetBuffers( mRenderTexture.colorBuffer, mRenderTexture.depthBuffer );
    bgCam.targetTexture = mRenderTexture;
    mSet = true;
  }
}
 
AttachmentSize
Image icon DualVuforiaWorking.jpg287.18 KB

Unity Render to Texture

June 18, 2014 - 7:04am #6

Hello, I'm trying to capture the final image generated by Vuforia using a RenderTexture for best performance. I can do it with ReadPixels but it is just too slow.

 

The link you mentioned seems out-of-date, as the current BackgroundTextureAccess sample does not contain the elements described by the dev guide. The sample only shows how to capture the background image using a Texture2D. For now, I can only capture the video as a Texture2D this way and capture the 3D objects as another RenderTexture associated with ARCamera (with a black background).

 

What can I do to render both the background video image and 3D objects onto the same RenderTexture?

 

Thank you.

Unity Render to Texture

May 1, 2014 - 11:24am #5

The Render to Texture has some limitations with AR Camera, as described in this article:

https://developer.vuforia.com/resources/dev-guide/unity-screenshots

 

Unity Render to Texture

May 1, 2014 - 9:14am #4

ksiva wrote:

Render to Texture isn't currently supported. QCAR renders the camera background natively, and so it won't be part of the final texture. If you add a Render Texture to the ARCamera you should get the augmentation, but the buffer won't be cleared each frame. Feel free to add this to the http://ar.qualcomm.at/node/2001256. - Kim

 

sorry to bring back such an old thread, but is "Render to Texture" still unsupported?

I still have problems with it, described here: https://developer.vuforia.com/forum/general-discussion/how-use-unity-render-textures-vuforia
 

Re: Unity Render to Texture

December 29, 2011 - 5:20am #3

thanks for the fast reply

Re: Unity Render to Texture

December 28, 2011 - 8:08pm #2

Render to Texture isn't currently supported. QCAR renders the camera background natively, and so it won't be part of the final texture. If you add a Render Texture to the ARCamera you should get the augmentation, but the buffer won't be cleared each frame.

Feel free to add this to the http://ar.qualcomm.at/node/2001256.

- Kim

Log in or register to post comments