Jump to content

can we direct output of RenderFramework() to a color buffer?


deniz
 Share

Recommended Posts

Hi everyone,

 

is it possible to render to an offscreen render target (color buffer) using RenderFramework() command?

without this I have to render to the back-buffer, perform a buffer copy operation to render reflections in a mirror with effects.

I want to avoid that extra copy and also I want to be able to change the resolution of the color buffer as well..

Link to comment
Share on other sites

Certainly, but I don't recommend rendering to an extra image like a mirror with full effects enabled, since it will be much slower. I'd use minimum rendering, as demonstrated in the beginning tutorial, with shadows disabled.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Just do SetBuffer(your128x128buffer) before RenderFramework(), and of course SetBuffer(BackBuffer()) after that.

 

ok thanks, that worked..

it did not work before, may be I was doing something wrong.

Link to comment
Share on other sites

Certainly, but I don't recommend rendering to an extra image like a mirror with full effects enabled, since it will be much slower. I'd use minimum rendering, as demonstrated in the beginning tutorial, with shadows disabled.

 

I see.. I tried to do that by disabling all effects calling SetSSAO(0); SetHDR(0); etc.

but everytime I toggle the effects before and after calling RenderFramework(), a very very huge performance drop occurs (I get less than 1 fps)

I guess LE is trying to reload &/ reinitialize all related stuff (like shaders etc.) and this causes a huge performance drop.

 

if I try to use Renderworld() then I get another set of problems:

I cannot see the sky box, where there is a sun whose motion is determined by a Lua script.

(it is essentially the day-night script from one of the users' posts here in this forum, modified by my colleague to suit our needs).

I also see strange trails of rendered images from previous frames.

 

any clues how to overcome this?

Link to comment
Share on other sites

  • 2 weeks later...

Just do SetBuffer(your128x128buffer) before RenderFramework(), and of course SetBuffer(BackBuffer()) after that.

 

setting the buffer size to any size other than the back-buffer size seems to be problematic.

I get strange visual artifacts: whole screen becomes white and then the screen freezes.

any ideas?

Link to comment
Share on other sites

Framework is checking and deleting and recreating lots of stuff if they have changed since the last call to RenderFramework(), so this is probably why using a smaller buffer will cause also problems, since Framework doesn't fully handle the buffer change. I am using always the raw RenderWorld() command for extra buffers like mirrors, realtime cubemaps, rifle scopes, water and radar maps, since then Framework is not disturbed with constant buffer changes. It's more work to have all effects using RenderWorld(), but like Josh said, you don't even want all effects in those small extra buffers.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Yes, it's not meant to be used multiple times with different resolution buffers or different settings. If you change settings it will have to recreate buffers twice each frame.

 

Use regular plain rendering with just lighting, no shadows, for your low-res reflection passes.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • 2 weeks later...

Yes, it's not meant to be used multiple times with different resolution buffers or different settings. If you change settings it will have to recreate buffers twice each frame.

 

Use regular plain rendering with just lighting, no shadows, for your low-res reflection passes.

 

ok I get it.

But some script-based effects do not work with renderworld() command.

we have a day-night script that cannot be seen when using renderworld but is visible with renderframework.

how can I make that script visible with renderworld?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...