sunnlok
Topic Author
Posts: 30
Joined: 04 Jul 2017, 17:45

Implementation Guidelines for Render Targets

02 Nov 2019, 23:50

Hey,
I am currently making progress with my CryEngine implementation for noesis (the rendering architecture actually fits quite nicely with CryEngines render passes), but i am wondering when exactly render targets are set while rendering a certain view. So far render offscreen etc. are called but no call to create or set render target is made. Do i need to do this manually?
Just wondering if there is a preffered way, otherwise i will just set a render target per view manually and compose on the final pass :D

Edit:
After looking at it with renderdoc the sample xaml i picked doesnt seem to render anything off-screen. So the general assumption is that you render to the main rendertarget if no other is specified?
If thats the case i will default create a render target per created view. Unless those also get combined onto one render target?
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Implementation Guidelines for Render Targets

04 Nov 2019, 03:36

We try to avoid offscreen textures to avoid changing render targets and be more efficient whenever possible, but in case an offscreen is needed it is setup internally at the offscreen phase. For the main render, you need to setup the framebuffer and viewport externally, we expect that to be properly setup.

IntegrationGLUT sample is the best place to learn how a simple integration works.
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Implementation Guidelines for Render Targets

04 Nov 2019, 03:37

By the way, awesome that you are making progress with the CryEngine integration. Is this work happening in a public GitHub repository?
 
sunnlok
Topic Author
Posts: 30
Joined: 04 Jul 2017, 17:45

Re: Implementation Guidelines for Render Targets

04 Nov 2019, 12:07

Hmm...ok. So i will just render the output onto the main swapchain image if no render target is specified, but give the user the option to set one on their own on a per NoesisView basis.
Should i also check the NeedsOffscreen boolean on the renderer first before calling render offscreen?
Yes the implementation will be on github once i have got it displaying something :D ... sadly it requires some additions to the renderer dll from my ce fork which expose the pass and draw functionality via a public api. For users who wont compile their own ce versions that would require replacing the CryRenderer11/12/vulkan whatever dll.
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Implementation Guidelines for Render Targets

05 Nov 2019, 18:35

Should i also check the NeedsOffscreen boolean on the renderer first before calling render offscreen?
That boolean indicates you if calling RenderOffscreen() is necessary or not. As RenderOffscreen() can change the device state, you can avoid restoring the state if you don't invoke it. Probably we will deprecate that function in the future and RenderOffscreen() will return a boolean to indicate the same thing.
 
sunnlok
Topic Author
Posts: 30
Joined: 04 Jul 2017, 17:45

Re: Implementation Guidelines for Render Targets

05 Nov 2019, 20:28

Thankfully i dont really need to worry about the state since cryengine handles that for me :D

Who is online

Users browsing this forum: No registered users and 73 guests