Page 1 of 1

Implementation Guidelines for Render Targets

Posted: 02 Nov 2019, 23:50
by sunnlok
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?

Re: Implementation Guidelines for Render Targets

Posted: 04 Nov 2019, 03:36
by jsantos
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.

Re: Implementation Guidelines for Render Targets

Posted: 04 Nov 2019, 03:37
by jsantos
By the way, awesome that you are making progress with the CryEngine integration. Is this work happening in a public GitHub repository?

Re: Implementation Guidelines for Render Targets

Posted: 04 Nov 2019, 12:07
by sunnlok
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.

Re: Implementation Guidelines for Render Targets

Posted: 05 Nov 2019, 18:35
by jsantos
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.

Re: Implementation Guidelines for Render Targets

Posted: 05 Nov 2019, 20:28
by sunnlok
Thankfully i dont really need to worry about the state since cryengine handles that for me :D