Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: SeanP on April 23, 2012, 12:40:03 PM
-
I noticed that while using ui cameras, I am not getting any of my image effects on the main camera, it seems I have to make the main camera the highest depth, currently my main cam is -1, 3D NGUI cam dept 0 and 2D NGUI Cam depth 1, is there any solution for this?
-
Through testing I've found that it seems to just be the 3D cam that is causing the issue,
its setup like this.
http://i.imgur.com/ssSXm.png
our main camera is set up like this.
http://i.imgur.com/IT20U.png
any help would be awesome.
Edit:
I figured it out, if I just add my image effects to the 3D Camera it applies to the camera below.
-
Yeah the last camera needs to be the one with the effects as it will apply them to everything leading up to it.
Btw... near/far ratio of 1:400,000 is massive and will result in some serious depth fighting issues. You might want to fix that.
What I did in the space game starter kit is to have a "distant objects" camera which is used to draw planets, and the normal game camera is used to draw the game items. I first draw the planets with the distant camera, then game objects with the game camera. The distant camera travels at a much reduced speed as well, and always stays relative to the player.
-
So what's the setup for this with regards to an FPS game? I can't get SSAO working.
I have the default FPS camera and UI Root (3D)
- Player
-- Main Camera (Depth 0)
- UI Root (3D)
-- Camera (Depth 2)
--- ...
-
SSAO requires a depth buffer, so it will only function on whatever camera actually fills it, such as your game camera. Anything drawn before or after it (such as your UI camera) won't write to the depth buffer and thus won't work.
-
Are you saying it's impossible to have if you use NGUI? I can get it if the depth is higher, but no ngui...
I even tried a seperate camera just for drawing the SSAO but I don't think I'm doing it right.
-
Sure it's possible. Just put the SSAO effect on your game camera. Your UI camera shouldn't have anything on it.
-
It was always on the game camera. The GUI "Camera" is drawing just the GUI_Layer and has no image effects
The Main Camera isn't drawing the GUI_Layer. It has SSAO/Vignette/HDR/etc components. None of them work.
-
Then image effects are not supported on your target platform.
Image effects have nothing to do with NGUI and work fine as long as they are on the correct camera. I use them in Windward myself (fog of war and grayscale, for example).
-
My target platform is Windows.
Note: NGUI > Create a New UI > GUI_Layer/Advanced 3D makes the effects disappear, Simple 2D doesn't.
-
Works fine here. Are you sure you're not forgetting to choose a UI layer prior to creating your 3D UI? If both your game camera and your 3D UI camera use the default layer, you may run into issues.
-
Here's a video of it: http://youtu.be/WJu3Bx6X1oE
I forgot to record the mouse movement.
-
Well, don't know what to tell you. It works fine when I do it here, as evident by my picture. I follow the same steps, and my SSAO works fine. The only thing different is my depth precision is a lot higher. Yours is 0.02:1000, which is 1:50,000. I recommend keeping that below 1:300. Other than that I'm at a loss as to what you're doing different.
P.S. Forward or deferred rendering mode? I use forward here.
-
Ahh yes it was because I was in deferred mode. It works in forward. I have the paid version and from searching I hear it's supposed to work in deferred too?
-
Yup, and it does. Force the GUI camera to use forward rendering.