2 registered members (AndrewAMD, Quad),
748
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
recreate rendertargets
#438521
03/16/14 13:46
03/16/14 13:46
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
OP
Expert
|
OP
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
hey there,
I'm having trouble removing and recreating all the VIEWs and BMAPs in my postprocessing chain. (needed when changing the resolution or quality settings, for example)
Can anyone show me how to properly do this?
POTATO-MAN saves the day! - Random
|
|
|
Re: recreate rendertargets
[Re: Superku]
#438538
03/16/14 20:51
03/16/14 20:51
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
OP
Expert
|
OP
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
first of all, thanks for the reply. I need to re-setup the whole pipeline because not all shaders (or different shaders) are used on lower quality settings.
Also it'd be great if you could provide a code example.
regards, Kartoffel
POTATO-MAN saves the day! - Random
|
|
|
Re: recreate rendertargets
[Re: Kartoffel]
#438539
03/16/14 21:21
03/16/14 21:21
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
I see. I have a function called update_view_stages() where I simply set or remove views from the render chain based on two if/ else cases (manually, pre-defined views) which gets called when a graphics option gets changed. Then I have a while loop which sets and updates some effects based on variables and it recreates bitmaps automatically like this:
if(old_size_x != screen_size.x || old_size_y != screen_size.y)
{
old_size_x = screen_size.x;
old_size_y = screen_size.y;
if(bmp_refraction) ptr_remove(bmp_refraction);
bmp_refraction = bmap_createblack(screen_size.x, screen_size.y, 24);
...
}
There are certainly better ways to do this but as I don't have that many graphics options and because I use global bitmap pointers this works just fine for me.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: recreate rendertargets
[Re: Superku]
#438554
03/17/14 14:01
03/17/14 14:01
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
OP
Expert
|
OP
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
that's wired, I use ptr_remove and bmap_createblack aswell, but after resetting the chain a couple of times I get a directx error...
maybe I forgot a rendertarget, I'll have a look
POTATO-MAN saves the day! - Random
|
|
|
|