Unit health bars with NoesisGUI
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:

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.

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.
Re: Unit health bars with NoesisGUI
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.
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.
-
-
sfernandez
Site Admin
- Posts: 2065
- Joined:
Re: Unit health bars with NoesisGUI
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
We did that when creating our plane cockpit video: viewtopic.php?f=12&t=380
Who is online
Users browsing this forum: No registered users and 2 guests