elecman
Topic Author
Posts: 90
Joined: 20 Jul 2014, 04:28

Occlusion and performance

17 Feb 2015, 07:27

What is best regarding performance when implementing a scrolling bar which is mostly occluded by a mask (layer)?

See the speed tape on the left, an altitude tape on the right, and a compass rose on the bottom:

Image

Animated in this video:
https://www.youtube.com/watch?v=ECV3IBkzZLc

If I make one huge bar with numbers and dashes, will it render the whole thing, even though most of it is occluded? I can make the bar much shorter and then reset the position at appropriate intervals to create the illusion of continuous movement. This would require re-using text boxes and changing the numbers, but it is achievable. Just more work.

Another related question:
Can all the dashes be batched into a single draw call?
 
User avatar
jsantos
Site Admin
Posts: 4186
Joined: 20 Jan 2012, 17:18
Contact:

Re: Occlusion and performance

17 Feb 2015, 15:44

If I make one huge bar with numbers and dashes, will it render the whole thing, even though most of it is occluded? I can make the bar much shorter and then reset the position at appropriate intervals to create the illusion of continuous movement. This would require re-using text boxes and changing the numbers, but it is achievable. Just more work.
Being all the elements in the huge bar probably the same draw call (it seems you are using solid colors) I would say that the masking mechanism implemented in the GPU using stencil is going to be fast enough. Anyway, you should benchmark it and see the results. If you need help, just share your numbers with us. Probably we can help.
Can all the dashes be batched into a single draw call?
Dashes are not different to the rest of element regarding batching. Rules described in the optimizing document apply to them. So for example, if all the dashes use solid colors, they will be grouped in the same drawcall.
 
elecman
Topic Author
Posts: 90
Joined: 20 Jul 2014, 04:28

Re: Occlusion and performance

23 Feb 2015, 06:51

Thanks, will do a benchmark and publish the results.

Also, I have some render textures which don't change much. Do I need to use a certain API to make sure it doesn't re-render the texture every frame, or is that done automatically?

Furthermore, I noticed this sentence on the perf page:
Use dictionaries to share resources whenever possible. This is an important factor to reduce memory but it is also important to reduce rendering performance because it allow us to improve batching.
Shouldn't that read "increase rendering performance" instead?
 
User avatar
jsantos
Site Admin
Posts: 4186
Joined: 20 Jan 2012, 17:18
Contact:

Re: Occlusion and performance

24 Feb 2015, 17:05

Also, I have some render textures which don't change much. Do I need to use a certain API to make sure it doesn't re-render the texture every frame, or is that done automatically?
Right now render textures are rendered on each frame but this could be improved. In fact, we are working in a dirty rects algorithm to generalize this and only redraw parts that changed (not only in render textures).

But I think that the first step (fully draw or not) can be easily done. Can you file a report please? (important: this won't be done for v1.2.0, where feature are closed)
Shouldn't that read "increase rendering performance" instead?
Yes, fixed. Thanks!
 
elecman
Topic Author
Posts: 90
Joined: 20 Jul 2014, 04:28

Re: Occlusion and performance

26 Feb 2015, 14:28

Ok, report filed :-)

Who is online

Users browsing this forum: No registered users and 3 guests