PostSharpen Mod

Posts 3145 of 48 · Page 3 of 4
Awesome mod Drigien!
ill test it ...looks good effect
Quote Originally Posted by Drigien View Post
Despite the fact that everything in the pictures (on the right) has the effect?
Those are in-game shots with the shader processing only half the screen.

Maybe you should look at some of my other work before judging.

It still was a 30sec job, but just not how you think.
But blame supercarz, he the one that said I should release it.



You know anti-aliasing is smoothing/blending? This is closer to the opposite, as it has a similar convulsion operator to an edge detection.

...Now back to writing a 3D graphics library/engine in HTML5 without the use of WebGL. Stupid needing cross-platform compatibility (ie: mobile devices) for work.
I should have clarified what i said.

I know what anti aliasing is, it's the smoothing of rough models and etc.

This is like...

idk.

lul.

c:
Too sharpened, it'll make the mods look worse actually. Because CA wasn't originally made with good quality pixels. So this pushes it too far and makes everything flaky looking.
Quote Originally Posted by Hennessy View Post
Too sharpened, it'll make the mods look worse actually. Because CA wasn't originally made with good quality pixels. So this pushes it too far and makes everything flaky looking.
I noticed
I think it looks good, could you possable make a inbtween so it still makes ca textures look ok?
Quote Originally Posted by Hennessy View Post
Too sharpened, it'll make the mods look worse actually. Because CA wasn't originally made with good quality pixels. So this pushes it too far and makes everything flaky looking.
This works in screen-space, so it depends on your resolution.

As I said, some people might not like how high I have it pushed, but it is easily adjustable.

@AVGN
Open up the file and edit line 201:
Code:
float amount = 3.0f;
just change the 3.0f to X.Xf, where a lower number is less.
Quote Originally Posted by Drigien View Post
This works in screen-space, so it depends on your resolution.

As I said, some people might not like how high I have it pushed, but it is easily adjustable.

@AVGN
Open up the file and edit line 201:
Code:
float amount = 2.0f;
just change the 3.0f to X.Xf, where a lower number is less.
like this?
Code:
//===================================================================================
// Sharpen Mod
//
// Made By: Drigien
// Date: Oct 2011
//===================================================================================

float SceneIntensity = 0.95f;
float GlowIntensity = 0.5f;
float HighlightThreshold = 0.8f;
float HighlightIntensity = 0.0f;

float2 vViewportSize;
float downsampleScale = 0.25;

float BlurWidth = 0.125f;

texture SceneMap;
sampler SceneSampler = sampler_state 
{
    texture = <SceneMap>;
    AddressU  = CLAMP;        
    AddressV  = CLAMP;
    AddressW  = CLAMP;
    MIPFILTER = NONE;
    MINFILTER = LINEAR;
    MAGFILTER = LINEAR;
};

texture DownsampleMap;
sampler DownsampleSampler = sampler_state 
{
    texture = <DownsampleMap>;
    AddressU  = CLAMP;        
    AddressV  = CLAMP;
    AddressW  = CLAMP;
    MIPFILTER = NONE;
    MINFILTER = LINEAR;
    MAGFILTER = LINEAR;
};

texture HBlurMap;
sampler HBlurSampler = sampler_state 
{
    texture = <HBlurMap>;
    AddressU  = CLAMP;        
    AddressV  = CLAMP;
    AddressW  = CLAMP;
    MIPFILTER = NONE;
    MINFILTER = LINEAR;
    MAGFILTER = LINEAR;
};

texture FinalBlurMap;
sampler FinalBlurSampler = sampler_state 
{
    texture = <FinalBlurMap>;
    AddressU  = CLAMP;        
    AddressV  = CLAMP;
    AddressW  = CLAMP;
    MIPFILTER = NONE;
    MINFILTER = LINEAR;
    MAGFILTER = LINEAR;
};

///////////////////////////////////////////////////////////
/////////////////////////////////// data structures ///////
///////////////////////////////////////////////////////////
struct VS_OUTPUT_BLUR
{
    float4 Position   : POSITION;
    float2 TexCoord[8]: TEXCOORD0;
};

struct VS_OUTPUT
{
       float4 Position   : POSITION;
    float2 TexCoord0  : TEXCOORD0;
    float2 TexCoord1  : TEXCOORD1;
    float2 TexCoord2  : TEXCOORD2;
};

struct VS_OUTPUT_DOWNSAMPLE
{
    float4 Position   : POSITION;
    float2 TexCoord[4]: TEXCOORD0;
};

////////////////////////////////////////////////////////////
////////////////////////////////// vertex shaders //////////
////////////////////////////////////////////////////////////

VS_OUTPUT_DOWNSAMPLE VS_Downsample(float4 Position : POSITION,
                                   float2 TexCoord : TEXCOORD0)
{
    VS_OUTPUT_DOWNSAMPLE OUT;
    float2 texelSize = downsampleScale / vViewportSize;
    float2 s = TexCoord;
    OUT.Position = Position;
    OUT.TexCoord[0] = s;
    OUT.TexCoord[1] = s + float2(2, 0)*texelSize;
    OUT.TexCoord[2] = s + float2(2, 2)*texelSize;
    OUT.TexCoord[3] = s + float2(0, 2)*texelSize;    
    return OUT;
}

VS_OUTPUT_BLUR VS_Blur(float4 Position : POSITION, 
                       float2 TexCoord : TEXCOORD0,
                       uniform int nsamples,
                       uniform float2 direction
                       )
{
    VS_OUTPUT_BLUR OUT = (VS_OUTPUT_BLUR)0;
    OUT.Position = Position;
    float2 texelSize = BlurWidth / vViewportSize;
    float2 s = TexCoord - texelSize*(nsamples-1)*0.5*direction;
    for(int i=0; i<nsamples; i++) {
        OUT.TexCoord[i] = s + texelSize*i*direction;
    }
    return OUT;
}

VS_OUTPUT VS_Quad(float4 Position : POSITION, 
                  float2 TexCoord : TEXCOORD0)
{
    VS_OUTPUT OUT;
    float2 texelSize = 1.0 / vViewportSize;
    OUT.Position = Position;
    // don't want bilinear filtering on original scene:
    OUT.TexCoord0 = TexCoord; //+ texelSize*0.5;
    OUT.TexCoord1 = TexCoord + texelSize*0.5/downsampleScale;
    OUT.TexCoord2 = texelSize;
    return OUT;
}
//////////////////////////////////////////////////////
////////////////////////////////// pixel shaders /////
//////////////////////////////////////////////////////

half luminance(half3 c)
{
    return dot( c, float3(0.3, 0.59, 0.11) );
}

half highlights(half3 c)
{
    return smoothstep(HighlightThreshold, 1.0, luminance(c.rgb));
}

// blur filter weights
const half weights7[7] = {
    0.05,
    0.1,
    0.2,
    0.3,
    0.2,
    0.1,
    0.05,
};    

half4 PS_Blur7(VS_OUTPUT_BLUR IN,
               uniform sampler2D tex,
               uniform half weight[7]
               ) : COLOR
{
    half4 c = 0;
    // this loop will be unrolled by compiler
    for(int i=0; i<7; i++) {
        c += tex2D(tex, IN.TexCoord[i]) * weight[i];
       }
    return c;
} 

half4 PS_Downsample(VS_OUTPUT_DOWNSAMPLE IN,
                    uniform sampler2D tex) : COLOR
{
    half4 c;

    c = tex2D(tex, IN.TexCoord[0]) * 0.25;
    c += tex2D(tex, IN.TexCoord[1]) * 0.25;
    c += tex2D(tex, IN.TexCoord[2]) * 0.25;
    c += tex2D(tex, IN.TexCoord[3]) * 0.25;

    // store hilights in alpha
    c.a = highlights(c.rgb);

    return c;
}

half4 PS_Comp(VS_OUTPUT IN,
              uniform sampler2D sceneSampler,
              uniform sampler2D blurredSceneSampler) : COLOR
{   
    float4 orig = tex2D(sceneSampler, IN.TexCoord0);
    float4 blur = tex2D(blurredSceneSampler, IN.TexCoord1);
    
    float2 s = IN.TexCoord2;
    float4 x = 0;
    float4 y = 0;
    float4 xy;
    
    float amount = 3.0f;
    
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2(-s.x,    -s.y) );
    x += -amount *             tex2D(sceneSampler, IN.TexCoord0 + float2( 0.0f,-s.y) );
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2( s.x,    -s.y) );
    
    x += -amount *             tex2D(sceneSampler, IN.TexCoord0 + float2(-s.x,  0.0f) );
    x += +(amount*4+1) *    tex2D(sceneSampler, IN.TexCoord0 + float2( 0.0f, 0.0f) );
    x += -amount *            tex2D(sceneSampler, IN.TexCoord0 + float2( s.x,  0.0f) );
    
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2(-s.x,  s.y) );
    x += -amount *             tex2D(sceneSampler, IN.TexCoord0 + float2( 0.0f, s.y) );
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2( s.x,  s.y) );
    

    return x;
} 

////////////////////////////////////////////////////////////
/////////////////////////////////////// techniques /////////
////////////////////////////////////////////////////////////
technique Bloom
{
  pass DownSample
  {
        ZWriteEnable = false;
    ZEnable = false;
       Lighting = false;    
        VertexShader = compile vs_2_0 VS_Downsample();
        PixelShader  = compile ps_2_0 PS_Downsample(SceneSampler);
  }
  pass GlowH
  {
        ZWriteEnable = false;
    ZEnable = false;
       Lighting = false;    
        ZWriteEnable = false;
        VertexShader = compile vs_2_0 VS_Blur(7, float2(1, 0));
        PixelShader  = compile ps_2_0 PS_Blur7(DownsampleSampler, weights7);
    }
    pass GlowV
    {
        ZWriteEnable = false;
    ZEnable = false;
       Lighting = false;    
        ZWriteEnable = false;
        VertexShader = compile vs_2_0 VS_Blur(7, float2(0, 1));
        PixelShader  = compile ps_2_0 PS_Blur7(HBlurSampler, weights7);
    }
    pass FinalComp
    {
        cullmode = none;
        ZEnable = false;
        ZWriteEnable = false;
        VertexShader = compile vs_2_0 VS_Quad();
        PixelShader  = compile ps_2_0 PS_Comp(SceneSampler, FinalBlurSampler);
    }
}
Quote Originally Posted by AVGN View Post


like this?
Code:
//===================================================================================
// Sharpen Mod
//
// Made By: Drigien
// Date: Oct 2011
//===================================================================================

float SceneIntensity = 0.95f;
float GlowIntensity = 0.5f;
float HighlightThreshold = 0.8f;
float HighlightIntensity = 0.0f;

float2 vViewportSize;
float downsampleScale = 0.25;

float BlurWidth = 0.125f;

texture SceneMap;
sampler SceneSampler = sampler_state 
{
    texture = <SceneMap>;
    AddressU  = CLAMP;        
    AddressV  = CLAMP;
    AddressW  = CLAMP;
    MIPFILTER = NONE;
    MINFILTER = LINEAR;
    MAGFILTER = LINEAR;
};

texture DownsampleMap;
sampler DownsampleSampler = sampler_state 
{
    texture = <DownsampleMap>;
    AddressU  = CLAMP;        
    AddressV  = CLAMP;
    AddressW  = CLAMP;
    MIPFILTER = NONE;
    MINFILTER = LINEAR;
    MAGFILTER = LINEAR;
};

texture HBlurMap;
sampler HBlurSampler = sampler_state 
{
    texture = <HBlurMap>;
    AddressU  = CLAMP;        
    AddressV  = CLAMP;
    AddressW  = CLAMP;
    MIPFILTER = NONE;
    MINFILTER = LINEAR;
    MAGFILTER = LINEAR;
};

texture FinalBlurMap;
sampler FinalBlurSampler = sampler_state 
{
    texture = <FinalBlurMap>;
    AddressU  = CLAMP;        
    AddressV  = CLAMP;
    AddressW  = CLAMP;
    MIPFILTER = NONE;
    MINFILTER = LINEAR;
    MAGFILTER = LINEAR;
};

///////////////////////////////////////////////////////////
/////////////////////////////////// data structures ///////
///////////////////////////////////////////////////////////
struct VS_OUTPUT_BLUR
{
    float4 Position   : POSITION;
    float2 TexCoord[8]: TEXCOORD0;
};

struct VS_OUTPUT
{
       float4 Position   : POSITION;
    float2 TexCoord0  : TEXCOORD0;
    float2 TexCoord1  : TEXCOORD1;
    float2 TexCoord2  : TEXCOORD2;
};

struct VS_OUTPUT_DOWNSAMPLE
{
    float4 Position   : POSITION;
    float2 TexCoord[4]: TEXCOORD0;
};

////////////////////////////////////////////////////////////
////////////////////////////////// vertex shaders //////////
////////////////////////////////////////////////////////////

VS_OUTPUT_DOWNSAMPLE VS_Downsample(float4 Position : POSITION,
                                   float2 TexCoord : TEXCOORD0)
{
    VS_OUTPUT_DOWNSAMPLE OUT;
    float2 texelSize = downsampleScale / vViewportSize;
    float2 s = TexCoord;
    OUT.Position = Position;
    OUT.TexCoord[0] = s;
    OUT.TexCoord[1] = s + float2(2, 0)*texelSize;
    OUT.TexCoord[2] = s + float2(2, 2)*texelSize;
    OUT.TexCoord[3] = s + float2(0, 2)*texelSize;    
    return OUT;
}

VS_OUTPUT_BLUR VS_Blur(float4 Position : POSITION, 
                       float2 TexCoord : TEXCOORD0,
                       uniform int nsamples,
                       uniform float2 direction
                       )
{
    VS_OUTPUT_BLUR OUT = (VS_OUTPUT_BLUR)0;
    OUT.Position = Position;
    float2 texelSize = BlurWidth / vViewportSize;
    float2 s = TexCoord - texelSize*(nsamples-1)*0.5*direction;
    for(int i=0; i<nsamples; i++) {
        OUT.TexCoord[i] = s + texelSize*i*direction;
    }
    return OUT;
}

VS_OUTPUT VS_Quad(float4 Position : POSITION, 
                  float2 TexCoord : TEXCOORD0)
{
    VS_OUTPUT OUT;
    float2 texelSize = 1.0 / vViewportSize;
    OUT.Position = Position;
    // don't want bilinear filtering on original scene:
    OUT.TexCoord0 = TexCoord; //+ texelSize*0.5;
    OUT.TexCoord1 = TexCoord + texelSize*0.5/downsampleScale;
    OUT.TexCoord2 = texelSize;
    return OUT;
}
//////////////////////////////////////////////////////
////////////////////////////////// pixel shaders /////
//////////////////////////////////////////////////////

half luminance(half3 c)
{
    return dot( c, float3(0.3, 0.59, 0.11) );
}

half highlights(half3 c)
{
    return smoothstep(HighlightThreshold, 1.0, luminance(c.rgb));
}

// blur filter weights
const half weights7[7] = {
    0.05,
    0.1,
    0.2,
    0.3,
    0.2,
    0.1,
    0.05,
};    

half4 PS_Blur7(VS_OUTPUT_BLUR IN,
               uniform sampler2D tex,
               uniform half weight[7]
               ) : COLOR
{
    half4 c = 0;
    // this loop will be unrolled by compiler
    for(int i=0; i<7; i++) {
        c += tex2D(tex, IN.TexCoord[i]) * weight[i];
       }
    return c;
} 

half4 PS_Downsample(VS_OUTPUT_DOWNSAMPLE IN,
                    uniform sampler2D tex) : COLOR
{
    half4 c;

    c = tex2D(tex, IN.TexCoord[0]) * 0.25;
    c += tex2D(tex, IN.TexCoord[1]) * 0.25;
    c += tex2D(tex, IN.TexCoord[2]) * 0.25;
    c += tex2D(tex, IN.TexCoord[3]) * 0.25;

    // store hilights in alpha
    c.a = highlights(c.rgb);

    return c;
}

half4 PS_Comp(VS_OUTPUT IN,
              uniform sampler2D sceneSampler,
              uniform sampler2D blurredSceneSampler) : COLOR
{   
    float4 orig = tex2D(sceneSampler, IN.TexCoord0);
    float4 blur = tex2D(blurredSceneSampler, IN.TexCoord1);
    
    float2 s = IN.TexCoord2;
    float4 x = 0;
    float4 y = 0;
    float4 xy;
    
    float amount = 3.0f;
    
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2(-s.x,    -s.y) );
    x += -amount *             tex2D(sceneSampler, IN.TexCoord0 + float2( 0.0f,-s.y) );
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2( s.x,    -s.y) );
    
    x += -amount *             tex2D(sceneSampler, IN.TexCoord0 + float2(-s.x,  0.0f) );
    x += +(amount*4+1) *    tex2D(sceneSampler, IN.TexCoord0 + float2( 0.0f, 0.0f) );
    x += -amount *            tex2D(sceneSampler, IN.TexCoord0 + float2( s.x,  0.0f) );
    
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2(-s.x,  s.y) );
    x += -amount *             tex2D(sceneSampler, IN.TexCoord0 + float2( 0.0f, s.y) );
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2( s.x,  s.y) );
    

    return x;
} 

////////////////////////////////////////////////////////////
/////////////////////////////////////// techniques /////////
////////////////////////////////////////////////////////////
technique Bloom
{
  pass DownSample
  {
        ZWriteEnable = false;
    ZEnable = false;
       Lighting = false;    
        VertexShader = compile vs_2_0 VS_Downsample();
        PixelShader  = compile ps_2_0 PS_Downsample(SceneSampler);
  }
  pass GlowH
  {
        ZWriteEnable = false;
    ZEnable = false;
       Lighting = false;    
        ZWriteEnable = false;
        VertexShader = compile vs_2_0 VS_Blur(7, float2(1, 0));
        PixelShader  = compile ps_2_0 PS_Blur7(DownsampleSampler, weights7);
    }
    pass GlowV
    {
        ZWriteEnable = false;
    ZEnable = false;
       Lighting = false;    
        ZWriteEnable = false;
        VertexShader = compile vs_2_0 VS_Blur(7, float2(0, 1));
        PixelShader  = compile ps_2_0 PS_Blur7(HBlurSampler, weights7);
    }
    pass FinalComp
    {
        cullmode = none;
        ZEnable = false;
        ZWriteEnable = false;
        VertexShader = compile vs_2_0 VS_Quad();
        PixelShader  = compile ps_2_0 PS_Comp(SceneSampler, FinalBlurSampler);
    }
}

@AVGN Yep, but you left it as 3.0
Quote Originally Posted by AVGN View Post


like this?
Code:
//===================================================================================
// Sharpen Mod
//
// Made By: Drigien
// Date: Oct 2011
//===================================================================================

float SceneIntensity = 0.95f;
float GlowIntensity = 0.5f;
float HighlightThreshold = 0.8f;
float HighlightIntensity = 0.0f;

float2 vViewportSize;
float downsampleScale = 0.25;

float BlurWidth = 0.125f;

texture SceneMap;
sampler SceneSampler = sampler_state 
{
    texture = <SceneMap>;
    AddressU  = CLAMP;        
    AddressV  = CLAMP;
    AddressW  = CLAMP;
    MIPFILTER = NONE;
    MINFILTER = LINEAR;
    MAGFILTER = LINEAR;
};

texture DownsampleMap;
sampler DownsampleSampler = sampler_state 
{
    texture = <DownsampleMap>;
    AddressU  = CLAMP;        
    AddressV  = CLAMP;
    AddressW  = CLAMP;
    MIPFILTER = NONE;
    MINFILTER = LINEAR;
    MAGFILTER = LINEAR;
};

texture HBlurMap;
sampler HBlurSampler = sampler_state 
{
    texture = <HBlurMap>;
    AddressU  = CLAMP;        
    AddressV  = CLAMP;
    AddressW  = CLAMP;
    MIPFILTER = NONE;
    MINFILTER = LINEAR;
    MAGFILTER = LINEAR;
};

texture FinalBlurMap;
sampler FinalBlurSampler = sampler_state 
{
    texture = <FinalBlurMap>;
    AddressU  = CLAMP;        
    AddressV  = CLAMP;
    AddressW  = CLAMP;
    MIPFILTER = NONE;
    MINFILTER = LINEAR;
    MAGFILTER = LINEAR;
};

///////////////////////////////////////////////////////////
/////////////////////////////////// data structures ///////
///////////////////////////////////////////////////////////
struct VS_OUTPUT_BLUR
{
    float4 Position   : POSITION;
    float2 TexCoord[8]: TEXCOORD0;
};

struct VS_OUTPUT
{
       float4 Position   : POSITION;
    float2 TexCoord0  : TEXCOORD0;
    float2 TexCoord1  : TEXCOORD1;
    float2 TexCoord2  : TEXCOORD2;
};

struct VS_OUTPUT_DOWNSAMPLE
{
    float4 Position   : POSITION;
    float2 TexCoord[4]: TEXCOORD0;
};

////////////////////////////////////////////////////////////
////////////////////////////////// vertex shaders //////////
////////////////////////////////////////////////////////////

VS_OUTPUT_DOWNSAMPLE VS_Downsample(float4 Position : POSITION,
                                   float2 TexCoord : TEXCOORD0)
{
    VS_OUTPUT_DOWNSAMPLE OUT;
    float2 texelSize = downsampleScale / vViewportSize;
    float2 s = TexCoord;
    OUT.Position = Position;
    OUT.TexCoord[0] = s;
    OUT.TexCoord[1] = s + float2(2, 0)*texelSize;
    OUT.TexCoord[2] = s + float2(2, 2)*texelSize;
    OUT.TexCoord[3] = s + float2(0, 2)*texelSize;    
    return OUT;
}

VS_OUTPUT_BLUR VS_Blur(float4 Position : POSITION, 
                       float2 TexCoord : TEXCOORD0,
                       uniform int nsamples,
                       uniform float2 direction
                       )
{
    VS_OUTPUT_BLUR OUT = (VS_OUTPUT_BLUR)0;
    OUT.Position = Position;
    float2 texelSize = BlurWidth / vViewportSize;
    float2 s = TexCoord - texelSize*(nsamples-1)*0.5*direction;
    for(int i=0; i<nsamples; i++) {
        OUT.TexCoord[i] = s + texelSize*i*direction;
    }
    return OUT;
}

VS_OUTPUT VS_Quad(float4 Position : POSITION, 
                  float2 TexCoord : TEXCOORD0)
{
    VS_OUTPUT OUT;
    float2 texelSize = 1.0 / vViewportSize;
    OUT.Position = Position;
    // don't want bilinear filtering on original scene:
    OUT.TexCoord0 = TexCoord; //+ texelSize*0.5;
    OUT.TexCoord1 = TexCoord + texelSize*0.5/downsampleScale;
    OUT.TexCoord2 = texelSize;
    return OUT;
}
//////////////////////////////////////////////////////
////////////////////////////////// pixel shaders /////
//////////////////////////////////////////////////////

half luminance(half3 c)
{
    return dot( c, float3(0.3, 0.59, 0.11) );
}

half highlights(half3 c)
{
    return smoothstep(HighlightThreshold, 1.0, luminance(c.rgb));
}

// blur filter weights
const half weights7[7] = {
    0.05,
    0.1,
    0.2,
    0.3,
    0.2,
    0.1,
    0.05,
};    

half4 PS_Blur7(VS_OUTPUT_BLUR IN,
               uniform sampler2D tex,
               uniform half weight[7]
               ) : COLOR
{
    half4 c = 0;
    // this loop will be unrolled by compiler
    for(int i=0; i<7; i++) {
        c += tex2D(tex, IN.TexCoord[i]) * weight[i];
       }
    return c;
} 

half4 PS_Downsample(VS_OUTPUT_DOWNSAMPLE IN,
                    uniform sampler2D tex) : COLOR
{
    half4 c;

    c = tex2D(tex, IN.TexCoord[0]) * 0.25;
    c += tex2D(tex, IN.TexCoord[1]) * 0.25;
    c += tex2D(tex, IN.TexCoord[2]) * 0.25;
    c += tex2D(tex, IN.TexCoord[3]) * 0.25;

    // store hilights in alpha
    c.a = highlights(c.rgb);

    return c;
}

half4 PS_Comp(VS_OUTPUT IN,
              uniform sampler2D sceneSampler,
              uniform sampler2D blurredSceneSampler) : COLOR
{   
    float4 orig = tex2D(sceneSampler, IN.TexCoord0);
    float4 blur = tex2D(blurredSceneSampler, IN.TexCoord1);
    
    float2 s = IN.TexCoord2;
    float4 x = 0;
    float4 y = 0;
    float4 xy;
    
    float amount = 3.0f;
    
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2(-s.x,    -s.y) );
    x += -amount *             tex2D(sceneSampler, IN.TexCoord0 + float2( 0.0f,-s.y) );
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2( s.x,    -s.y) );
    
    x += -amount *             tex2D(sceneSampler, IN.TexCoord0 + float2(-s.x,  0.0f) );
    x += +(amount*4+1) *    tex2D(sceneSampler, IN.TexCoord0 + float2( 0.0f, 0.0f) );
    x += -amount *            tex2D(sceneSampler, IN.TexCoord0 + float2( s.x,  0.0f) );
    
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2(-s.x,  s.y) );
    x += -amount *             tex2D(sceneSampler, IN.TexCoord0 + float2( 0.0f, s.y) );
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2( s.x,  s.y) );
    

    return x;
} 

////////////////////////////////////////////////////////////
/////////////////////////////////////// techniques /////////
////////////////////////////////////////////////////////////
technique Bloom
{
  pass DownSample
  {
        ZWriteEnable = false;
    ZEnable = false;
       Lighting = false;    
        VertexShader = compile vs_2_0 VS_Downsample();
        PixelShader  = compile ps_2_0 PS_Downsample(SceneSampler);
  }
  pass GlowH
  {
        ZWriteEnable = false;
    ZEnable = false;
       Lighting = false;    
        ZWriteEnable = false;
        VertexShader = compile vs_2_0 VS_Blur(7, float2(1, 0));
        PixelShader  = compile ps_2_0 PS_Blur7(DownsampleSampler, weights7);
    }
    pass GlowV
    {
        ZWriteEnable = false;
    ZEnable = false;
       Lighting = false;    
        ZWriteEnable = false;
        VertexShader = compile vs_2_0 VS_Blur(7, float2(0, 1));
        PixelShader  = compile ps_2_0 PS_Blur7(HBlurSampler, weights7);
    }
    pass FinalComp
    {
        cullmode = none;
        ZEnable = false;
        ZWriteEnable = false;
        VertexShader = compile vs_2_0 VS_Quad();
        PixelShader  = compile ps_2_0 PS_Comp(SceneSampler, FinalBlurSampler);
    }
}
Ah, it still says 3.0f.

Code:
half4 PS_Comp(VS_OUTPUT IN,
              uniform sampler2D sceneSampler,
              uniform sampler2D blurredSceneSampler) : COLOR
{   
    float4 orig = tex2D(sceneSampler, IN.TexCoord0);
    float4 blur = tex2D(blurredSceneSampler, IN.TexCoord1);
    
    float2 s = IN.TexCoord2;
    float4 x = 0;
    float4 y = 0;
    float4 xy;
    
    float amount = 3.0f; <------ CHANGE THIS --------
    
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2(-s.x,    -s.y) );
    x += -amount *             tex2D(sceneSampler, IN.TexCoord0 + float2( 0.0f,-s.y) );
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2( s.x,    -s.y) );
    
    x += -amount *             tex2D(sceneSampler, IN.TexCoord0 + float2(-s.x,  0.0f) );
    x += +(amount*4+1) *    tex2D(sceneSampler, IN.TexCoord0 + float2( 0.0f, 0.0f) );
    x += -amount *            tex2D(sceneSampler, IN.TexCoord0 + float2( s.x,  0.0f) );
    
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2(-s.x,  s.y) );
    x += -amount *             tex2D(sceneSampler, IN.TexCoord0 + float2( 0.0f, s.y) );
    //x +=                  tex2D(sceneSampler, IN.TexCoord0 + float2( s.x,  s.y) );
    

    return x;
}

Hmmm.. maybe it would be better just to upload a new one with the variables at the top.
Lemme get this straight, You edited EVERY texture in CA and sharpened it to look better? If so, That must've taken you forever.
Quote Originally Posted by Nitehawk772 Bkup View Post
Lemme get this straight, You edited EVERY texture in CA and sharpened it to look better? If so, That must've taken you forever.
L2read /fp
Quote Originally Posted by Nitehawk772 Bkup View Post
Lemme get this straight, You edited EVERY texture in CA and sharpened it to look better? If so, That must've taken you forever.
yes he did. it took him forever thats why this is the first mod he has released in a few months
/sarcasm

NO! lol he edited 1 file
Quote Originally Posted by supercarz1991 View Post
yes he did. it took him forever thats why this is the first mod he has released in a few months
/sarcasm

NO! lol he edited 1 file
yes.. He even took the time to sharpen every mod ever posted on MPGH.. what a swell guy
Quote Originally Posted by supercarz1991 View Post
yes he did. it took him forever thats why this is the first mod he has released in a few months
/sarcasm

NO! lol he edited 1 file
Oh. Someone should make a full game mod and sharpen every single texture to make them look better. It'd take forever, But the game would look a ton better.

Quote Originally Posted by AVGN View Post


yes.. He even took the time to sharpen every mod ever posted on MPGH.. what a swell guy
I didn't know. You have to admit that'd be an awesome mod.
Posts 3145 of 48 · Page 3 of 4
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?