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?