For those that care, I devised a method that does not alter the EXE in any way, nor does it need D3D9.DLL to be named, thus eliminating the issue of it always been hooked.
All it is, is a simple search and replace loader that hooks into the memory space of BSNES.EXE and overwrites the import table entries to load the required DLL. Thus, the loader is loaded each time shaders are wanted to be used.....
gllt, this also eliminates the moral issues that you face.
The unofficial BSNES pixel shader thread
no one caresh4tred wrote:For those that care, I devised a method that does not alter the EXE in any way, nor does it need D3D9.DLL to be named, thus eliminating the issue of it always been hooked.
All it is, is a simple search and replace loader that hooks into the memory space of BSNES.EXE and overwrites the import table entries to load the required DLL. Thus, the loader is loaded each time shaders are wanted to be used.....
gllt, this also eliminates the moral issues that you face.
but me give it now
in during shader mania 2
IT LOOKS LIKE ASHES too lazy for screenshot bbl
its prettay
screenshots later
Code: Select all
// WHAT A WASTE OF GPU.
texture tex1;
float2 rcpres;
//float Timer;
float4 End;
sampler s0 = sampler_state { texture = <tex1>; };
#define NUM 16
float2 Weights[NUM] = {
0.00200, 0,
-0.00200, 0,
0, 0.00200,
0, -0.00200,
0.001625, 0.001625,
-0.001625, -0.001625,
-0.001625, 0.001625,
0.001625, -0.001625,
0.00200, 0.001625,
0.001625, 0.00200,
-0.00200,-0.001625,
-0.001625,-0.00200,
0.00200,-0.001625,
-0.00200,0.001625,
0.001625,-0.00200,
-0.001625,0.00200
};
float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
float4 Base = tex2D( s0, Tex.xy );
return Base;
}
float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
float4 Base = tex2D( s0, Tex.xy );
float4 Color = 0;
for (int i = 0; i < NUM; ++i){
Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*1*2) );
Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*2*2) );
Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*3*2) );
Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*4*2) );
Color.rgb -= (Color.r * Color.b * Color.g)/3;
//Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*5*2) );
//Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*6*2) );
//Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*7*2) );
//Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*8*2) );
}
End = Color;
return ((Base * End/32) + End/64);
//return ((Base * End/64) + End/128);
}
///*
Technique T0
{
pass p0 { PixelShader = compile ps_3_0 Pass0(); }
pass p1 { PixelShader = compile ps_3_0 Pass1(); }
}
//*/
/* 2.0 Pass instead?
Technique T0
{
pass p0 { PixelShader = compile ps_2_0 Pass0(); }
pass p1 { PixelShader = compile ps_2_0 Pass1(); }
}
*/
Code: Select all
// WHAT A WASTE OF GPU.
texture tex1;
float2 rcpres;
//float Timer;
sampler s0 = sampler_state { texture = <tex1>; };
float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
float4 Base = tex2D( s0, Tex.xy );
return Base;
}
float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
float4 Base = tex2D( s0, Tex.xy );
float4 Color = Base;
Color += tex2D( s0, Tex.xy+float2(0,0.0050) )/8;
Color += tex2D( s0, Tex.xy-float2(0,0.0050) )/8;
Color += tex2D( s0, Tex.xy+float2(0.0050,0) )/8;
Color += tex2D( s0, Tex.xy-float2(0.0050,0) )/8;
Color += tex2D( s0, Tex.xy+float2(0.0025,0.0025) )/8;
Color += tex2D( s0, Tex.xy-float2(0.0025,0.0025) )/8;
Color += tex2D( s0, Tex.xy+float2(-0.0025,0.0025) )/8;
Color += tex2D( s0, Tex.xy-float2(-0.0025,0.0025) )/8;
Color += round(Color)/3;
Base += tex2D( s0, Tex.xy+float2(0,0.0050) )/8;
Base += tex2D( s0, Tex.xy-float2(0,0.0050) )/8;
Base += tex2D( s0, Tex.xy+float2(0.0050,0) )/8;
Base += tex2D( s0, Tex.xy-float2(0.0050,0) )/8;
Base += tex2D( s0, Tex.xy+float2(0.0025,0.0025) )/8;
Base += tex2D( s0, Tex.xy-float2(0.0025,0.0025) )/8;
Base += tex2D( s0, Tex.xy+float2(-0.0025,0.0025) )/8;
Base += tex2D( s0, Tex.xy-float2(-0.0025,0.0025) )/8;
Base.rgb = (Base.r + Base.g + Base.b)/3;
Base.rgb = round(Base.rgb);
Base = Base/1.5;
return (Color * Base)/1.5 + (Color/4);
}
Technique T0
{
pass p0 { PixelShader = compile ps_3_0 Pass0(); }
pass p1 { PixelShader = compile ps_3_0 Pass1(); }
}
screenshots later
http://img6.imageshack.us/img6/8150/oot.png
Code: Select all
texture tex1;
float2 rcpres;
sampler s0 = sampler_state {
Texture = (tex1);
};
float pixelWidth = 0.0010;
float PixelKernel[13] =
{
-6,
-5,
-4,
-3,
-2,
-1,
0,
1,
2,
3,
4,
5,
6,
};
static const float BlurWeights[13] =
{
0.002216,
0.008764,
0.026995,
0.064759,
0.120985,
0.176033,
0.199471,
0.176033,
0.120985,
0.064759,
0.026995,
0.008764,
0.002216,
};
float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
float4 Base = tex2D( s0, Tex.xy );
return Base;
}
float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
float4 Color = 0;
float2 Samp = Tex;
for (int i = 0; i < 13; i++) {
Samp.x = Tex.x + PixelKernel[i] * (pixelWidth/1.5);
Color += tex2D(s0, Samp.xy) * BlurWeights[i];
}
for (int i = 0; i < 13; i++) {
Samp.y = Tex.y + PixelKernel[i] * pixelWidth;
Color += tex2D(s0, Samp.xy) * BlurWeights[i];
}
Color.rgb *= round(Color.rgb)/1.25;
Color.rgb *= (Color.r + Color.g + Color.b)/3;
return Color;
}
technique MyTechnique
{
pass p0 { PixelShader = compile ps_3_0 Pass0(); }
pass p1 { PixelShader = compile ps_3_0 Pass1(); }
}