Sign in to follow this  
Getpsycho96

Switching between Projection to Ortho view for HUDs, menus etc.

Recommended Posts

Hey gamedev, im pretty new to this website and would like to thank anyone ahead of time for their help. Anyway, I was just curious if it would be faster to simply render a scene in 3D and place a game's HUD in front of the camera without having to switch to Ortho2D mode and render the menu then. Thanks for your time, Steven Ramirez

Share this post


Link to post
Share on other sites
If your menuing system isn't alpha blended, it's smarter to render your menu system FIRST, with depth testing and masking on. Remember, render each pixel only once. In addition, you don't have the overhead of billboarding or Orthographic projection matrix determination (or Ortho2D). If you want blended menus and systems, then yes. You're 100% right. It's easier and faster to billboard your menus rather than to Ortho2D, but not by much. I suspect in a real game, the difference might be noticable, but for kicks-and-giggles, they'd both be comparable.

I'd actually be interested to see the time differences between the two of them. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Nychold
If your menuing system isn't alpha blended, it's smarter to render your menu system FIRST, with depth testing and masking on. Remember, render each pixel only once. In addition, you don't have the overhead of billboarding or Orthographic projection matrix determination (or Ortho2D). If you want blended menus and systems, then yes. You're 100% right. It's easier and faster to billboard your menus rather than to Ortho2D, but not by much. I suspect in a real game, the difference might be noticable, but for kicks-and-giggles, they'd both be comparable.

I'd actually be interested to see the time differences between the two of them. :)


Hey Nychold, got some good points there. Well, the menu system I would like to do will probably end up using some alpha blending. I wanted to get a second opinion on how I should approach writing the menu draw calls. I guess billboarding is the way to go.

Thanks.

Share this post


Link to post
Share on other sites
There's no difference in the amount of work done in "3d mode" and "2d mode." The only thing that's different is the projection matrix you multiply everything with. You change the modelview matrix constantly over the course of a frame so you won't notice changing the projection matrix to an orthographic projection and then back once per frame. If you add billboarding then you're obviously doing more work.

Either way there probably won't be a speed difference because your bottleneck will most likely be somewhere else, so why not go for the easier option? It's much easier precisely positioning GUI elements in an orthographic projection than it is in a perspective projection.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kalidor
There's no difference in the amount of work done in "3d mode" and "2d mode." The only thing that's different is the projection matrix you multiply everything with. You change the modelview matrix constantly over the course of a frame so you won't notice changing the projection matrix to an orthographic projection and then back once per frame. If you add billboarding then you're obviously doing more work.

Either way there probably won't be a speed difference because your bottleneck will most likely be somewhere else, so why not go for the easier option? It's much easier precisely positioning GUI elements in an orthographic projection than it is in a perspective projection.


Going with the easier option is always a good idea. I can try to see if it will be any different in "2D mode" for a while until the game I am working on starts pick up pace. Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this