Daki
Topic Author
Posts: 57
Joined: 16 Aug 2013, 00:48

Render to Texture (Native)

27 Apr 2014, 05:14

To improve performance I am looking to render chunks of my UI to a texture, and then render that texture in lieu of the UI. I want to investigate this route because much of my UI doesn't change between frames and uses vectors, transparent elements, fonts, 3D transforms, etc. I am using vectors because the resolution can vary based on user settings.

Is there a sample that illustrates the steps for accomplishing this using Noesis - giving Noesis a separate render target bound to some buffer that can be set on an image in the UI? I'm familiar with setting the contents of a buffer on an image (http://www.noesisengine.com/docs/Gui.Co ... orial.html) and while I believe there is a Unity sample for rendering to a texture I am using the native library and I am not sure how to set this up.

I am generally familiar with the concepts involved here (I have written logic in the past to render to textures in OpenGL), but I am unsure of how to perform the same tasks using Noesis, and how to render only specific elements of a UI hierarchy, like only one canvas and all its children for example.
 
User avatar
jsantos
Site Admin
Posts: 2900
Joined: 20 Jan 2012, 17:18
Contact:

Re: Render to Texture (Native)

28 Apr 2014, 10:25

Hi!

How urgent is this for you? Because one of the things we want to implement in the v1.2.x is incremental rendering that only renders dirty rects each frame.

It is very easy rendering a xaml to a render texture. In fact, it is the same as rendering to the main screen but you have to bind the corresponding FBO. That part is easy but rendering only a subset is more complicated. You could create several XAMLs for each part. That could work.

By the way, how many milliseconds does it take to render the GUI in your game?
 
Daki
Topic Author
Posts: 57
Joined: 16 Aug 2013, 00:48

Re: Render to Texture (Native)

29 Apr 2014, 04:34

It is not the most pressing item on my table when it comes to optimizing my game.

Actually when refactoring a bit of my performance timer code to get you a current value for Noesis render times I realized I was incorrectly attributing some 3D render time to that category. I'll have to play around with it a bit more to get an accurate value but this is just further emphasizing that my real bottleneck is 3D so I'm going to be focusing my efforts there.

If in the future I want to further optimize 2D I'll see where things are with your incremental rendering and look at caching chunks by splitting the xamls.
 
User avatar
jsantos
Site Admin
Posts: 2900
Joined: 20 Jan 2012, 17:18
Contact:

Re: Render to Texture (Native)

30 Apr 2014, 14:51

Remember that you can get performance numbers directly from XamlPlayer (hitting F2):
  • Milliseconds spent in the sync part of Update
  • Milliseconds spent in the async part of Update
  • Milliseconds spent sending commands to the GPU
  • Milliseconds spent in the GPU (this one is usually the bottleneck if everything is right)

Who is online

Users browsing this forum: No registered users and 0 guests