Render Texture and Camera Normalized View port Rect Issue

Hello,

I am working on a Ghost Effect to make smooth transitions between 2 screen states in a presentation ( object on the left then on the right ).

I use a plane resized with the frustrum of the camera.

I clone my main camera so that it can target and generate a renderTexture without messing with the main camera.

Then I wait the next frame to get a renderTexture ready and apply it on the plane. And then i “iTween” it ( FadeTo).

It works fine with a Normalized View Port Rect width set to 1. It doesn’t work at all if i use a width of 0.5 ( i have to get this effect working on 2 main cameras for 3D relief that’s why each main camera is 0.5 width ).

I get this error message :

How can I go through this ?

I’m sorry for resurrecting such old thread, but that issue still occurs even in latest Unity 4.3.1.

It’s 100% reproducible when using render texture with depth buffer enabled and Viewport Rect dimensions W/H on camera are less then 1.0.

Does anyone know about solid workaround? Or maybe some ETA on the fix?

I remember that when trying to normalize, if the value is too small to be normalized then it is set to 0.
I’m not sure how much is too small, though.

The best workaround I found is to let the render texture capture the entire viewport, then I modify the UV offset of the material to get only the portion of the texture needed. I capture more than I need but at least I can pass through the assert.

In my case it was caused by

commandBuffer.SetRenderTarget(/*doesn't matter*/, BuiltinRenderTextureType.None);

and was fixed by replacing BuiltinRenderTextureType.None by BuiltinRenderTextureType.CurrentActive

While it was None, it was spamming 3 error messages every frame with non 0;0;1;1 viewport in editor or ALWAYS in build, regardless of the resolution or fullscreen mode.