Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
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
3 registered members (kzhao, AndrewAMD, bigsmack), 824 guests, and 5 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
Screen blur shader #165715
11/04/07 14:53
11/04/07 14:53
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline OP
User
Shadow969  Offline OP
User
S

Joined: Oct 2006
Posts: 873
Okay, here's my problem...
I've made a simple shader for blur

Code:
float4 vecSkill1;
texture entSkin1;

sampler basemap = sampler_state
{
Texture = <entSkin1>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = clamp;
AddressV = clamp;
};

float4 mainPS(float2 Tex: TEXCOORD0) : COLOR
{
float2 Color1 = {Tex.x+vecSkill1.x,Tex.y-vecSkill1.x};
float2 Color2 = {Tex.x-vecSkill1.x,Tex.y+vecSkill1.x};

float4 Color = tex2D( basemap, Tex.xy);
Color += tex2D( basemap, Color1);
Color += tex2D( basemap, Color2);
Color += tex2D( basemap, Tex.xy+vecSkill1.x);
Color += tex2D( basemap, Tex.xy-vecSkill1.x);
return Color/5;
}

technique blur
{
pass Object
{
PixelShader = compile ps_1_4 mainPS();
}
}



works fine

now i created a view entity (1024x768 bmp sprite) and a view for post-processing

Code:
ENTITY* screen_grab = 
{
type = "screen.bmp";
layer = 1;
view = camera;
x = 1000;
flags2 = VISIBLE;
}

VIEW* PP =
{
flags = VISIBLE;
layer = -1;
}



now i render my view to entity

Code:

PP.bmap = bmap_for_entity(screen_grab,0);
while(1)
{
vec_set(PP.x,camera.x);
vec_set(PP.pan,camera.pan);
wait(1);
}



works fine

but when i apply blur material to the entity there's no blur, and the rendered texture is messed up like this


i'm a noob at shaders, perhaps more experienced users can help me?

Re: Screen blur shader [Re: Shadow969] #165716
11/04/07 18:06
11/04/07 18:06
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline OP
User
Shadow969  Offline OP
User
S

Joined: Oct 2006
Posts: 873
nevermind, i've fixed it by reducing texture size to 512


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