Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,561 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
bmap_rendertarget #253254
02/23/09 18:22
02/23/09 18:22
Joined: Apr 2008
Posts: 235
TEXCOORD3
Foxfire Offline OP
Member
Foxfire  Offline OP
Member

Joined: Apr 2008
Posts: 235
TEXCOORD3
hey,
I was wondering if you could elaborate a little bit about the bmap_rendertarget function. I can'st seem to get the render targets to preserve the content even when I set the 3rd paremeter to 1. please see my thread under A7 engine for more info: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=253136#Post253136

I would REALLY appreciate help - this is causing a complete stop in development of my Iridium plugin for GS. thanks in advance - Mike -


http://www.groundtacticsgame.com/
Alienware m17x R Custom laptop
specs:
Intel Core 2 Extreme Quad CPU Q9300
2x Nvidia 280GTX 2GB vram
6GB ddr3 memory@ 1333Mhz
512GB SSD
1200p 17' screen
runs Crysis Warhead on max settings at 1200p at 90 fps
Re: bmap_rendertarget [Re: Foxfire] #253373
02/24/09 12:56
02/24/09 12:56
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
"Preserving the content" means the content that the bitmap previously had before it was used as a rendertarget. This is used for one-time rendering an object into an already existing scene, but is probably not what you attempt to do. What content do you want to preserve?

Re: bmap_rendertarget [Re: jcl] #253573
02/25/09 15:12
02/25/09 15:12
Joined: Apr 2008
Posts: 235
TEXCOORD3
Foxfire Offline OP
Member
Foxfire  Offline OP
Member

Joined: Apr 2008
Posts: 235
TEXCOORD3
ok, to be more precise I will explain the actual situation:
so each frame is defined as rendering the camera and all following views (in my code).
Each frame, I first render into the camera's bmap and 2 other render targets. After I render other views. HOWEVER, I want to keep the rendered images from the camera's bmaps (both the .bmap and the rendertargets). So basically, I want the rendertarget bmaps to always store ONLY the camera's color0 through color2 data and not update with the following views (but I must be able to retrieve the data in the following view's shaders).

I want to preserve the render target bmaps from the camera rendering stage.


http://www.groundtacticsgame.com/
Alienware m17x R Custom laptop
specs:
Intel Core 2 Extreme Quad CPU Q9300
2x Nvidia 280GTX 2GB vram
6GB ddr3 memory@ 1333Mhz
512GB SSD
1200p 17' screen
runs Crysis Warhead on max settings at 1200p at 90 fps
Re: bmap_rendertarget [Re: Foxfire] #253578
02/25/09 15:27
02/25/09 15:27
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
The rendertargets are only rendered into when you use the COLOR1..COLOR3 semantics in a shader in that particular view. When you don't use them, the render targets are supposed to preserve their content until it's rendered into them again.

Re: bmap_rendertarget [Re: jcl] #253583
02/25/09 16:11
02/25/09 16:11
Joined: Apr 2008
Posts: 235
TEXCOORD3
Foxfire Offline OP
Member
Foxfire  Offline OP
Member

Joined: Apr 2008
Posts: 235
TEXCOORD3
when I use a view with VISIBLE set following the camera, the view overwrites the rendertargets even when I set the views to a pixel shader that only outputs to the COLOR0 semantic. Maybe this is a problem?

It seems that each view that renders (VISIBLE) renders into the rendertargets regardless of whether I create the COLOR1,2,3,etc semantics or not. This is not a problem with post processing views though. -Mike-


http://www.groundtacticsgame.com/
Alienware m17x R Custom laptop
specs:
Intel Core 2 Extreme Quad CPU Q9300
2x Nvidia 280GTX 2GB vram
6GB ddr3 memory@ 1333Mhz
512GB SSD
1200p 17' screen
runs Crysis Warhead on max settings at 1200p at 90 fps
Re: bmap_rendertarget [Re: Foxfire] #253708
02/26/09 07:34
02/26/09 07:34
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
Hmm, the render targets should only react on the color number that you set in the call. Rendering in COLOR0 must only affect render target number 0... except when you have a hardware that does not support multiple targets. But then the engine should give you an error message. Can you upload or send a project where the problem is visible? We'll check.

Re: bmap_rendertarget [Re: jcl] #253801
02/26/09 22:58
02/26/09 22:58
Joined: Apr 2008
Posts: 235
TEXCOORD3
Foxfire Offline OP
Member
Foxfire  Offline OP
Member

Joined: Apr 2008
Posts: 235
TEXCOORD3
hey,
Thank you so much for taking your time to look at this problem. I have fought this for a long time however it IS possible that I'm just doing something stupid. here is the link to a project I made specifically for you to examine:
http://www.megaupload.com/?d=PH9H8KMY

whats in it:
the program is inside, run it and press 0 and move the camera.
what you should see:
there should be 4 quadrants: the upper left is the light1 render target (see code for details)
the lower left is the camera color render target
the upper right is the camera scene normals render target
the lower right is the camera scene depth render target

to experience my problem, toggle between the k and l keys to switch the stages. When you press l, the right two render targets should become blank. This is because the stages are switched so that the light1 view renders AFTER the camera and seems to override/erase the render targets (the fx file does NOT write to any other semantic other than COLOR0).

I forgot to upload the source: mrt_test.c I'll do this in a sec - thank you very much!


http://www.groundtacticsgame.com/
Alienware m17x R Custom laptop
specs:
Intel Core 2 Extreme Quad CPU Q9300
2x Nvidia 280GTX 2GB vram
6GB ddr3 memory@ 1333Mhz
512GB SSD
1200p 17' screen
runs Crysis Warhead on max settings at 1200p at 90 fps
Re: bmap_rendertarget [Re: Foxfire] #253802
02/26/09 22:59
02/26/09 22:59
Joined: Apr 2008
Posts: 235
TEXCOORD3
Foxfire Offline OP
Member
Foxfire  Offline OP
Member

Joined: Apr 2008
Posts: 235
TEXCOORD3
here is the .c source code:
http://www.megaupload.com/?d=NZW5ERWU


http://www.groundtacticsgame.com/
Alienware m17x R Custom laptop
specs:
Intel Core 2 Extreme Quad CPU Q9300
2x Nvidia 280GTX 2GB vram
6GB ddr3 memory@ 1333Mhz
512GB SSD
1200p 17' screen
runs Crysis Warhead on max settings at 1200p at 90 fps
Re: bmap_rendertarget [Re: Foxfire] #253830
02/27/09 07:46
02/27/09 07:46
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
Ok, I'll download it and look into it. I can't do it right now, but will check the project someday next week.

Re: bmap_rendertarget [Re: jcl] #254941
03/06/09 14:58
03/06/09 14:58
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
The problem was that the rendertargets were cleared with the sky color at the begin of a view render cycle, just like the normal screen. I found that the DirectX Clear function affects all color targets, not only COLOR0.

I'll mention this in the manual. Simple solution: Either don't clear them,

vec_set(sky_color,vector(0,0,0));

or disable the render targets with a view event when the view should not write into them.

Page 1 of 2 1 2

Moderated by  old_bill, Tobias 

Gamestudio download | 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