Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
2 registered members (Ayumi, alibaba), 704 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
lorikob361, LucasJoshua, Baklazhan, Hanky27, firatv
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 4 of 4 1 2 3 4
Re: [Free]The Postprocessing Collection [Re: Felixsg] #155140
11/18/07 00:26
11/18/07 00:26
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Thank you very much for your efforts!

Re: [Free]The Postprocessing Collection [Re: Pappenheimer] #155141
11/21/07 04:30
11/21/07 04:30
Joined: Sep 2007
Posts: 4
nauht Offline
Guest
nauht  Offline
Guest

Joined: Sep 2007
Posts: 4
Hi,

I'm trying to add this to my own project with A7. I've converted the CScript code to lite-C and I noticed that when I try to enable the effects, the framerate drops but the effects don't show up? Here's my code:

PP_Effects.c:
Code:

#include "main.h"

// Blur in all directions (Lowquality)
MATERIAL* SimpleBlur_mat =
{
effect = "simpleBlur.fx";
}

function SimpleBlur_set_Value(Blur)
{
SimpleBlur_mat.skill1 = floatv(Blur); // should be higher than 1
}


// Blur in all directions (Highquality)
MATERIAL* ComplexBlur_mat =
{
effect = "complex_blur.fx";
}

function ComplexBlur_set_Value(Blur)
{
ComplexBlur_mat.skill1 = floatv(Blur); // should be very small between 0.001 and 0.05
}



PP_Main.c:
Code:


#include "PP_Effects.c"

VIEW* PP_Cam;

BMAP* ppe_quad = "graphics/PPE_Quad.tga";

ENTITY* PP_Quad =
{
type = ppe_quad;
layer = 1;
view = camera;
flags = VISIBLE;
x = 10;
y = 0;
z = 0;

scale_x = 1;
scale_y = 1;
}

function PP_Init_startup()
{
PP_Cam = view_create(1);
PP_Cam.bmap = bmap_for_entity(PP_Quad,0);
}

function PP_Init_Effect()
{
PP_Quad.material = ComplexBlur_mat;//Change this to the material you wish<---------------------------
ComplexBlur_set_Value(9.0); //Call here the function to set the materials values<-------------


}

function PP_Toggle_OnOff()
{
if(PP_Quad.flags & VISIBLE)
{
PP_Cam.flags &= ~VISIBLE;
PP_Quad.flags &= ~VISIBLE;
}else
{
camera.flags |= VISIBLE;
PP_Cam.flags |= VISIBLE;
PP_Quad.flags |= VISIBLE;

while(PP_Quad.flags & VISIBLE)
{
vec_set(PP_Cam.x,camera.x);
vec_set(PP_Cam.pan,camera.pan);
wait(1);
}
}
}



And in main.c I added:
Code:

PP_Init_Effect();
PP_Toggle_OnOff();
on_z = PP_Toggle_OnOff;



Thans.

Re: [Free]The Postprocessing Collection [Re: Slin] #155142
11/21/07 06:18
11/21/07 06:18
Joined: Jul 2007
Posts: 50
N
Nomad Offline
Junior Member
Nomad  Offline
Junior Member
N

Joined: Jul 2007
Posts: 50
Hey thanks, be able to look at shaders now

Re: [Free]The Postprocessing Collection [Re: Nomad] #155143
11/22/07 12:16
11/22/07 12:16
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline
User
DavidLancaster  Offline
User

Joined: Nov 2004
Posts: 862
Australia
Would anyone happen to know how to stop the bloom shader affect the fog less? At the moment applying bloom with fog seems to intensify the bloom alot and I don't know how to stop it. Any ideas?

Code:

//////////////////////////////////////
/////////////Bloom Effect/////////////
//////////////////////////////////////
//////based on the Sylex 3 Bloom//////
//////////wich was written////////////
////////////////by////////////////////
///////Sebastian Leopold (XeXeS)//////
//////////////////////////////////////

float4 vecSkill1;

texture entSkin1;

sampler postTex = sampler_state
{
texture = (entSkin1);
MinFilter = linear;
MagFilter = linear;
MipFilter = linear;
AddressU = Clamp;
AddressV = Clamp;
};

float Luminance = 0.08f;
static const float fMiddleGray = 0.18f;
static const float fWhiteCutoff = 0.8f;

#define NUM 13

float2 PixelOffsets[NUM] =
{
{ -0.006, -0.006 },
{ -0.005, -0.005 },
{ -0.004, -0.004 },
{ -0.003, -0.003 },
{ -0.002, -0.002 },
{ -0.001, -0.001 },
{ 0.000, 0.000 },
{ 0.001, 0.001 },
{ 0.002, 0.002 },
{ 0.003, 0.003 },
{ 0.004, 0.004 },
{ 0.005, 0.005 },
{ 0.006, 0.006 },
};

static const float BlurWeights[NUM] =
{
0.002216,
0.008764,
0.026995,
0.064759,
0.120985,
0.176033,
0.199471,
0.176033,
0.120985,
0.064759,
0.026995,
0.008764,
0.002216,
};

float4 Bloom_PS_3_0(float2 texcoord0 : TEXCOORD0) : COLOR
{
float3 pixel;
float3 Color = 0;

for(int i = 0; i < NUM; i++)
{
pixel = tex2D(postTex,texcoord0 + PixelOffsets[i] * 5.0f)+vecSkill1[1];

pixel *= fMiddleGray / (Luminance + 0.001f);
pixel *= (1.0f + (pixel / (fWhiteCutoff * fWhiteCutoff)));
pixel -= 5.0f;

pixel = max(pixel,0.0f);
pixel /= (10.0f + pixel);

Color += pixel * BlurWeights[i];
}

Color *= vecSkill1[0];

return float4(Color,1.0) + tex2D(postTex,texcoord0);
}

float4 Bloom_PS_2_0(float2 texcoord0 : TEXCOORD0) : COLOR
{
float3 pixel;
float3 Color = 0;

for(int i = 4; i < 9; i++)
{
pixel = tex2D(postTex,texcoord0 + PixelOffsets[i] * 5.0f)+vecSkill1[1];

pixel *= fMiddleGray / (Luminance + 0.001f);
pixel *= (1.0f + (pixel / (fWhiteCutoff * fWhiteCutoff)));
pixel -= 5.0f;

pixel = max(pixel,0.0f);
pixel /= (10.0f + pixel);

Color += pixel * BlurWeights[i];
}

Color *= vecSkill1[0];

return float4(Color,1.0) + tex2D(postTex,texcoord0);
}


technique tech_00
{
pass pass_00
{
VertexShader = null;
PixelShader = compile ps_3_0 Bloom_PS_3_0();
}
}

technique tech_01
{
pass pass_00
{
VertexShader = null;
PixelShader = compile ps_2_0 Bloom_PS_2_0();
}
}

technique tech_02
{
pass pass_00
{
Texture[0] = <entSkin1>;
}
}



Re: [Free]The Postprocessing Collection [Re: DavidLancaster] #155144
11/22/07 17:32
11/22/07 17:32
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Yeah, you have to change these values:

Code:


float Luminance = 0.08f;
static const float fMiddleGray = 0.18f;
static const float fWhiteCutoff = 0.8f;



However... this will influence the entire scene. There's no really nice solution to this problem, unless you figure out a way to do the fog on top of the bloom somehow. I figure that would be possible through some sort of custom made fog code,

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: [Free]The Postprocessing Collection [Re: DavidLancaster] #155145
11/22/07 20:59
11/22/07 20:59
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
already tried to darken the fog color itself? that should work quite satisfying

Re: [Free]The Postprocessing Collection [Re: ello] #155146
11/22/07 23:10
11/22/07 23:10
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline
User
DavidLancaster  Offline
User

Joined: Nov 2004
Posts: 862
Australia
I think it might be a video card thing, Ge force 6600, as changing those values, changing the color of the fog to very dark, still the same effect, even though the intensity of bloom changes the fog comes in really close....Thanks for your help

Page 4 of 4 1 2 3 4

Moderated by  adoado, checkbutton, mk_1, Perro 

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