Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Quad), 748 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
recreate rendertargets #438521
03/16/14 13:46
03/16/14 13:46
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline OP
Expert
Kartoffel  Offline 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: Kartoffel] #438537
03/16/14 20:42
03/16/14 20:42
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Why would you need to recreate VIEWs? Replacing BMAPs should be enough.
Just have a loop which checks for a changed resolution, then iterate over your global view bitmap pointers and/ or view.bmap.


"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] #438538
03/16/14 20:51
03/16/14 20:51
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline OP
Expert
Kartoffel  Offline 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 Offline
Senior Expert
Superku  Offline
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:

Code:
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 Offline OP
Expert
Kartoffel  Offline 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
Re: recreate rendertargets [Re: Kartoffel] #438582
03/17/14 21:33
03/17/14 21:33
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
I know this should not really neccesary, but I use this to recreate render targets:

Code:
if(bmp_refraction!=NULL) //instead of (bmp_refraction)
{
   bmap_purge(bmp_refraction);
   ptr_remove(bmp_refraction);
}



Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1