I misspoke last commit. NOW blur is proper

git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@1102 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
psperl
2008-07-16 03:53:47 +00:00
parent a4a24927cf
commit da85ef60f1
2 changed files with 26 additions and 22 deletions

View File

@ -529,10 +529,10 @@ if(blur1_enabled || blur2_enabled || blur3_enabled)
cgGLBindProgram(blur1Program);
checkForCgError("binding blur1 program");
float points[4][2] = {{0, 0},
{0, 1},
{ 1, 1},
{ 1, 0}};
float points[4][2] = {{0, 1},
{0, 0},
{1, 0},
{1, 1}};
glVertexPointer(2,GL_FLOAT,0,points);
@ -555,10 +555,10 @@ if(blur1_enabled || blur2_enabled || blur3_enabled)
cgGLBindProgram(blur2Program);
checkForCgError("binding blur2 program");
float points[4][2] = {{0, 0},
{0, 0.5},
{ 0.5, 0.5},
{ 0.5, 0}};
float points[4][2] = {{0, 0.5},
{0, 0},
{0.5, 0},
{0.5, 0.5}};
glVertexPointer(2,GL_FLOAT,0,points);
@ -576,11 +576,10 @@ if(blur1_enabled || blur2_enabled || blur3_enabled)
if (blur3_enabled)
{
cgGLSetParameter4f(cgGetNamedParameter(blur2Program, "srctexsize"), renderTarget->texsize/2, renderTarget->texsize/2, 2/(float)renderTarget->texsize,2/(float)renderTarget->texsize);
float points[4][2] = {{0, 0},
{0, 0.25},
{ 0.25, 0.25},
{ 0.25, 0}};
float points[4][2] = {{0, 0.25},
{0, 0},
{0.25, 0},
{0.25, 0.25}};
glVertexPointer(2,GL_FLOAT,0,points);
@ -1498,7 +1497,7 @@ void Renderer::CompositeOutput(const Pipeline* pipeline, const PipelineContext &
#endif
for (std::vector<RenderItem*>::const_iterator pos = pipeline->compositeDrawables.begin(); pos != pipeline->compositeDrawables.end(); ++pos)
(*pos)->Draw(renderContext);
;//(*pos)->Draw(renderContext);
}

View File

@ -6,10 +6,12 @@ outtype blur1(float2 uv : TEXCOORD0, uniform sampler2D sampler_blur : TEX0)
{
float2 uv2 = uv.xy + srctexsize.zw*float2(1,1);
float3 val = tex2D(sampler_blur, float2(uv.x-.0015, uv.y)).xyz;
val += tex2D(sampler_blur, float2(uv.x+.0015, uv.y)).xyz;
val += tex2D(sampler_blur, float2(uv.x, uv.y + .0015)).xyz;
val += tex2D(sampler_blur, float2(uv.x, uv.y - .0015)).xyz;
float d = srctexsize.z;
d=.0015;
float3 val = tex2D(sampler_blur, float2(uv.x-d, uv.y)).xyz;
val += tex2D(sampler_blur, float2(uv.x+d, uv.y)).xyz;
val += tex2D(sampler_blur, float2(uv.x, uv.y + d)).xyz;
val += tex2D(sampler_blur, float2(uv.x, uv.y - d)).xyz;
outtype OUT;
OUT.color.xyz = val* 0.25;
@ -21,10 +23,13 @@ outtype blur2(float2 uv : TEXCOORD0, uniform sampler2D sampler_blur : TEX0)
{
float2 uv2 = uv.xy + srctexsize.zw*float2(1,0);
float3 val = tex2D(sampler_blur, float2(uv.x-.0015, uv.y)).xyz;
val += tex2D(sampler_blur, float2(uv.x+.0015, uv.y)).xyz;
val += tex2D(sampler_blur, float2(uv.x, uv.y + .0015)).xyz;
val += tex2D(sampler_blur, float2(uv.x, uv.y - .0015)).xyz;
float d = srctexsize.z;
d=.0015;
float3 val = tex2D(sampler_blur, float2(uv.x-d, uv.y)).xyz;
val += tex2D(sampler_blur, float2(uv.x+d, uv.y)).xyz;
val += tex2D(sampler_blur, float2(uv.x, uv.y + d)).xyz;
val += tex2D(sampler_blur, float2(uv.x, uv.y - d)).xyz;
val *= 0.25;