Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (7th_zorro), 1,390 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 5 1 2 3 4 5
pp bloom in gamestudio #169215
11/24/07 13:44
11/24/07 13:44
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline OP
Serious User
Scorpion  Offline OP
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
Here i wrote some post processing shaders, which become combined a bloom effect.

1. The normal screen is rendered


2. All Pixels are darker then a specific value become black


3.Vertical Blur


4.Horizontal Blur


3.The pixel value of this picture is now added to the orginal picture + some color corrections


Hope you like it :]

PS: that white thing is a unskinned goblet test model^^

Re: pp bloom in gamestudio [Re: Scorpion] #169216
11/24/07 14:47
11/24/07 14:47
Joined: Jun 2005
Posts: 4,875
broozar Offline
Expert
broozar  Offline
Expert

Joined: Jun 2005
Posts: 4,875
code! code! code! only for a7 and a6 pro with rtt? or a6 comm as well (yummie!)?

Re: pp bloom in gamestudio [Re: broozar] #169217
11/24/07 15:05
11/24/07 15:05
Joined: Sep 2002
Posts: 1,181
germany
E
Endgegner Offline
Serious User
Endgegner  Offline
Serious User
E

Joined: Sep 2002
Posts: 1,181
germany
Nice stuff =). By the way, is this how "real" bloom shaders work?

Re: pp bloom in gamestudio [Re: Endgegner] #169218
11/24/07 15:19
11/24/07 15:19
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Nothing special, but looks good

@Endgegner: I think that this is how bloom works.

Just have a look at the wiki. I added a bloom shader there. It does everything in one stage which causes lower quality but makes it easier to use it without the latest beta version of A7.

Re: pp bloom in gamestudio [Re: Slin] #169219
11/24/07 15:24
11/24/07 15:24
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline OP
Serious User
Scorpion  Offline OP
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
it's how "real" bloom works

I tried out the new pp-feature with view of the latest A7-beta, so not everyone can really use that code

Code:
BMAP* FirstScreen = "#1024x768x32";

var blurStrongness = 40;
var blurRadius = 0.3;
var blurAlpha = 40;
var darken = 90;
var greyOut = 90;

MATERIAL* mtlBlackout =
{
effect = "
Texture TargetMap;
sampler2D smpSource = sampler_state { texture = <TargetMap>; };
float4 vecViewPort; // contains viewport pixel size in zw components
float4 vecSkill1;
float4 BlackoutPS( float2 Tex : TEXCOORD0 ) : COLOR0
{
float4 Color = tex2D(smpSource,Tex.xy-vecViewPort.zw);
if((Color.r+Color.g+Color.b)/3<vecSkill1.x)
{
Color.rgb = 0;
}
return Color;
}

technique emboss { pass one { PixelShader = compile ps_2_0 BlackoutPS(); } }
technique fallback { pass one { } }";
}

MATERIAL* mtlBlurH =
{
effect = "
float4 vecViewPort;
float4 vecSkill1;
static int blurRadius = 5;//number of px

Texture TargetMap;
sampler2D smpSource = sampler_state{texture=<TargetMap>;};

float4 BlurHPS( float2 Tex: TEXCOORD0):COLOR0
{
float4 Color = tex2D(smpSource,Tex.xy-vecViewPort.zw);
float2 tempTex;
tempTex.y = Tex.y;
for(int i=-blurRadius;i<=blurRadius;i++)
{
tempTex.x = Tex.x+i*vecSkill1;
Color += tex2D(smpSource,tempTex.xy-vecViewPort.zw);
}
return Color/(blurRadius*2+1);
}

technique Blackout { pass one { PixelShader = compile ps_2_0 BlurHPS();}}
technique fallback { pass one { } }";
}

MATERIAL* mtlBlurV =
{
effect = "
float4 vecViewPort;
float4 vecSkill1;
static int blurRadius = 5;//number of px

Texture TargetMap;
sampler2D smpSource = sampler_state{texture=<TargetMap>;};

float4 BlurVPS( float2 Tex: TEXCOORD0):COLOR0
{
float4 Color = tex2D(smpSource,Tex.xy-vecViewPort.zw);
float2 tempTex;
tempTex.x = Tex.x;
for(int i=-blurRadius;i<=blurRadius;i++)
{
tempTex.y = Tex.y+i*vecSkill1.x;
Color += tex2D(smpSource,tempTex.xy-vecViewPort.zw);
}
return Color/(blurRadius*2+1);
}

technique Blackout { pass one { PixelShader = compile ps_2_0 BlurVPS();}}
technique fallback { pass one { } }";
}

MATERIAL* mtlAdd =
{
skin1 = FirstScreen;
effect = "
float4 vecViewPort;
float4 vecSkill1;

Texture TargetMap;
Texture mtlSkin1;
sampler2D smpSource = sampler_state{texture=<TargetMap>;};
sampler2D firstScreen = sampler_state{texture=<mtlSkin1>;};

float4 AddPS( float2 Tex: TEXCOORD0):COLOR0
{
float4 Color = tex2D(firstScreen,Tex);
Color += vecSkill1.x*tex2D(smpSource,Tex);
return lerp(Color,(Color.r+Color.g+Color.b)/3,vecSkill1.z)*vecSkill1.y;
}
technique Blackout { pass one { PixelShader = compile ps_2_0 AddPS();}}
technique fallback { pass one { } }";
}

VIEW* viewBlackout = { material = mtlBlackout; flags = PROCESS_TARGET; }
VIEW* viewBlurH = { material = mtlBlurH; flags=PROCESS_TARGET;}
VIEW* viewBlurV = { material = mtlBlurV; flags=PROCESS_TARGET;}
VIEW* viewAdd = { material = mtlAdd; flags=PROCESS_TARGET;}

void controlBloomSettings()
{
camera.bmap = FirstScreen;
camera.stage = viewBlackout;
viewBlackout.stage = viewBlurH;
viewBlurH.stage = viewBlurV;
viewBlurV.stage = viewAdd;
while(1)
{
mtlBlackout.skill1 = floatv((100-blurStrongness)/100);
mtlBlurH.skill1 = floatv(blurRadius/100);
mtlBlurV.skill1 = floatv(blurRadius/100);
mtlAdd.skill1 = floatv(blurAlpha/100);
mtlAdd.skill2 = floatv(darken/100);
mtlAdd.skill3 = floatv((100-greyOut)/100);
wait(1);
}
}


PS: I use vars, because only then the panel elements show right results...

Re: pp bloom in gamestudio [Re: Scorpion] #169220
11/24/07 15:57
11/24/07 15:57
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline
Expert
mpdeveloper_B  Offline
Expert

Joined: Feb 2006
Posts: 2,185
wow, this is a real bloom shader, finally someone made one, also, is it possible to convert this to a6 code?


- aka Manslayer101
Re: pp bloom in gamestudio [Re: mpdeveloper_B] #169221
11/24/07 16:34
11/24/07 16:34
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline OP
Serious User
Scorpion  Offline OP
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
no, not without a dll or sth.

Re: pp bloom in gamestudio [Re: Scorpion] #169222
11/24/07 17:32
11/24/07 17:32
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline
Expert
mpdeveloper_B  Offline
Expert

Joined: Feb 2006
Posts: 2,185
k, thanks


- aka Manslayer101
Re: pp bloom in gamestudio [Re: mpdeveloper_B] #169223
11/24/07 18:23
11/24/07 18:23
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Very nice! I hope JCL releases a public version before Christmas..

Re: pp bloom in gamestudio [Re: HeelX] #169224
11/24/07 19:05
11/24/07 19:05
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Interesting concept Shorpion
This really encourages me to update asap to A7 commercial, but I'm waiting untill most issue are cleared out

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Page 1 of 5 1 2 3 4 5

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