Bug with multiple cameras?

Should this work on iphone? Not sure if this is a bug, because I just started learning about multiple cameras.

Add a second camera and in the editor set it’s normalized viewport rect: 0,0,1,0.5
In the game view you see just a stretched version of the camera. In Unity Indie (non-iphone), when I do the same, I see a horizontal split screen, as expected.

Wow- ok this actually works fine on the device too. It seems to be an Editor-only bug in Unity iPhone. Filing report now

Sorry, but I’d like to bump this topic as I have some difference between Unity iPhone editor and my iPhone screen :

Set 2 cameras, one rendering a normal 3D scene, and a second ortographic with some Start() built HUD meshes.

In iPhone Unity, I can see the HUD, but on the iPhone, it has disappeared …

Is there something to do to have second cameras activated on the final build ? Or else … ? :roll:

nOmad, its not rendering to a render texture is it? No render textures on iphone.

Or is it using a normalised viewport rect for positioning? I have seen weird stuff with that too… things are in correct position in editor, but not when displayed on iphone. I think Renaldas Team are aware of it, BUT…

Send in a bug report with the project attached and I am sure the guys/gals at UT will get it fixed if it is truly a bug.

Hello Seon,

no it’s no render texture at all, just a second camera with a different layer culling maskand objects set to this layer :confused:

It is a normalized viewport for rendering on the other hand …

Ok I’ll try to reset to default those settings before sending a report, thank you for the info :wink:

yup, changed all to default … the HUD disappears on the iPhone :confused:

Sending a bug report now. Thanks for your support.

As far as I know this is not a bug. I’m using it in my project. Make sure following things:

  • Camera 1: Render 3d objects
  1. Not ortho
  2. Clear Flags = Sky box or Color
  3. Depth 0
  • Camera 2: Render 3D HUD
  1. Ortho
  2. Clear Flag = Depth Only [most important]
  3. Depth 10 or more [for render order]

That should be fine.

Thanks

Yes, it is this exact bunch of settings in my project, except cam1 is depth 1, and cam2 is depth 2.

Is there some need to set cam2’s depth 10 levels higher to make it work properly ?

Also, I put an ortho size of 10 in cam2, and no viewport normalizing.
Finally, cam1 renders objects on layer 9, cam2 those on layer 8.

I tested a situation where cam2 points at the cam1 3D objects, set both cam to render the same layer, no ortho for cam2 : both are rendered correctly.

I’m lost :frowning:

Bug reported, I hope it will be looked at, as this problem is very dev-breaking :confused:

Ok the bug may seem to be around the layer : I’ve put my 3D animated objects into the HUD layer, they are correctly rendered in Unity Editor, but not on iPhone.

Tryin the camera approach now …

edit : Tried the Depth at 10, no orthographic, still displaying in Editor but not on iPhone.

I think it’s confirmed that this problem comes from layers.

created a thread in Unity support for better visibility.

I had this problem too in my game iCrossbow (now in the app store).

I have a small picture-in-picture view at the top-left of the game screen using a second camera with viewport rect set appropriately.

In editor it displays on RIGHT-top corner, but in game it displays on LEFT-top corner. I just had to get used to it and pretend it was in the proper place while in the editor.

Hope you find a workaround!

Thank you for your support :wink:

Yeah, after several tests I am now pretty 90% sure that it comes from bad position compiling.

Well I guess tonight will be the big debugging night for me … :frowning: