Hallo
ich habe bei einer auflösung von 1280x1024 am unteren rand vom bildschirm einen balken, wenn ich bloom aktiviert habe. dies passiert aber nur, wenn ich den downsampler von sylex drin habe. deswegen habe ich versucht einen anderen downsampler zu basteln, aber irgendwie funkioniert er nicht richtig.
z.b. ist mein himmel eine einheitlich farbe, die sich bei mausbewegung ändert.
ist es überhaupt möglich einen anderen downsampler zu verwenden?
hier der code:
Code:
texture postTex1;
float4x4 matWorldViewProjection;
// Pixel offsets ( 1 / 1024, 1 / 768 )
float2 PixelOffset = float2( 0.0097656250, 0.0013020833 );
// This hack is necessary because the suppress function
// seems to work only when Kd is greater than 1, even by 0.0001f!!!
float Kd = 1.0001f;
//////////////////////////////////////////////////////////////////////
// Samplers
//////////////////////////////////////////////////////////////////////
sampler DownSampler = sampler_state
{
texture = (postTex1);
MinFilter = linear;
MagFilter = linear;
MipFilter = linear;
AddressU = Clamp;
AddressV = Clamp;
};
//////////////////////////////////////////////////////////////////////
// Vertex shader
//////////////////////////////////////////////////////////////////////
struct VS_OUT
{
float4 Pos: POSITION;
float2 Tex0: TEXCOORD0;
};
VS_OUT vs_main(float4 Pos : POSITION, float2 Tex0 : TEXCOORD0)
{
// Ausgabe Variable definieren und initialisieren
VS_OUT Output = (VS_OUT)0;
// Vertexposition im Bildraum berechnen
Output.Pos = mul(Pos,matWorldViewProjection);
Output.Tex0 = Tex0 + ( PixelOffset * 0.25 );
return Output;
}
//////////////////////////////////////////////////////////////////////
// Pixel shader
//////////////////////////////////////////////////////////////////////
float4 SuppressLDR( float4 c )
{
if( c.r > 1.0f || c.g > 1.0f || c.b > 1.0f )
return c;
else
return float4( 0.0f, 0.0f, 0.0f, 0.0f );
}
float4 ps_main(float2 texcoord0 : TEXCOORD0) : COLOR
{
float4 color = tex2D( DownSampler, texcoord0 ) * Kd;
return SuppressLDR( color );
}
//////////////////////////////////////////////////////////////////////
// Techniques
//////////////////////////////////////////////////////////////////////
technique tech_00
{
pass pass_00
{
// Effekt compillieren
VertexShader = compile vs_2_0 vs_main();
PixelShader = compile ps_2_0 ps_main();
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Fallback Funktion --> No Effect
technique tech_01
{
pass pass_00
{
Texture[0] = <postTex1>;
}
}