derkork
Topic Author
Posts: 1
Joined: 18 Feb 2018, 11:27

Unit health bars with NoesisGUI

18 Feb 2018, 13:06

I'm currently evaluating if we could use NoesisGUI for a RTS game. In this kind of games you have unit health bars which are rendered in world space and use billboarding to always face the camera. In a very simple case this could be just a plain quad texture however we plan on having some more complex health bars, which contain text and additional information, e.g. like these:

Image

We use the Unity game engine for building our game. From what we gather from the documentation NoesisGUI renders either on top of a camera (screen space overlay) or into a render texture that could be put on a quad in world space. So in theory I could create a render texture per unit, let Noesis render our complex unit health bar into that and then render this on the quad in world space which billboards to the camera. However, having potentially a few hundred units on screen, I'm concerned about the performance implications of having Noesis render to hundreds of little render textures. Also I would need to have a way of culling out units that are offscreen, so Noesis would not have to render the UI for them.

I couldn't find anything in the documentation on how to approach this, so I wonder if Noesis would be a good fit to draw lots of little world space UI elements like this and if so how this could be done in an efficient way.
 
User avatar
jsantos
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18
Contact:

Re: Unit health bars with NoesisGUI

21 Feb 2018, 12:31

Are those unit health bars really in world space? I mean, do they get smaller as the go farther?

I do not recommend the render texture approach because as you mention, you are going to need a lot of textures and the performance is probably going to suffer a bit (maybe not...). What I would do is just rendering the quads on top of the camera, just project the 3D point of the unit to the screen and just draw the 2D quad there. That way, you only have one XAML. If the quads needs to get smaller in 3D, then you can also apply a projection matrix to each of them.

This is definitely a good idea for one of our next public samples.
 
User avatar
sfernandez
Site Admin
Posts: 1912
Joined: 22 Dec 2011, 19:20

Re: Unit health bars with NoesisGUI

21 Feb 2018, 12:44

If you still want to pursue the option of rendering in 3D, you can have a single NoesisView rendering to a RenderTexture ALL the life bars and info, and use that as an atlas texture that you can set as source for the meshes you will render in 3D with the appropriate UV coordinates.

We did that when creating our plane cockpit video: viewtopic.php?f=12&t=380

Who is online

Users browsing this forum: Google [Bot] and 1 guest