Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: crazysoft on April 28, 2017, 07:27:34 AM
-
Hi,
I am trying to port my game into the new 3DS development unit.
I manage to make everything run except the NGUI UI camera which I want to work in the lower touch screen.
I attach the NGUI settings I have put in images.
The lower screen should show like the image camera2.jpg but instead of that it shows a blank screen in the color of the background (brown).
Can you please tell me what I have done wrong?
Thanks
-
I can't be of much help on this one as I've never had a 3DS unit to try something like this with. I see you already chose the target display, so in theory it should work -- this assuming your widgets are on the same layer drawn by the camera. I do see some other issues with your setup..
- Clear flags should be only depth, not skybox. You're wiping all the color information from the previous (game) camera.
- You should also make sure that the depth of your cameras in the order you expect them to be.
- The "Size" should be 1. I don't know why you have it at 6.85.
- The culling mask needs to be only the layer that the UI is using. Usually that's just the UI layer. You also should make sure that only one camera draws that layer.
- Occlusion Culling isn't necessary for NGUI's UI.
- Last but not least, near clip plane needs to be -10, Far clip 10. You have it at 0, so it's possible widgets fall outside of it.
-
The game looks on in the Editor (I have the Nintendo 3DS Unity extension) but in the real device the up screen is ok and the down screen (2 screens) shows only the skybox background.
- Clear flags should be only depth, not skybox. You're wiping all the color information from the previous (game) camera.
I want to wipe all the color of the previous camera.
- You should also make sure that the depth of your cameras in the order you expect them to be.
The depth is ok.
- The "Size" should be 1. I don't know why you have it at 6.85.
I dont think this is the problem.
- The culling mask needs to be only the layer that the UI is using. Usually that's just the UI layer. You also should make sure that only one camera draws that layer.
Mine has only one. "help".
- Occlusion Culling isn't necessary for NGUI's UI.
I have deactivated it.
- Last but not least, near clip plane needs to be -10, Far clip 10. You have it at 0, so it's possible widgets fall outside of it.
Ok, made the camera orthographic and 10 to 10.
-
-10 to 10, not 10 to 10 :P
So it works fine in the editor, but doesn't work on the device? I'd suggest asking Unity, maybe they would have an idea.
-
I dont know how unity can help me on this. I attach an image of my scene, maybe you will understand more. What is really strange is that I tried with the camera on depth only and in the editor it showed no background at all (only the gui) but in the real device it showed the same as the upper screen and no gui. This is strange since I have put only the gui ("help") culling mask in the lower screen camera, how can it draw other masks?
-
I got no reply from Unity, can you give me any hints?
-
Sounds like your upper screen is drawn after your lower screen. You need to order your cameras correctly by setting their "Depth", as I mentioned. You said "The depth is ok" -- what is "ok"? What are the depth values for the two camears?
-
You are right both cameras had -1 value. I tried one camera with -1 and the other with 1 with no luck. I tried the opposite with -1 and 1 and again same result like always, the UI is not drawn in the real device and seems ok in the editor. Any other ideas? thanks
-
Any new ideas?
-
How should I set the cameras depth in order to work?
-
Just logically. First camera to draw - depth 0. Second camera -- depth 1, etc. Unfortunately I don't have any devices with multiple monitors so I can't give you any specific suggestions beyond ordering the cameras properly, and making sure that the camera's clear flags are correct.
First camera should clear color (this includes depth). All following cameras should only clear depth. The only thing I can think of is I don't know if clearing the color on a multi-screen device would clear both screens or not. You can try clearing color on both screens, but make sure to do it with a different color so you can tell what happens. If both your the device's screens end up as one color, then you know that you only need one camera to clear it (the first one).
-
I put in the first camera (screen up) depth 0 and clear color red. I put the second camera (touch screen camera down) depth 1 and clear color blue. See the Editor image I attach. In the real device it showed exactly like the editor except there was no UI buttons, only blue.
Why doesnt it show the NGUI UI?
I attach the UI canvas settings and settings of one button?
I have no anchors.
Does it have to do with the NGUI custom atlas?
Thanks
-
I tried the lower screen (down) clear flag to depth only and place the camera on top of the first one but since the culling mask was only at the UI in the editor it showed only the buttons and no color under it. In the real device it behaves incorrectly. It does not show the buttons and it shows one part of the main camera even if I DONT include it in the culling mask of the camera, it should not show it.
-
It seems the camera down does not show the UI layer in the culling mask even if I set it to everything.
-
I am starting to believe that its a UI Atlas issue. I try to show my buttons in the top or bottom camera with no luck. It doesnt show anything.
-
Can I use NGUI somehow, with a patch without the custom ATLAS? I want to see if this is the problem and I cant just drop NGUI since I heavily use it in my game and it doesnt make sent to make it from scratch for Unity UI. Your help on this is appreciated... thanks
-
Atlas issue... hm. That might be a texture issue, not an atlas issue. What are the dimensions of your atlas? Make sure it's square. I know some mobile devices don't like rectangular assets. You can force the generation of a square asset in NGUI's atlas maker tool when using the custom packing mode.
You can use a UITexture or a UI2DSprite -- neither of them use NGUI's atlases. Simplest test case is ALT+SHIFT+T to create a UITexture, assign it a texture to work with and hit Play.
-
I tried all suggestion but none works. :(
I am trying to get NGUI to work more than 2 weeks now.
I will stop trying that and instead start porting my game to Unity UI.
Please inform your customers that it does not work in N3DS.