Gamestudio Links
Zorro Links
Newest Posts
FXCM => AVA Trade Plugin???
by JeyKey II. 11/25/26 09:53
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
5 registered members (AndrewAMD, Grant, Quad, TipmyPip, JeyKey II), 7,448 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 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 | 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