Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
PostProcessing Effect Chaining question #182595
02/07/08 19:46
02/07/08 19:46
Joined: Feb 2002
Posts: 357
Florida
Zelek Offline OP
Senior Member
Zelek  Offline OP
Senior Member

Joined: Feb 2002
Posts: 357
Florida
I am applying a series of PostProcessing effects, and after the last effect, I have a black and white image. What I would like to do is store the rgb values of the frame before any effects are applied, and then access those values for use in an additional effect at the very end of the chain. Is this possible? If so, how would I go about it?

To phrase it another way, I would like to have a sort of tree structure for my post-processing effects. Perhaps one branch would apply a sobel filter, which would find edges but lose color information, while another branch would do a color shift. After both were done, I would merge the two results to create the final frame. Is this supported in some manner?

Re: PostProcessing Effect Chaining question [Re: Zelek] #182596
02/07/08 19:50
02/07/08 19:50
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Just render it into a texture (stage_view.bmap = bmap_ptr;) which you then put back into the scene as a materialskin later on.

Re: PostProcessing Effect Chaining question [Re: Slin] #182597
02/08/08 00:14
02/08/08 00:14
Joined: Feb 2002
Posts: 357
Florida
Zelek Offline OP
Senior Member
Zelek  Offline OP
Senior Member

Joined: Feb 2002
Posts: 357
Florida
It almost seems like the camera stages could directly support what I want. If you could somehow have the views diverge into two branches, and then merge the branches back in the final stage...

Maybe I'm just talking out of my butt. Has anyone tried this, or seen something similar done?

Re: PostProcessing Effect Chaining question [Re: Zelek] #182598
02/08/08 15:56
02/08/08 15:56
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
why so complicated?
just do it as slin said. its really easy

Code:
BMAP* firstScreen;

[...]

camera.bmap = firstScreen;
camera.stage = greatPPview;



Re: PostProcessing Effect Chaining question [Re: Scorpion] #182599
02/08/08 17:54
02/08/08 17:54
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
splitting is done as scorpion mentionned. joining by setting the split bmap as skin parameter for the joining material.

Re: PostProcessing Effect Chaining question [Re: Joey] #182600
02/08/08 23:40
02/08/08 23:40
Joined: Feb 2002
Posts: 357
Florida
Zelek Offline OP
Senior Member
Zelek  Offline OP
Senior Member

Joined: Feb 2002
Posts: 357
Florida
Thank you guys for your help, I really appreciate it. I think I'm almost there (I'm pretty new to shader programming). Here's my current process:

Code:

//bmap for the unprocessed screen
BMAP* firstScreen;
// a postprocessing view
VIEW* postprocessor1 = { material = mtl_pp_1; flags = CHILD | PROCESS_TARGET; }
...

//in main
camera.bmap = firstScreen;
camera.stage = postprocessor1;
mtl_pp_1.skin1 = firstScreen;

...

//in the .fx file
Texture mtlSkin1;
sampler2D mtl_sampler = sampler_state { texture = <mtlSkin1>; };

float4 pp_effect( float2 Tex : TEXCOORD0 ) : COLOR0 {
float3 Color = tex2D(mtl_sampler, Tex.xy).xyz;
return float4(Color,1.);
}



This should simply display the saved bmap, but instead gives an entirely black screen. I assume mtl_sampler is empty. Where might I be going wrong?

Re: PostProcessing Effect Chaining question [Re: Zelek] #182601
02/09/08 23:54
02/09/08 23:54
Joined: Feb 2002
Posts: 357
Florida
Zelek Offline OP
Senior Member
Zelek  Offline OP
Senior Member

Joined: Feb 2002
Posts: 357
Florida
I found what I was missing

firstScreen = bmap_createblack(1024, 768, 24);

Thanks for your help guys, you're awesome.


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