Hard Light Productions Forums
General FreeSpace => FreeSpace Discussion => Topic started by: DaBrain on January 06, 2005, 10:23:17 am
-
Well, this is only for the ATI user (which doesn't include me :( ):
The Radeon 9xxx cards have (driver) feature that allows to use postfilter PS effects. Probably nothing new to you.
It was never really important, as the standard effects were boring.
But I just found a nice bloom effect called HDRish. (It's no real HDR!)
Here is everything you need to know:
http://rage3d.com/board/showthread.php?t=33787285&page=1&pp=30
Just dl 'pssControl2.zip' and 'entries.zip' from this site:
http://www.beyond3d.com/downloads/smartshader/
Use HDRish and play OpenGL FS2_open.
If you choose to test this, drop some screens here.
I'd like to know how it looks like. ;)
-
Hmm. I'll try this out right now. Hold on.
-
Ok, well, they are right, the effect is completely overdone. If it could be tuned down, it'd be perfect...
Here's some screenies:
(http://3dap.com/hlp/hosted/14_year_war/Raa/bloom/screen00.jpg)
(http://3dap.com/hlp/hosted/14_year_war/Raa/bloom/screen01.jpg)
(http://3dap.com/hlp/hosted/14_year_war/Raa/bloom/screen03.jpg)
(http://3dap.com/hlp/hosted/14_year_war/Raa/bloom/screen04.jpg)
-
aaaaah've hud a wee bit too...too...mu-mu-much tae drink.......it'sh a wee bit blurry
-
Should be no problem. You can open the pss file with Nootepad.
I'm not really sure what has to be changed, as I don't know much about pixelshader.
There should be an entry called 'gaussian something'.
Try to lower some values there.
I'd edit it myself but I can't test anything. :(
BTW I think the menu will alway look strange.
-
Really? Notepad?
*goes off to try*
-
shader samplePixelShader =
"!!ARBfp1.0
TEMP Temp;
TEX result.color, fragment.texcoord[0], texture[0], 2D;
END";
shader gaussianXPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[3]=
{
{ 0.182008, 0.116053, 0.073999, 0.047184 },
{ 0.030086, 0.019183, 0.012232, 0.007799 },
{ 0.004973, 0.003171, 0.002022, 0.001289 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader gaussianYPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[3]=
{
{ 0.182008, 0.116053, 0.073999, 0.047184 },
{ 0.030086, 0.019183, 0.012232, 0.007799 },
{ 0.004973, 0.003171, 0.002022, 0.001289 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader outputPixelShader =
"!!ARBfp1.0
TEMP back, blur;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
ADD result.color, back, blur;
END";
surface blur0 = allocsurf(width/4, height/4);
surface blur1 = allocsurf(width/4, height/4);
gaussianXPixelShader.constant[ 0] = { (4.0*ds_dx)* 1.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 1] = { (4.0*ds_dx)* 3.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 2] = { (4.0*ds_dx)* 5.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 3] = { (4.0*ds_dx)* 7.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 4] = { (4.0*ds_dx)* 9.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 5] = { (4.0*ds_dx)*11.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 6] = { (4.0*ds_dx)*13.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 7] = { (4.0*ds_dx)*15.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 8] = { (4.0*ds_dx)*17.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 9] = { (4.0*ds_dx)*19.45, 0, 0, 0 };
gaussianXPixelShader.constant[10] = { (4.0*ds_dx)*21.45, 0, 0, 0 };
gaussianYPixelShader.constant[ 0] = { 0, (4.0*dt_dy)* 1.45, 0, 0 };
gaussianYPixelShader.constant[ 1] = { 0, (4.0*dt_dy)* 3.45, 0, 0 };
gaussianYPixelShader.constant[ 2] = { 0, (4.0*dt_dy)* 5.45, 0, 0 };
gaussianYPixelShader.constant[ 3] = { 0, (4.0*dt_dy)* 7.45, 0, 0 };
gaussianYPixelShader.constant[ 4] = { 0, (4.0*dt_dy)* 9.45, 0, 0 };
gaussianYPixelShader.constant[ 5] = { 0, (4.0*dt_dy)*11.45, 0, 0 };
gaussianYPixelShader.constant[ 6] = { 0, (4.0*dt_dy)*13.45, 0, 0 };
gaussianYPixelShader.constant[ 7] = { 0, (4.0*dt_dy)*15.45, 0, 0 };
gaussianYPixelShader.constant[ 8] = { 0, (4.0*dt_dy)*17.45, 0, 0 };
gaussianYPixelShader.constant[ 9] = { 0, (4.0*dt_dy)*19.45, 0, 0 };
gaussianYPixelShader.constant[10] = { 0, (4.0*dt_dy)*21.45, 0, 0 };
texture[0].magfilter = "linear";
texture[0].source = backbuffer;
destination blur0;
apply samplePixelShader;
texture[0].source = blur0;
destination blur1;
apply gaussianXPixelShader;
texture[0].source = blur1;
destination blur0;
apply gaussianYPixelShader;
texture[0].source = blur0;
texture[1].source = backbuffer;
destination backbuffer;
apply outputPixelShader;
What do I change to what?
-
Well, I'm not sure. Actually I have no clue.
I think you have to change something in this part:
Edit: Forget it. I think I was wrong.
I think the clamped part is the gaussian radius, which has to be reduced.
Or try to reduce the PARAM Weight.
It sounds like it could control the intensity.
I'll ask someone who should know what has to be changed.
-
"how to tone HDRish down Straight from the NitroGL man himself
Quote:
If you want to tone it down a bit, just change line 207 from:
ADD result.color, back, blur;
to:
MAD result.color, blur, 0.75, back;
That will drop the effect by 25%"
From the thread at rage3d.
-
Maybe try changing the divisor of
surface blur0 = allocsurf(width/4, height/4);
surface blur1 = allocsurf(width/4, height/4);
(?)
I don't really have a clue myself; try http://www.driverheaven.net/dhinterviews/smartshader/ maybe (search for allocsurf)
I think it creates a copy of the image being rendered, and downsizes, and finally adds the downsized image over the top; i.e. so it's blurred by being shrunk and then overlaid. So maybe try div by 2?
EDIT; think blur0 and blur1 are used for x and y respectively. Not sure why.....
-
Looks like you're right.
@Target this will indeed weaken the effect.
But I think what we want is to rise the contrast of the image befor the blooming is applied to the brightest parts.
This would cause only the really bright parts to shine.
@Raa Try to edit the file like Target suggested and try to reduce the gaussian size like aldo suggested.
Edit2: @Raa be sure to edit both the gaussianX and gaussionY filter! It's in the code two times.
Edit: This could look relly nice if it was to be implemented in the code. (As non-postfilter)
Only for shine-, glow-maps and glowpoints (suns, thrusters).
-
Oh my god it's too good to hear that.
-
Originally posted by Target
"how to tone HDRish down Straight from the NitroGL man himself
Quote:
If you want to tone it down a bit, just change line 207 from:
ADD result.color, back, blur;
to:
MAD result.color, blur, 0.75, back;
That will drop the effect by 25%"
From the thread at rage3d.
Doing that eliminated the effect.
-
Try this:
shader samplePixelShader =
"!!ARBfp1.0
TEMP Temp;
TEX result.color, fragment.texcoord[0], texture[0], 2D;
END";
shader gaussianXPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[3]=
{
{ 0.91004, 0.58026, 0.036999, 0.023592 },
{ 0.015043, 0.09591, 0.06116, 0.003899 },
{ 0.002486, 0.001585, 0.001011, 0.00644 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader gaussianYPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[3]=
{
{ 0.91004, 0.58026, 0.036999, 0.023592 },
{ 0.015043, 0.09591, 0.06116, 0.003899 },
{ 0.002486, 0.001585, 0.001011, 0.00644 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader outputPixelShader =
"!!ARBfp1.0
TEMP back, blur;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
ADD result.color, back, blur;
END";
surface blur0 = allocsurf(width/2, height/2);
surface blur1 = allocsurf(width/2, height/2);
gaussianXPixelShader.constant[ 0] = { (4.0*ds_dx)* 1.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 1] = { (4.0*ds_dx)* 3.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 2] = { (4.0*ds_dx)* 5.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 3] = { (4.0*ds_dx)* 7.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 4] = { (4.0*ds_dx)* 9.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 5] = { (4.0*ds_dx)*11.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 6] = { (4.0*ds_dx)*13.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 7] = { (4.0*ds_dx)*15.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 8] = { (4.0*ds_dx)*17.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 9] = { (4.0*ds_dx)*19.45, 0, 0, 0 };
gaussianXPixelShader.constant[10] = { (4.0*ds_dx)*21.45, 0, 0, 0 };
gaussianYPixelShader.constant[ 0] = { 0, (4.0*dt_dy)* 1.45, 0, 0 };
gaussianYPixelShader.constant[ 1] = { 0, (4.0*dt_dy)* 3.45, 0, 0 };
gaussianYPixelShader.constant[ 2] = { 0, (4.0*dt_dy)* 5.45, 0, 0 };
gaussianYPixelShader.constant[ 3] = { 0, (4.0*dt_dy)* 7.45, 0, 0 };
gaussianYPixelShader.constant[ 4] = { 0, (4.0*dt_dy)* 9.45, 0, 0 };
gaussianYPixelShader.constant[ 5] = { 0, (4.0*dt_dy)*11.45, 0, 0 };
gaussianYPixelShader.constant[ 6] = { 0, (4.0*dt_dy)*13.45, 0, 0 };
gaussianYPixelShader.constant[ 7] = { 0, (4.0*dt_dy)*15.45, 0, 0 };
gaussianYPixelShader.constant[ 8] = { 0, (4.0*dt_dy)*17.45, 0, 0 };
gaussianYPixelShader.constant[ 9] = { 0, (4.0*dt_dy)*19.45, 0, 0 };
gaussianYPixelShader.constant[10] = { 0, (4.0*dt_dy)*21.45, 0, 0 };
texture[0].magfilter = "linear";
texture[0].source = backbuffer;
destination blur0;
apply samplePixelShader;
texture[0].source = blur0;
destination blur1;
apply gaussianXPixelShader;
texture[0].source = blur1;
destination blur0;
apply gaussianYPixelShader;
texture[0].source = blur0;
texture[1].source = backbuffer;
destination backbuffer;
apply outputPixelShader;
-
Just got an answer:
Der Filter wird durch die beiden Weight Felder gesteuert. IIRC sind die Werte dabei vom Zentrum zu Rand gespeichert. Um den Effekt abzuschwächen muss man die Werte im Zentrum erhöhen und die am Rand verringern. Die Gesamtsumme muss aber gleich bleiben.
[crappy_translation]
The filter intensity is controlled by the 'weight' fields.
IIRC the values are saved from the center to the edge.
To weaken the effect you have to increase the values in the center and reduce the values for the edge. But the total sum has to stay the same.
[/crappy_translation]
That would mean the left value is the center.
PARAM Weight[3]=
{
{[i][b] 0.182008[/b][/i], 0.116053, 0.073999, 0.047184 },
{ 0.030086, 0.019183, 0.012232, 0.007799 },
{ 0.004973, 0.003171, 0.002022, 0.001289 }
};
-
Originally posted by DaBrain
Edit: This could look relly nice if it was to be implemented in the code. (As non-postfilter)
Only for shine-, glow-maps and glowpoints (suns, thrusters).
If I'm understanding it right, it works in a similar-ish way to what Sticks was implementing with the 'overburn' effect... I think he (at least initially) was copying the z-buffer image, shrinking it, and then overlaying an less opaque version.
-
Now the ATI users have pixelshader effects and the nVidia users have env- and shinemapping, what an unfair world.
-
I don't know about that.
But I saw the pic. And it looked like that.
@Overlord ATI user will have env maps too, soon.
And Nvida user will be able to use postfilter PS with an upcomming program called DX Tweaker. Which will btw enable real HDR for all games.
-
Originally posted by DaBrain
Try this:
*snip*
:lol:
Nope.
-
Originally posted by Overlord
Now the ATI users have pixelshader effects and the nVidia users have env- and shinemapping, what an unfair world.
Actually, now I have all of them! :D
-
Originally posted by Raa
:lol:
Nope.
Uhm... that's exactly the effect I was aiming for. ;)
No, really....
Here is the fixed first line
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
I'll work out the missing two lines and add them to the code.
Wait a few minutes. ;)
Edit: Second line.
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
Almost done.
Edit: Third line
{ 0.0056175 , 0.0036765 , 0.0015165, 0.0006445 },
Adding to code now.
-
Well, guys, whatever you're doing - keep it up. ;)
-
Originally posted by DaBrain
Uhm... that's exactly the effect I was aiming for. ;)
No, really....
Here is the fixed first line
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
I'll work out the missing two lines and add them to the code.
Wait a few minutes. ;)
Edit: Second line.
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
Almost done.
When you get them all done, I'll give it a try.
-
Got them, Trying it now.
-
Ok, try it. I doubt it'll work. ;)
If it doesnt't work, there is one thing I might change back.
shader samplePixelShader =
"!!ARBfp1.0
TEMP Temp;
TEX result.color, fragment.texcoord[0], texture[0], 2D;
END";
shader gaussianXPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader gaussianYPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader outputPixelShader =
"!!ARBfp1.0
TEMP back, blur;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
ADD result.color, back, blur;
END";
surface blur0 = allocsurf(width/4, height/4);
surface blur1 = allocsurf(width/4, height/4);
gaussianXPixelShader.constant[ 0] = { (4.0*ds_dx)* 1.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 1] = { (4.0*ds_dx)* 3.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 2] = { (4.0*ds_dx)* 5.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 3] = { (4.0*ds_dx)* 7.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 4] = { (4.0*ds_dx)* 9.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 5] = { (4.0*ds_dx)*11.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 6] = { (4.0*ds_dx)*13.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 7] = { (4.0*ds_dx)*15.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 8] = { (4.0*ds_dx)*17.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 9] = { (4.0*ds_dx)*19.45, 0, 0, 0 };
gaussianXPixelShader.constant[10] = { (4.0*ds_dx)*21.45, 0, 0, 0 };
gaussianYPixelShader.constant[ 0] = { 0, (4.0*dt_dy)* 1.45, 0, 0 };
gaussianYPixelShader.constant[ 1] = { 0, (4.0*dt_dy)* 3.45, 0, 0 };
gaussianYPixelShader.constant[ 2] = { 0, (4.0*dt_dy)* 5.45, 0, 0 };
gaussianYPixelShader.constant[ 3] = { 0, (4.0*dt_dy)* 7.45, 0, 0 };
gaussianYPixelShader.constant[ 4] = { 0, (4.0*dt_dy)* 9.45, 0, 0 };
gaussianYPixelShader.constant[ 5] = { 0, (4.0*dt_dy)*11.45, 0, 0 };
gaussianYPixelShader.constant[ 6] = { 0, (4.0*dt_dy)*13.45, 0, 0 };
gaussianYPixelShader.constant[ 7] = { 0, (4.0*dt_dy)*15.45, 0, 0 };
gaussianYPixelShader.constant[ 8] = { 0, (4.0*dt_dy)*17.45, 0, 0 };
gaussianYPixelShader.constant[ 9] = { 0, (4.0*dt_dy)*19.45, 0, 0 };
gaussianYPixelShader.constant[10] = { 0, (4.0*dt_dy)*21.45, 0, 0 };
texture[0].magfilter = "linear";
texture[0].source = backbuffer;
destination blur0;
apply samplePixelShader;
texture[0].source = blur0;
destination blur1;
apply gaussianXPixelShader;
texture[0].source = blur1;
destination blur0;
apply gaussianYPixelShader;
texture[0].source = blur0;
texture[1].source = backbuffer;
destination backbuffer;
apply outputPixelShader;
-
It worked, but it wasn't as pronounced... I'll have screenies in a second.
-
(http://3dap.com/hlp/hosted/14_year_war/Raa/bloom/screen02.jpg)
(http://3dap.com/hlp/hosted/14_year_war/Raa/bloom/screen05.jpg)
(http://3dap.com/hlp/hosted/14_year_war/Raa/bloom/screen06.jpg)
-
I got a problem with those HDRish, when i launched Fs2 with the latest Fs2_open in openGL mode, i got a messing White Screen when i have to choose my pilot profile.
-
The first shot looks really awesome. :yes:
If you're still not tired of testing shaders try this one.
shader samplePixelShader =
"!!ARBfp1.0
TEMP Temp;
TEX result.color, fragment.texcoord[0], texture[0], 2D;
END";
shader gaussianXPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[3]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[1].w, s0;
MAD s0, r1, Weight[1].z, s0;
MAD s0, r2, Weight[1].y, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[0].w, s0;
MAD s0, r5, Weight[0].z, s0;
MAD s0, r6, Weight[0].y, s0;
MAD s0, r7, Weight[0].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[0].x, s0;
MAD s0, r4, Weight[0].y, s0;
MAD s0, r5, Weight[0].z, s0;
MAD s0, r6, Weight[0].w, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[1].y, s0;
MAD s0, r9, Weight[1].z, s0;
MAD s0, r10, Weight[1].w, s0;
MOV result.color, s0;
END";
shader gaussianYPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[3]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[1].w, s0;
MAD s0, r1, Weight[1].z, s0;
MAD s0, r2, Weight[1].y, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[0].w, s0;
MAD s0, r5, Weight[0].z, s0;
MAD s0, r6, Weight[0].y, s0;
MAD s0, r7, Weight[0].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[0].x, s0;
MAD s0, r4, Weight[0].y, s0;
MAD s0, r5, Weight[0].z, s0;
MAD s0, r6, Weight[0].w, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[1].y, s0;
MAD s0, r9, Weight[1].z, s0;
MAD s0, r10, Weight[1].w, s0;
MOV result.color, s0;
END";
shader outputPixelShader =
"!!ARBfp1.0
TEMP back, blur;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
ADD result.color, back, blur;
END";
surface blur0 = allocsurf(width/4, height/4);
surface blur1 = allocsurf(width/4, height/4);
gaussianXPixelShader.constant[ 0] = { (4.0*ds_dx)* 1.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 1] = { (4.0*ds_dx)* 3.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 2] = { (4.0*ds_dx)* 5.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 3] = { (4.0*ds_dx)* 7.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 4] = { (4.0*ds_dx)* 9.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 5] = { (4.0*ds_dx)*11.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 6] = { (4.0*ds_dx)*13.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 7] = { (4.0*ds_dx)*15.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 8] = { (4.0*ds_dx)*17.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 9] = { (4.0*ds_dx)*19.45, 0, 0, 0 };
gaussianXPixelShader.constant[10] = { (4.0*ds_dx)*21.45, 0, 0, 0 };
gaussianYPixelShader.constant[ 0] = { 0, (4.0*dt_dy)* 1.45, 0, 0 };
gaussianYPixelShader.constant[ 1] = { 0, (4.0*dt_dy)* 3.45, 0, 0 };
gaussianYPixelShader.constant[ 2] = { 0, (4.0*dt_dy)* 5.45, 0, 0 };
gaussianYPixelShader.constant[ 3] = { 0, (4.0*dt_dy)* 7.45, 0, 0 };
gaussianYPixelShader.constant[ 4] = { 0, (4.0*dt_dy)* 9.45, 0, 0 };
gaussianYPixelShader.constant[ 5] = { 0, (4.0*dt_dy)*11.45, 0, 0 };
gaussianYPixelShader.constant[ 6] = { 0, (4.0*dt_dy)*13.45, 0, 0 };
gaussianYPixelShader.constant[ 7] = { 0, (4.0*dt_dy)*15.45, 0, 0 };
gaussianYPixelShader.constant[ 8] = { 0, (4.0*dt_dy)*17.45, 0, 0 };
gaussianYPixelShader.constant[ 9] = { 0, (4.0*dt_dy)*19.45, 0, 0 };
gaussianYPixelShader.constant[10] = { 0, (4.0*dt_dy)*21.45, 0, 0 };
texture[0].magfilter = "linear";
texture[0].source = backbuffer;
destination blur0;
apply samplePixelShader;
texture[0].source = blur0;
destination blur1;
apply gaussianXPixelShader;
texture[0].source = blur1;
destination blur0;
apply gaussianYPixelShader;
texture[0].source = blur0;
texture[1].source = backbuffer;
destination backbuffer;
apply outputPixelShader;
This should be more what you wanted.
-
ATi Card? Or nVidia?
Also, it may be your cats (if you're ATi). Someone on that board said there was a memory leak for user made pss files in the later cats.
Either way, if I get a decent looking setup, I'll put a little zip together for others to try easily.
-
Sorry, DaB.. that's a no-go.
-
Originally posted by MetalDestroyer
I got a problem with those HDRish, when i launched Fs2 with the latest Fs2_open in openGL mode, i got a messing White Screen when i have to choose my pilot profile.
Try a newer Catalyst. This stuff should work without problems.
@Raa I've noticed the white squares around the thrusters on your pics. Is this caused by the PS effect?
Edit:
@Raa Didn't see that comming... strange. It was supposed to reduce the intensity.
Looks like I need some practice on that.
But the one before is slightly better than the original I think.
-
I don't know. I suspect not. But I rarely use OGL. DX looks better, still, for me. I think it's the build I'm using? I dunno.
Edit: No, it's an OGL thing for me... I played without the PS and still had it.
-
It's the drivers, Raa. With newer catalysts you wouldn't have those boxes with OpenGL.
As for the PS : I tried the previous settings, but it didn't make a notable difference for me.
-
Yep i'm an ATI user (9800 pro inside), and i 've the Cat 4.11. Do you think i 've to d/l the psseffect.zip too ?
I've just d/l pssControl2.zip and the entries.zip.
-
Originally posted by mitac
It's the drivers, Raa. With newer catalysts you wouldn't have those boxes with OpenGL.
As for the PS : I tried the previous settings, but it didn't make a notable difference for me.
I'm not upgrading my cats... I don't use OGL enough to warrant losing spec in DX. :p
-
I don't know why, but it seems the whole .pss files are a pure mess into my comp.
If i copy/past the configuration from Dabrain, it work perfectly. :/
-
Well, I got spec in OpenGL. :p
-
Just wait. I'll try something else soon. ;)
-
I'm'a waitin'...
-
Oh this is bad. Looks like I'll have to become a master of shaders to achive the effect I want... I thought it was simple.
-
Meh. Well, with info like this, maybe the SCP team can use it. :) I'm going to go AFK for a bit now...
-
Originally posted by Raa
Doing that eliminated the effect.
Works for me, using cat 4.12. Still seems to wash everything out a little too much, even at .25.
-
Yeah, I had a typo. :nervous: But it still wasn't what I was hoping for...
-
Originally posted by Target
Works for me, using cat 4.12. Still seems to wash everything out a little too much, even at .25.
Well, if the code from the last page made it a bit better, I can fix it in a few minutes.
-
I retry those HDR with the Cat 4.12 and it works perfectly.
It seems Cat 4.11 hates Fs 2 open and the HDRish.
-
Originally posted by Raa
http://dynamic4.gamespy.com/~freespace/forums/attachment.php?s=&postid=597581
well now we know the shader effect to use when looking at the sun or into the Colossus exploding.
-
hrm, even though i'm not gonna try this (too much arsing around ;) ) it's a start. :nod:
-
Did you actually try changing the divisor atall?
-
Wich one?
Edit: Please give me a shot of what this one does:
shader samplePixelShader =
"!!ARBfp1.0
TEMP Temp;
TEX result.color, fragment.texcoord[0], texture[0], 2D;
END";
shader gaussianXPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader gaussianYPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader outputPixelShader =
"!!ARBfp1.0
# threshold for tag shader (try different values)
PARAM thresh = {0.5, 0.5, 0.5, 0.5};
TEMP back, blur, temp;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
# subtract threshold value from the 'back' value
SUB temp, back, thresh;
# if temp value is smaller than threshold, kill fragment
KIL blur;
ADD result.color, back, blur;
END";
shader outputPixelShader =
"!!ARBfp1.0
TEMP back, blur;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
ADD result.color, back, blur;
END";
surface blur0 = allocsurf(width/5, height/5);
surface blur1 = allocsurf(width/5, height/5);
gaussianXPixelShader.constant[ 0] = { (4.0*ds_dx)* 1.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 1] = { (4.0*ds_dx)* 3.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 2] = { (4.0*ds_dx)* 5.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 3] = { (4.0*ds_dx)* 7.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 4] = { (4.0*ds_dx)* 9.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 5] = { (4.0*ds_dx)*11.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 6] = { (4.0*ds_dx)*13.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 7] = { (4.0*ds_dx)*15.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 8] = { (4.0*ds_dx)*17.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 9] = { (4.0*ds_dx)*19.45, 0, 0, 0 };
gaussianXPixelShader.constant[10] = { (4.0*ds_dx)*21.45, 0, 0, 0 };
gaussianYPixelShader.constant[ 0] = { 0, (4.0*dt_dy)* 1.45, 0, 0 };
gaussianYPixelShader.constant[ 1] = { 0, (4.0*dt_dy)* 3.45, 0, 0 };
gaussianYPixelShader.constant[ 2] = { 0, (4.0*dt_dy)* 5.45, 0, 0 };
gaussianYPixelShader.constant[ 3] = { 0, (4.0*dt_dy)* 7.45, 0, 0 };
gaussianYPixelShader.constant[ 4] = { 0, (4.0*dt_dy)* 9.45, 0, 0 };
gaussianYPixelShader.constant[ 5] = { 0, (4.0*dt_dy)*11.45, 0, 0 };
gaussianYPixelShader.constant[ 6] = { 0, (4.0*dt_dy)*13.45, 0, 0 };
gaussianYPixelShader.constant[ 7] = { 0, (4.0*dt_dy)*15.45, 0, 0 };
gaussianYPixelShader.constant[ 8] = { 0, (4.0*dt_dy)*17.45, 0, 0 };
gaussianYPixelShader.constant[ 9] = { 0, (4.0*dt_dy)*19.45, 0, 0 };
gaussianYPixelShader.constant[10] = { 0, (4.0*dt_dy)*21.45, 0, 0 };
texture[0].magfilter = "linear";
texture[0].source = backbuffer;
destination blur0;
apply samplePixelShader;
texture[0].source = blur0;
destination blur1;
apply gaussianXPixelShader;
texture[0].source = blur1;
destination blur0;
apply gaussianYPixelShader;
texture[0].source = blur0;
texture[1].source = backbuffer;
destination backbuffer;
apply outputPixelShader;
Edit2: It could affect the performance a bit more.
-
Fs 2 crashes with your new HDRish.pss
-
The first screen is without PS, the second with those settings you posted.
(http://www.netcologne.de/~nc-muenchma2/screen01.jpg)
(http://www.netcologne.de/~nc-muenchma2/screen00.jpg)
Can't see any difference at all.
-
Ok, I need to make sure why this happens. I'll post two new codes. I hope one of them will fix it.
Try this one first:
shader samplePixelShader =
"!!ARBfp1.0
TEMP Temp;
TEX result.color, fragment.texcoord[0], texture[0], 2D;
END";
shader gaussianXPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader gaussianYPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader outputPixelShader =
"!!ARBfp1.0
# threshold for tag shader (try different values)
PARAM thresh = {0.5, 0.5, 0.5, 0.5};
TEMP back, blur, temp;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
# subtract threshold value from the 'back' value
SUB temp, back, thresh;
# if temp value is smaller than threshold, kill fragment
KIL blur;
ADD result.color, back, blur;
END";
shader outputPixelShader =
"!!ARBfp1.0
TEMP back, blur;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
ADD result.color, back, blur;
END";
surface blur0 = allocsurf(width/4, height/4);
surface blur1 = allocsurf(width/4, height/4);
gaussianXPixelShader.constant[ 0] = { (4.0*ds_dx)* 1.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 1] = { (4.0*ds_dx)* 3.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 2] = { (4.0*ds_dx)* 5.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 3] = { (4.0*ds_dx)* 7.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 4] = { (4.0*ds_dx)* 9.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 5] = { (4.0*ds_dx)*11.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 6] = { (4.0*ds_dx)*13.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 7] = { (4.0*ds_dx)*15.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 8] = { (4.0*ds_dx)*17.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 9] = { (4.0*ds_dx)*19.45, 0, 0, 0 };
gaussianXPixelShader.constant[10] = { (4.0*ds_dx)*21.45, 0, 0, 0 };
gaussianYPixelShader.constant[ 0] = { 0, (4.0*dt_dy)* 1.45, 0, 0 };
gaussianYPixelShader.constant[ 1] = { 0, (4.0*dt_dy)* 3.45, 0, 0 };
gaussianYPixelShader.constant[ 2] = { 0, (4.0*dt_dy)* 5.45, 0, 0 };
gaussianYPixelShader.constant[ 3] = { 0, (4.0*dt_dy)* 7.45, 0, 0 };
gaussianYPixelShader.constant[ 4] = { 0, (4.0*dt_dy)* 9.45, 0, 0 };
gaussianYPixelShader.constant[ 5] = { 0, (4.0*dt_dy)*11.45, 0, 0 };
gaussianYPixelShader.constant[ 6] = { 0, (4.0*dt_dy)*13.45, 0, 0 };
gaussianYPixelShader.constant[ 7] = { 0, (4.0*dt_dy)*15.45, 0, 0 };
gaussianYPixelShader.constant[ 8] = { 0, (4.0*dt_dy)*17.45, 0, 0 };
gaussianYPixelShader.constant[ 9] = { 0, (4.0*dt_dy)*19.45, 0, 0 };
gaussianYPixelShader.constant[10] = { 0, (4.0*dt_dy)*21.45, 0, 0 };
texture[0].magfilter = "linear";
texture[0].source = backbuffer;
destination blur0;
apply samplePixelShader;
texture[0].source = blur0;
destination blur1;
apply gaussianXPixelShader;
texture[0].source = blur1;
destination blur0;
apply gaussianYPixelShader;
texture[0].source = blur0;
texture[1].source = backbuffer;
destination backbuffer;
apply outputPixelShader;
-
And this is my second try:
shader samplePixelShader =
"!!ARBfp1.0
TEMP Temp;
TEX result.color, fragment.texcoord[0], texture[0], 2D;
END";
shader outputPixelShader =
"!!ARBfp1.0
# threshold for tag shader (try different values)
PARAM thresh = {0.5, 0.5, 0.5, 0.5};
TEMP back, blur, temp;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
# subtract threshold value from the 'back' value
SUB temp, back, thresh;
# if temp value is smaller than threshold, kill fragment
KIL blur;
ADD result.color, back, blur;
END";
shader gaussianXPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader gaussianYPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader outputPixelShader =
"!!ARBfp1.0
TEMP back, blur;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
ADD result.color, back, blur;
END";
surface blur0 = allocsurf(width/4, height/4);
surface blur1 = allocsurf(width/4, height/4);
gaussianXPixelShader.constant[ 0] = { (4.0*ds_dx)* 1.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 1] = { (4.0*ds_dx)* 3.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 2] = { (4.0*ds_dx)* 5.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 3] = { (4.0*ds_dx)* 7.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 4] = { (4.0*ds_dx)* 9.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 5] = { (4.0*ds_dx)*11.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 6] = { (4.0*ds_dx)*13.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 7] = { (4.0*ds_dx)*15.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 8] = { (4.0*ds_dx)*17.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 9] = { (4.0*ds_dx)*19.45, 0, 0, 0 };
gaussianXPixelShader.constant[10] = { (4.0*ds_dx)*21.45, 0, 0, 0 };
gaussianYPixelShader.constant[ 0] = { 0, (4.0*dt_dy)* 1.45, 0, 0 };
gaussianYPixelShader.constant[ 1] = { 0, (4.0*dt_dy)* 3.45, 0, 0 };
gaussianYPixelShader.constant[ 2] = { 0, (4.0*dt_dy)* 5.45, 0, 0 };
gaussianYPixelShader.constant[ 3] = { 0, (4.0*dt_dy)* 7.45, 0, 0 };
gaussianYPixelShader.constant[ 4] = { 0, (4.0*dt_dy)* 9.45, 0, 0 };
gaussianYPixelShader.constant[ 5] = { 0, (4.0*dt_dy)*11.45, 0, 0 };
gaussianYPixelShader.constant[ 6] = { 0, (4.0*dt_dy)*13.45, 0, 0 };
gaussianYPixelShader.constant[ 7] = { 0, (4.0*dt_dy)*15.45, 0, 0 };
gaussianYPixelShader.constant[ 8] = { 0, (4.0*dt_dy)*17.45, 0, 0 };
gaussianYPixelShader.constant[ 9] = { 0, (4.0*dt_dy)*19.45, 0, 0 };
gaussianYPixelShader.constant[10] = { 0, (4.0*dt_dy)*21.45, 0, 0 };
texture[0].magfilter = "linear";
texture[0].source = backbuffer;
destination blur0;
apply samplePixelShader;
texture[0].source = blur0;
destination blur1;
apply gaussianXPixelShader;
texture[0].source = blur1;
destination blur0;
apply gaussianYPixelShader;
texture[0].source = blur0;
texture[1].source = backbuffer;
destination backbuffer;
apply outputPixelShader;
-
They're supposed to look all the same, are they? :doubt:
-
Uhm, no.
Do they look the same?
-
im trying out the second entry now. piccies to come :D
Oh - and it only works with ATI cards right?
-
Yeah. Though I get the impression it's linked to my machine; I see no difference between the PS and non-PS setup, with the exception of the original build in the .zip file.
Edit : and, yeah, it's an ATI card here. ;)
-
same here...not much difference seemingly.
Just to check though, do we need the other files from that directory? Or will only the two you suggested do?
-
The other files from the zip will have other effects.
But I think HDRish is the best.
I really don't understad why this doesn't work.
:(
The last code should at least give some result.
Edit: Please try this one:
shader outputPixelShader =
"!!ARBfp1.0
# threshold for tag shader (try different values)
PARAM thresh = {0.5, 0.5, 0.5, 0.5};
TEMP back, blur, temp;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
# subtract threshold value from the 'back' value
SUB temp, back, thresh;
# if temp value is smaller than threshold, kill fragment
KIL blur;
ADD result.color, back, blur;
END";
If this works I'll replace the blurs with gaussian filters.
-
Perhaps you disable the HDRish effect ^^
So, i try the Motion Blur , the Ghost.pss from the pssEffect.zip and The blur are everywhere.
But, they are too many that after 5 min playing with these, i got a headack.
-
I think I've found the problem. But test the small pice of code before I post the fixed code.
-
I've just tested and Fs 2 crashes too :\
-
I notice nothing new in the TBP 3.0.
-
Ok, last try for now:
shader samplePixelShader =
"!!ARBfp1.0
TEMP Temp;
TEX result.color, fragment.texcoord[0], texture[0], 2D;
END";
shader gaussianXPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[3]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader gaussianYPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[3]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader outputPixelShader =
"!!ARBfp1.0
PARAM thresh = {0.5, 0.5, 0.5, 0.5};
TEMP back, blur, temp;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
SUB temp, back, thresh;
KIL blur;
ADD result.color, back, blur;
END";
surface blur0 = allocsurf(width/4, height/4);
surface blur1 = allocsurf(width/4, height/4);
gaussianXPixelShader.constant[ 0] = { (4.0*ds_dx)* 1.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 1] = { (4.0*ds_dx)* 3.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 2] = { (4.0*ds_dx)* 5.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 3] = { (4.0*ds_dx)* 7.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 4] = { (4.0*ds_dx)* 9.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 5] = { (4.0*ds_dx)*11.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 6] = { (4.0*ds_dx)*13.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 7] = { (4.0*ds_dx)*15.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 8] = { (4.0*ds_dx)*17.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 9] = { (4.0*ds_dx)*19.45, 0, 0, 0 };
gaussianXPixelShader.constant[10] = { (4.0*ds_dx)*21.45, 0, 0, 0 };
gaussianYPixelShader.constant[ 0] = { 0, (4.0*dt_dy)* 1.45, 0, 0 };
gaussianYPixelShader.constant[ 1] = { 0, (4.0*dt_dy)* 3.45, 0, 0 };
gaussianYPixelShader.constant[ 2] = { 0, (4.0*dt_dy)* 5.45, 0, 0 };
gaussianYPixelShader.constant[ 3] = { 0, (4.0*dt_dy)* 7.45, 0, 0 };
gaussianYPixelShader.constant[ 4] = { 0, (4.0*dt_dy)* 9.45, 0, 0 };
gaussianYPixelShader.constant[ 5] = { 0, (4.0*dt_dy)*11.45, 0, 0 };
gaussianYPixelShader.constant[ 6] = { 0, (4.0*dt_dy)*13.45, 0, 0 };
gaussianYPixelShader.constant[ 7] = { 0, (4.0*dt_dy)*15.45, 0, 0 };
gaussianYPixelShader.constant[ 8] = { 0, (4.0*dt_dy)*17.45, 0, 0 };
gaussianYPixelShader.constant[ 9] = { 0, (4.0*dt_dy)*19.45, 0, 0 };
gaussianYPixelShader.constant[10] = { 0, (4.0*dt_dy)*21.45, 0, 0 };
texture[0].magfilter = "linear";
texture[0].source = backbuffer;
destination blur0;
apply samplePixelShader;
texture[0].source = blur0;
destination blur1;
apply gaussianXPixelShader;
texture[0].source = blur1;
destination blur0;
apply gaussianYPixelShader;
texture[0].source = blur0;
texture[1].source = backbuffer;
destination backbuffer;
apply outputPixelShader;
-
Nothing new in TBP 3.0 and it crashes Fs2_open when playing a fs2 mission.
-
I've absolutely no hope this one will work:
shader samplePixelShader =
"!!ARBfp1.0
TEMP Temp;
TEX result.color, fragment.texcoord[0], texture[0], 2D;
END";
shader gaussianXPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.182008, 0.116053, 0.073999, 0.047184 },
{ 0.030086, 0.019183, 0.012232, 0.007799 },
{ 0.004973, 0.003171, 0.002022, 0.001289 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader gaussianYPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.182008, 0.116053, 0.073999, 0.047184 },
{ 0.030086, 0.019183, 0.012232, 0.007799 },
{ 0.004973, 0.003171, 0.002022, 0.001289 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader outputPixelShader =
"!!ARBfp1.0
TEMP back, blur;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
ADD result.color, back, blur;
END";
surface blur0 = allocsurf(width/5, height/5);
surface blur1 = allocsurf(width/5, height/5);
gaussianXPixelShader.constant[ 0] = { (4.0*ds_dx)* 1.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 1] = { (4.0*ds_dx)* 3.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 2] = { (4.0*ds_dx)* 5.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 3] = { (4.0*ds_dx)* 7.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 4] = { (4.0*ds_dx)* 9.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 5] = { (4.0*ds_dx)*11.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 6] = { (4.0*ds_dx)*13.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 7] = { (4.0*ds_dx)*15.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 8] = { (4.0*ds_dx)*17.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 9] = { (4.0*ds_dx)*19.45, 0, 0, 0 };
gaussianXPixelShader.constant[10] = { (4.0*ds_dx)*21.45, 0, 0, 0 };
gaussianYPixelShader.constant[ 0] = { 0, (4.0*dt_dy)* 1.45, 0, 0 };
gaussianYPixelShader.constant[ 1] = { 0, (4.0*dt_dy)* 3.45, 0, 0 };
gaussianYPixelShader.constant[ 2] = { 0, (4.0*dt_dy)* 5.45, 0, 0 };
gaussianYPixelShader.constant[ 3] = { 0, (4.0*dt_dy)* 7.45, 0, 0 };
gaussianYPixelShader.constant[ 4] = { 0, (4.0*dt_dy)* 9.45, 0, 0 };
gaussianYPixelShader.constant[ 5] = { 0, (4.0*dt_dy)*11.45, 0, 0 };
gaussianYPixelShader.constant[ 6] = { 0, (4.0*dt_dy)*13.45, 0, 0 };
gaussianYPixelShader.constant[ 7] = { 0, (4.0*dt_dy)*15.45, 0, 0 };
gaussianYPixelShader.constant[ 8] = { 0, (4.0*dt_dy)*17.45, 0, 0 };
gaussianYPixelShader.constant[ 9] = { 0, (4.0*dt_dy)*19.45, 0, 0 };
gaussianYPixelShader.constant[10] = { 0, (4.0*dt_dy)*21.45, 0, 0 };
texture[0].magfilter = "linear";
texture[0].source = backbuffer;
destination blur0;
apply samplePixelShader;
texture[0].source = blur0;
destination blur1;
apply gaussianXPixelShader;
texture[0].source = blur1;
destination blur0;
apply gaussianYPixelShader;
texture[0].source = blur0;
texture[1].source = backbuffer;
destination backbuffer;
apply outputPixelShader;
-
Originally posted by DaBrain
Ok, last try for now:
This one's effect is similar to the original HDRish.pss It does work. I'll test the rest, soon.
-
Originally posted by DaBrain
The other files from the zip will have other effects.
But I think HDRish is the best.
I really don't understad why this doesn't work.
:(
The last code should at least give some result.
Edit: Please try this one:
shader outputPixelShader =
"!!ARBfp1.0
# threshold for tag shader (try different values)
PARAM thresh = {0.5, 0.5, 0.5, 0.5};
TEMP back, blur, temp;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
# subtract threshold value from the 'back' value
SUB temp, back, thresh;
# if temp value is smaller than threshold, kill fragment
KIL blur;
ADD result.color, back, blur;
END";
If this works I'll replace the blurs with gaussian filters. [/B]
This one makes everything look like stock, until a very bright highlight is shown, when it blooms. I like this one, so far. :)
...edit. Actually. I'm not seeing a difference in game, where aws I was in the tech room. Perhaps my mind id decieveing me.
-
That's good news. ;)
Well, then this might work too.
It detects darker parts and will not add blooom to them.
It's also a little test of reducing the gaussian size again.
But this time a bit more.
(I think I've broken the total sum, but I think that's ok, as it worked before with an altered total sum.)
BTW the code I've posted before may have a similar outcome, but it's not exactly the same the HDRish.pss.
I've increased the surface size, to see what happens. I think the boom quality (detail) should be higher.
I think I'll try higher values (8x8) later. But I'm sure that this will affect the performance.
shader samplePixelShader =
"!!ARBfp1.0
TEMP Temp;
TEX result.color, fragment.texcoord[0], texture[0], 2D;
END";
shader gaussianXPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.3, 0.2, 1, 0.0 },
{ 0.03, 0.02, 0.01, 0.0 },
{ 0.003, 0.002, 0.001, 0.0 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader gaussianYPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.3, 0.2, 1, 0.0 },
{ 0.03, 0.02, 0.01, 0.0 },
{ 0.003, 0.002, 0.001, 0.0 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader outputPixelShader =
"!!ARBfp1.0
TEMP back, blur;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
SUB temp, back, thresh;
KIL blur;
ADD result.color, back, blur;
END";
surface blur0 = allocsurf(width/5, height/5);
surface blur1 = allocsurf(width/5, height/5);
gaussianXPixelShader.constant[ 0] = { (4.0*ds_dx)* 1.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 1] = { (4.0*ds_dx)* 3.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 2] = { (4.0*ds_dx)* 5.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 3] = { (4.0*ds_dx)* 7.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 4] = { (4.0*ds_dx)* 9.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 5] = { (4.0*ds_dx)*11.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 6] = { (4.0*ds_dx)*13.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 7] = { (4.0*ds_dx)*15.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 8] = { (4.0*ds_dx)*17.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 9] = { (4.0*ds_dx)*19.45, 0, 0, 0 };
gaussianXPixelShader.constant[10] = { (4.0*ds_dx)*21.45, 0, 0, 0 };
gaussianYPixelShader.constant[ 0] = { 0, (4.0*dt_dy)* 1.45, 0, 0 };
gaussianYPixelShader.constant[ 1] = { 0, (4.0*dt_dy)* 3.45, 0, 0 };
gaussianYPixelShader.constant[ 2] = { 0, (4.0*dt_dy)* 5.45, 0, 0 };
gaussianYPixelShader.constant[ 3] = { 0, (4.0*dt_dy)* 7.45, 0, 0 };
gaussianYPixelShader.constant[ 4] = { 0, (4.0*dt_dy)* 9.45, 0, 0 };
gaussianYPixelShader.constant[ 5] = { 0, (4.0*dt_dy)*11.45, 0, 0 };
gaussianYPixelShader.constant[ 6] = { 0, (4.0*dt_dy)*13.45, 0, 0 };
gaussianYPixelShader.constant[ 7] = { 0, (4.0*dt_dy)*15.45, 0, 0 };
gaussianYPixelShader.constant[ 8] = { 0, (4.0*dt_dy)*17.45, 0, 0 };
gaussianYPixelShader.constant[ 9] = { 0, (4.0*dt_dy)*19.45, 0, 0 };
gaussianYPixelShader.constant[10] = { 0, (4.0*dt_dy)*21.45, 0, 0 };
texture[0].magfilter = "linear";
texture[0].source = backbuffer;
destination blur0;
apply samplePixelShader;
texture[0].source = blur0;
destination blur1;
apply gaussianXPixelShader;
texture[0].source = blur1;
destination blur0;
apply gaussianYPixelShader;
texture[0].source = blur0;
texture[1].source = backbuffer;
destination backbuffer;
apply outputPixelShader;
-
Originally posted by Raa
This one makes everything look like stock, until a very bright highlight is shown, when it blooms. I like this one, so far. :)
...edit. Actually. I'm not seeing a difference in game, where aws I was in the tech room. Perhaps my mind id decieveing me.
No crash? Perfect! That's even better.
Edit: Let's play a bit around with this one.
shader outputPixelShader =
"!!ARBfp1.0
# threshold for tag shader (try different values)
PARAM thresh = {0.25, 0.25, 0.25, 0.25};
TEMP back, blur, temp;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
# subtract threshold value from the 'back' value
SUB temp, back, thresh;
# if temp value is smaller than threshold, kill fragment
KIL blur;
ADD result.color, back, blur;
END";
-
Well, id doesn't crash anything (I suspect those crashes where their PCor version of FSO''s fault. Or that they are using newer cats, and support hasn't been continued for them. Or even that the memory leak that was mentioned on that other forum applies to them, and not to 4.4 )
In either case, it doesn't really do anything.
-
If the second version doesn't have any effect too, try to remove the SUB line. If that doesn't work also, there is something wrong in the first lines.
-
Ok, removing sub makes it a bit more pronounced. Do you think you could get the blur to overshoot the model a little bit, though? As it is, it's not gaussian enough.
-
Originally posted by Raa
Well, id doesn't crash anything (I suspect those crashes where their PCor version of FSO''s fault. Or that they are using newer cats, and support hasn't been continued for them. Or even that the memory leak that was mentioned on that other forum applies to them, and not to 4.4 )
In either case, it doesn't really do anything.
Hmmm, Rhaa which version of fso and Cat do you use ?
I try 3 exe, the 01032005, the 12302005 and another one i forgot.
I use the latest Media VP 3.6.5.
-
Well, uhm... I've added the gaussian filters again.
And I've left out the sampleshader.
So it could work. But perhaps I'll have to reorganize the structure.
shader gaussianXPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader gaussianYPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader outputPixelShader =
"!!ARBfp1.0
# threshold for tag shader (try different values)
PARAM thresh = {0.5, 0.5, 0.5, 0.5};
TEMP back, blur, temp;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
# if temp value is smaller than threshold, kill fragment
KIL blur;
ADD result.color, back, blur;
END";
surface blur0 = allocsurf(width/4, height/4);
surface blur1 = allocsurf(width/4, height/4);
gaussianXPixelShader.constant[ 0] = { (4.0*ds_dx)* 1.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 1] = { (4.0*ds_dx)* 3.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 2] = { (4.0*ds_dx)* 5.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 3] = { (4.0*ds_dx)* 7.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 4] = { (4.0*ds_dx)* 9.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 5] = { (4.0*ds_dx)*11.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 6] = { (4.0*ds_dx)*13.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 7] = { (4.0*ds_dx)*15.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 8] = { (4.0*ds_dx)*17.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 9] = { (4.0*ds_dx)*19.45, 0, 0, 0 };
gaussianXPixelShader.constant[10] = { (4.0*ds_dx)*21.45, 0, 0, 0 };
gaussianYPixelShader.constant[ 0] = { 0, (4.0*dt_dy)* 1.45, 0, 0 };
gaussianYPixelShader.constant[ 1] = { 0, (4.0*dt_dy)* 3.45, 0, 0 };
gaussianYPixelShader.constant[ 2] = { 0, (4.0*dt_dy)* 5.45, 0, 0 };
gaussianYPixelShader.constant[ 3] = { 0, (4.0*dt_dy)* 7.45, 0, 0 };
gaussianYPixelShader.constant[ 4] = { 0, (4.0*dt_dy)* 9.45, 0, 0 };
gaussianYPixelShader.constant[ 5] = { 0, (4.0*dt_dy)*11.45, 0, 0 };
gaussianYPixelShader.constant[ 6] = { 0, (4.0*dt_dy)*13.45, 0, 0 };
gaussianYPixelShader.constant[ 7] = { 0, (4.0*dt_dy)*15.45, 0, 0 };
gaussianYPixelShader.constant[ 8] = { 0, (4.0*dt_dy)*17.45, 0, 0 };
gaussianYPixelShader.constant[ 9] = { 0, (4.0*dt_dy)*19.45, 0, 0 };
gaussianYPixelShader.constant[10] = { 0, (4.0*dt_dy)*21.45, 0, 0 };
texture[0].magfilter = "linear";
texture[0].source = blur0;
destination blur1;
apply gaussianXPixelShader;
texture[0].source = blur1;
destination blur0;
apply gaussianYPixelShader;
texture[0].source = blur0;
texture[1].source = backbuffer;
destination backbuffer;
apply outputPixelShader;
-
Originally posted by MetalDestroyer
Hmmm, Rhaa which version of fso and Cat do you use ?
I try 3 exe, the 01032005, the 12302005 and another one i forgot.
I use the latest Media VP 3.6.5.
20050103 - exe
Cat 4.4
No media VP's I assemble my owb effects, so I have freespace looking exactly how I want it to look, and not how everyone else likes. :)
@DaB - Not a big effect there... See?
-
:( I try all the Dabrain version and all make Fs1_open crashes except his first modif.
And if i run his modif into TBP 3.0 i see no difference with the original version of TBP. :(
-
Originally posted by Raa
20050103 - exe
Cat 4.4
No media VP's I assemble my owb effects, so I have freespace looking exactly how I want it to look, and not how everyone else likes. :)
@DaB - Not a big effect there... See?
Ok, looks like it won't work without the sampleshader.
Well, ok. I've readded the entries:
shader samplePixelShader =
"!!ARBfp1.0
TEMP Temp;
TEX result.color, fragment.texcoord[0], texture[0], 2D;
END";
shader gaussianXPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader gaussianYPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[2]=
{
{ 0.2056, 0.13455275, 0.05549925, 0.023592 },
{ 0.0339855, 0.022268, 0.009174, 0.0038995 },
{ 0.0056175, 0.0036765, 0.0015165, 0.0006445 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader outputPixelShader =
"!!ARBfp1.0
# threshold for tag shader (try different values)
PARAM thresh = {0.5, 0.5, 0.5, 0.5};
TEMP back, blur, temp;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
# if temp value is smaller than threshold, kill fragment
KIL blur;
ADD result.color, back, blur;
END";
surface blur0 = allocsurf(width/4, height/4);
surface blur1 = allocsurf(width/4, height/4);
gaussianXPixelShader.constant[ 0] = { (4.0*ds_dx)* 1.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 1] = { (4.0*ds_dx)* 3.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 2] = { (4.0*ds_dx)* 5.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 3] = { (4.0*ds_dx)* 7.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 4] = { (4.0*ds_dx)* 9.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 5] = { (4.0*ds_dx)*11.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 6] = { (4.0*ds_dx)*13.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 7] = { (4.0*ds_dx)*15.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 8] = { (4.0*ds_dx)*17.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 9] = { (4.0*ds_dx)*19.45, 0, 0, 0 };
gaussianXPixelShader.constant[10] = { (4.0*ds_dx)*21.45, 0, 0, 0 };
gaussianYPixelShader.constant[ 0] = { 0, (4.0*dt_dy)* 1.45, 0, 0 };
gaussianYPixelShader.constant[ 1] = { 0, (4.0*dt_dy)* 3.45, 0, 0 };
gaussianYPixelShader.constant[ 2] = { 0, (4.0*dt_dy)* 5.45, 0, 0 };
gaussianYPixelShader.constant[ 3] = { 0, (4.0*dt_dy)* 7.45, 0, 0 };
gaussianYPixelShader.constant[ 4] = { 0, (4.0*dt_dy)* 9.45, 0, 0 };
gaussianYPixelShader.constant[ 5] = { 0, (4.0*dt_dy)*11.45, 0, 0 };
gaussianYPixelShader.constant[ 6] = { 0, (4.0*dt_dy)*13.45, 0, 0 };
gaussianYPixelShader.constant[ 7] = { 0, (4.0*dt_dy)*15.45, 0, 0 };
gaussianYPixelShader.constant[ 8] = { 0, (4.0*dt_dy)*17.45, 0, 0 };
gaussianYPixelShader.constant[ 9] = { 0, (4.0*dt_dy)*19.45, 0, 0 };
gaussianYPixelShader.constant[10] = { 0, (4.0*dt_dy)*21.45, 0, 0 };
texture[0].magfilter = "linear";
texture[0].source = backbuffer;
destination blur0;
apply samplePixelShader;
texture[0].source = blur0;
destination blur1;
apply gaussianXPixelShader;
texture[0].source = blur1;
destination blur0;
apply gaussianYPixelShader;
texture[0].source = blur0;
texture[1].source = backbuffer;
destination backbuffer;
apply outputPixelShader;
Originally posted by MetalDestroyer
:( I try all the Dabrain version and all make Fs1_open crashes except his first modif.
And if i run his modif into TBP 3.0 i see no difference with the original version of TBP. :(
Very strange. Well, most of the code I've posted doesn't work.
Try the code on the bottom of the first page. It should give you a slightly better result than the original HDRish effect.
If it doesn't have any effect, something is wrong with either you machine or your drivers. Cause the postfilters have nothing to do with the engine they're used with.
Edit2: Ok, I think I made a mistake. I think I have to place the gaussians behind the selective filter.
But try the code above anyway.
-
Nah. DaB I think we're just wasting eachother's time with this. Let's just wait until the FSO guys get it working, because as it is, we'll never get the effet we're trying to.
-
I think it's only a matter of time. But you're right we cannot get any too complex effects from this. It's only a postfilter.
But we could try something less complicated, like simple blur on only red (shivans ;) ) parts of the screen. Just to achive a slight bloom effect.
-
If it was possible yo get a bloom on only the pure red, pure blue, and pure green colors, for glowmaps, it might be nice. ;)
-
Here is an FS2_open optimized HDRish postfilter.
It's 100% working. Though it's not not perfect, it's far better for FS2 than the original effect.
shader samplePixelShader =
"!!ARBfp1.0
TEMP Temp;
TEX result.color, fragment.texcoord[0], texture[0], 2D;
END";
shader gaussianXPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[3]=
{
{ 0.2, 0.1, 0.05, 0.02 },
{ 0.02, 0.01, 0.005, 0.002 },
{ 0.004, 0.002, 0.001, 0.00025 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 8], fragment.texcoord[0];
ADD r2, -Offset[ 7], fragment.texcoord[0];
ADD r3, -Offset[ 6], fragment.texcoord[0];
ADD r4, -Offset[ 5], fragment.texcoord[0];
ADD r5, -Offset[ 4], fragment.texcoord[0];
ADD r6, -Offset[ 3], fragment.texcoord[0];
ADD r7, -Offset[ 2], fragment.texcoord[0];
ADD r8, -Offset[ 1], fragment.texcoord[0];
ADD r9, -Offset[ 0], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[1].w, s0;
MAD s0, r1, Weight[1].z, s0;
MAD s0, r2, Weight[1].y, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[1].y, s0;
MAD s0, r9, Weight[1].z, s0;
MAD s0, r10, Weight[1].w, s0;
MOV result.color, s0;
END";
shader gaussianYPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[3]=
{
{ 0.2, 0.1, 0.05, 0.02 },
{ 0.02, 0.01, 0.005, 0.002 },
{ 0.004, 0.002, 0.001, 0.00025 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[1].w, s0;
MAD s0, r1, Weight[1].z, s0;
MAD s0, r2, Weight[1].y, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 0], fragment.texcoord[0];
ADD r2, Offset[ 1], fragment.texcoord[0];
ADD r3, Offset[ 2], fragment.texcoord[0];
ADD r4, Offset[ 3], fragment.texcoord[0];
ADD r5, Offset[ 4], fragment.texcoord[0];
ADD r6, Offset[ 5], fragment.texcoord[0];
ADD r7, Offset[ 6], fragment.texcoord[0];
ADD r8, Offset[ 7], fragment.texcoord[0];
ADD r9, Offset[ 8], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[1].y, s0;
MAD s0, r9, Weight[1].z, s0;
MAD s0, r10, Weight[1].w, s0;
MOV result.color, s0;
END";
shader outputPixelShader =
"!!ARBfp1.0
TEMP back, blur;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
ADD result.color, back, blur;
END";
shader outputPixelShader2 =
"!!ARBfp1.0
# threshold for tag shader (try different values)
PARAM thresh = {0.5, 0.5, 0.5, 0.5};
TEMP back, blur, temp;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
# subtract threshold value from the 'back' value
SUB temp, back, thresh;
# if temp value is smaller than threshold, kill fragment
KIL blur;
ADD result.color, back, blur;
END";
surface blur0 = allocsurf(width/8, height/8);
surface blur1 = allocsurf(width/8, height/8);
gaussianXPixelShader.constant[ 0] = { (4.0*ds_dx)* 1.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 1] = { (4.0*ds_dx)* 3.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 2] = { (4.0*ds_dx)* 5.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 3] = { (4.0*ds_dx)* 7.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 4] = { (4.0*ds_dx)* 9.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 5] = { (4.0*ds_dx)*11.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 6] = { (4.0*ds_dx)*13.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 7] = { (4.0*ds_dx)*15.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 8] = { (4.0*ds_dx)*17.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 9] = { (4.0*ds_dx)*19.45, 0, 0, 0 };
gaussianXPixelShader.constant[10] = { (4.0*ds_dx)*21.45, 0, 0, 0 };
gaussianYPixelShader.constant[ 0] = { 0, (4.0*dt_dy)* 1.45, 0, 0 };
gaussianYPixelShader.constant[ 1] = { 0, (4.0*dt_dy)* 3.45, 0, 0 };
gaussianYPixelShader.constant[ 2] = { 0, (4.0*dt_dy)* 5.45, 0, 0 };
gaussianYPixelShader.constant[ 3] = { 0, (4.0*dt_dy)* 7.45, 0, 0 };
gaussianYPixelShader.constant[ 4] = { 0, (4.0*dt_dy)* 9.45, 0, 0 };
gaussianYPixelShader.constant[ 5] = { 0, (4.0*dt_dy)*11.45, 0, 0 };
gaussianYPixelShader.constant[ 6] = { 0, (4.0*dt_dy)*13.45, 0, 0 };
gaussianYPixelShader.constant[ 7] = { 0, (4.0*dt_dy)*15.45, 0, 0 };
gaussianYPixelShader.constant[ 8] = { 0, (4.0*dt_dy)*17.45, 0, 0 };
gaussianYPixelShader.constant[ 9] = { 0, (4.0*dt_dy)*19.45, 0, 0 };
gaussianYPixelShader.constant[10] = { 0, (4.0*dt_dy)*21.45, 0, 0 };
texture[0].magfilter = "linear";
texture[0].source = backbuffer;
destination blur0;
apply samplePixelShader;
texture[0].source = blur0;
destination blur1;
apply gaussianXPixelShader;
texture[0].source = blur1;
destination blur0;
apply gaussianYPixelShader;
texture[0].source = blur0;
texture[0].source = blur1;
texture[1].source = backbuffer;
destination backbuffer;
apply outputPixelShader2;
-
Originally posted by DaBrain
Here is an FS2_open optimized HDRish postfilter.
It's 100% working. Though it's not not perfect, it's far better for FS2 than the original effect.
...
[/B]
It's definitively the best HDRish i 've got.
Here some Comparaison :
With your HDRish :
(http://img120.exs.cx/img120/8868/Freespace2_HDRish_Dabrain.th.jpg) (http://img120.exs.cx/my.php?loc=img120&image=Freespace2_HDRish_Dabrain.jpg)
Without the HDR :
(http://img107.exs.cx/img107/213/Freespace2_sans_HDR.th.jpg) (http://img107.exs.cx/my.php?loc=img107&image=Freespace2_sans_HDR.jpg)
But, unfortunately, i still have Fs2 crashes. I think Fs2_open hate my OpenGL systems :(
-
Originally posted by DaBrain
Here is an FS2_open optimized HDRish postfilter.
It's 100% working. Though it's not not perfect, it's far better for FS2 than the original effect.
Nope. It looks all weird and shimmery, and the blur seems to be mostly horizontal.
-
You're right about the horizontal thing. I'm not sure why it is that way. I'm sure I did all changes to the X and Y Gaussian the same way.
But I like it. It looks pretty cool IMO.
-
This one will give you a slightly different effect. (Not very much different.)
It's supposed to detect dark pixels and to exclude them from the blooming.
For now the effect is very weak, but I think it works already.
Download (http://www.8ung.at/dabrain/test_DA5.pss)
-
Originally posted by DaBrain
You're right about the horizontal thing. I'm not sure why it is that way. I'm sure I did all changes to the X and Y Gaussian the same way.
But I like it. It looks pretty cool IMO.
Anyway, you can take some pss code from the Ghost.pss (from pssEffect.zip) and include the blur effect into the HDRish.pss.
The blur effect from the Ghost is perfect but they are too many that you can't play OpenGL game anylonger.
-
This is for Radeon cards only, right?
Is there any way you can set it so that it shows up only for things of a certain brightness?
-
Originally posted by DaBrain
This one will give you a slightly different effect. (Not very much different.)
It's supposed to detect dark pixels and to exclude them from the blooming.
For now the effect is very weak, but I think it works already.
Download (http://www.8ung.at/dabrain/test_DA5.pss)
If this didn't only work on the Horizontal, it'd be great (except for the way it pulls the regular hull colors to the sides, too, but that can't be helped)
-
this doesnt work with 4.4's does it?
-
Try this, I add the Motion Blur from the Ghost file into one of the Dabrain HDRish. You can see how the motion blur reacts.
You got blur when you move your ship on any direction and when you use Afterburner. In other case like Flying right ahead the blur disapear.
shader samplePixelShader =
"!!ARBfp1.0
TEMP Temp;
TEX result.color, fragment.texcoord[0], texture[0], 2D;
END";
shader gaussianXPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[3]=
{
{ 0.2, 0.1, 0.05, 0.02 },
{ 0.02, 0.01, 0.005, 0.002 },
{ 0.004, 0.002, 0.001, 0.00025 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 8], fragment.texcoord[0];
ADD r2, -Offset[ 7], fragment.texcoord[0];
ADD r3, -Offset[ 6], fragment.texcoord[0];
ADD r4, -Offset[ 5], fragment.texcoord[0];
ADD r5, -Offset[ 4], fragment.texcoord[0];
ADD r6, -Offset[ 3], fragment.texcoord[0];
ADD r7, -Offset[ 2], fragment.texcoord[0];
ADD r8, -Offset[ 1], fragment.texcoord[0];
ADD r9, -Offset[ 0], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[1].w, s0;
MAD s0, r1, Weight[1].z, s0;
MAD s0, r2, Weight[1].y, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[1].y, s0;
MAD s0, r9, Weight[1].z, s0;
MAD s0, r10, Weight[1].w, s0;
MOV result.color, s0;
END";
shader gaussianYPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[3]=
{
{ 0.2, 0.1, 0.05, 0.02 },
{ 0.02, 0.01, 0.005, 0.002 },
{ 0.004, 0.002, 0.001, 0.00025 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[1].w, s0;
MAD s0, r1, Weight[1].z, s0;
MAD s0, r2, Weight[1].y, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 0], fragment.texcoord[0];
ADD r2, Offset[ 1], fragment.texcoord[0];
ADD r3, Offset[ 2], fragment.texcoord[0];
ADD r4, Offset[ 3], fragment.texcoord[0];
ADD r5, Offset[ 4], fragment.texcoord[0];
ADD r6, Offset[ 5], fragment.texcoord[0];
ADD r7, Offset[ 6], fragment.texcoord[0];
ADD r8, Offset[ 7], fragment.texcoord[0];
ADD r9, Offset[ 8], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[1].y, s0;
MAD s0, r9, Weight[1].z, s0;
MAD s0, r10, Weight[1].w, s0;
MOV result.color, s0;
END";
shader outputPixelShader =
"!!ARBfp1.0
TEMP back, blur;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
ADD result.color, back, blur;
END";
shader outputPixelShader2 =
"!!ARBfp1.0
# threshold for tag shader (try different values)
PARAM thresh = {0.5, 0.5, 0.5, 0.5};
TEMP back, blur, temp;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
# subtract threshold value from the 'back' value
SUB temp, back, thresh;
# if temp value is smaller than threshold, kill fragment
KIL blur;
ADD result.color, back, blur;
END";
surface blur0 = allocsurf(width/8, height/8);
surface blur1 = allocsurf(width/8, height/8);
gaussianXPixelShader.constant[ 0] = { (4.0*ds_dx)* 1.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 1] = { (4.0*ds_dx)* 3.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 2] = { (4.0*ds_dx)* 5.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 3] = { (4.0*ds_dx)* 7.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 4] = { (4.0*ds_dx)* 9.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 5] = { (4.0*ds_dx)*11.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 6] = { (4.0*ds_dx)*13.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 7] = { (4.0*ds_dx)*15.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 8] = { (4.0*ds_dx)*17.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 9] = { (4.0*ds_dx)*19.45, 0, 0, 0 };
gaussianXPixelShader.constant[10] = { (4.0*ds_dx)*21.45, 0, 0, 0 };
gaussianYPixelShader.constant[ 0] = { 0, (4.0*dt_dy)* 1.45, 0, 0 };
gaussianYPixelShader.constant[ 1] = { 0, (4.0*dt_dy)* 3.45, 0, 0 };
gaussianYPixelShader.constant[ 2] = { 0, (4.0*dt_dy)* 5.45, 0, 0 };
gaussianYPixelShader.constant[ 3] = { 0, (4.0*dt_dy)* 7.45, 0, 0 };
gaussianYPixelShader.constant[ 4] = { 0, (4.0*dt_dy)* 9.45, 0, 0 };
gaussianYPixelShader.constant[ 5] = { 0, (4.0*dt_dy)*11.45, 0, 0 };
gaussianYPixelShader.constant[ 6] = { 0, (4.0*dt_dy)*13.45, 0, 0 };
gaussianYPixelShader.constant[ 7] = { 0, (4.0*dt_dy)*15.45, 0, 0 };
gaussianYPixelShader.constant[ 8] = { 0, (4.0*dt_dy)*17.45, 0, 0 };
gaussianYPixelShader.constant[ 9] = { 0, (4.0*dt_dy)*19.45, 0, 0 };
gaussianYPixelShader.constant[10] = { 0, (4.0*dt_dy)*21.45, 0, 0 };
texture[0].magfilter = "linear";
texture[0].source = backbuffer;
destination blur0;
apply samplePixelShader;
texture[0].source = blur0;
destination blur1;
apply gaussianXPixelShader;
texture[0].source = blur1;
destination blur0;
apply gaussianYPixelShader;
texture[0].source = blur0;
texture[0].source = blur1;
texture[1].source = backbuffer;
destination backbuffer;
apply outputPixelShader2;
shader ghostPixelShader =
"!!ARBfp1.0
# Increasing the ghostFactor will increase the severity of this effect.
# To keep things the same brightness curFrameFactor and ghostFactor should
# add up to 1.
PARAM curFrameFactor = {0.2, 0.2, 0.2, 0.0};
PARAM ghostFactor = {0.8, 0.8, 0.8, 0.0};
TEMP thisFramesPixel;
TEMP lastFramesPixel;
OUTPUT oColor = result.color;
TEX thisFramesPixel, fragment.texcoord[0], texture[0], 2D;
TEX lastFramesPixel, fragment.texcoord[0], texture[1], 2D;
MUL thisFramesPixel, thisFramesPixel, curFrameFactor;
MAD oColor, lastFramesPixel, ghostFactor, thisFramesPixel;
END";
shader copyPixelShader =
"!!ARBfp1.0
OUTPUT oColor = result.color;
TEMP pixel;
TEX pixel, fragment.texcoord[0], texture[0], 2D;
MOV oColor, pixel;
END";
surface temp = allocsurf(width, height);
texture[0].source = backbuffer;
texture[1].source = temp;
destination temp;
apply ghostPixelShader;
texture[0].source = temp;
destination backbuffer;
apply copyPixelShader;
And the Picture :
(http://img153.exs.cx/img153/1512/Freespace2_HDRish_Dabrain_With_Ghost.th.jpg) (http://img153.exs.cx/my.php?loc=img153&image=Freespace2_HDRish_Dabrain_With_Ghost.jpg)
The code I added for the Blur :
shader ghostPixelShader =
"!!ARBfp1.0
# Increasing the ghostFactor will increase the severity of this effect.
# To keep things the same brightness curFrameFactor and ghostFactor should
# add up to 1.
PARAM curFrameFactor = {0.2, 0.2, 0.2, 0.0};
PARAM ghostFactor = {0.8, 0.8, 0.8, 0.0};
TEMP thisFramesPixel;
TEMP lastFramesPixel;
OUTPUT oColor = result.color;
TEX thisFramesPixel, fragment.texcoord[0], texture[0], 2D;
TEX lastFramesPixel, fragment.texcoord[0], texture[1], 2D;
MUL thisFramesPixel, thisFramesPixel, curFrameFactor;
MAD oColor, lastFramesPixel, ghostFactor, thisFramesPixel;
END";
shader copyPixelShader =
"!!ARBfp1.0
OUTPUT oColor = result.color;
TEMP pixel;
TEX pixel, fragment.texcoord[0], texture[0], 2D;
MOV oColor, pixel;
END";
surface temp = allocsurf(width, height);
texture[0].source = backbuffer;
texture[1].source = temp;
destination temp;
apply ghostPixelShader;
texture[0].source = temp;
destination backbuffer;
apply copyPixelShader;
-
Good idea. :yes:
So it only blurs in motion? I think that's a nice effect.
It looks a bit too blured on the shot, but I think it looks better in-game.
I'll try to get my hands on a Radeon notebook again. ;)
-
No, it's totally too blured in games, the same as the shot :D
So, i try to reduce this effect in the ghostPixelShader, I think.
-
I change a minor parameters, now the screen are less blur than the original.
Take a look :
Before :
(http://img153.exs.cx/img153/1512/Freespace2_HDRish_Dabrain_With_Ghost.th.jpg) (http://img153.exs.cx/my.php?loc=img153&image=Freespace2_HDRish_Dabrain_With_Ghost.jpg)
After :
(http://img150.exs.cx/img150/7454/Freespace2_HDRish_Dabrain_With_Ghost2.th.jpg) (http://img150.exs.cx/my.php?loc=img150&image=Freespace2_HDRish_Dabrain_With_Ghost2.jpg)
I change those values :
PARAM curFrameFactor = {0.4, 0.4, 0.4, 0.0};
PARAM ghostFactor = {0.6, 0.6, 0.6, 0.0};
More the value in GhostFactor increase and more the screen will flashy and blured.
But if you increase the curFrameFactor, the blur effect isn't quite exagerated. But, if the ghostFactor value is too low, the game would be very dark.
It is what i saw during test.
Add this code at the end of the HDRish.pss file.
Or if you would only test the Blur effect make a new file a past this code :
shader ghostPixelShader =
"!!ARBfp1.0
# Increasing the ghostFactor will increase the severity of this effect.
# To keep things the same brightness curFrameFactor and ghostFactor should
# add up to 1.
PARAM curFrameFactor = {0.4, 0.4, 0.4, 0.0};
PARAM ghostFactor = {0.6, 0.6, 0.6, 0.0};
TEMP thisFramesPixel;
TEMP lastFramesPixel;
OUTPUT oColor = result.color;
TEX thisFramesPixel, fragment.texcoord[0], texture[0], 2D;
TEX lastFramesPixel, fragment.texcoord[0], texture[1], 2D;
MUL thisFramesPixel, thisFramesPixel, curFrameFactor;
MAD oColor, lastFramesPixel, ghostFactor, thisFramesPixel;
END";
shader copyPixelShader =
"!!ARBfp1.0
OUTPUT oColor = result.color;
TEMP pixel;
TEX pixel, fragment.texcoord[0], texture[0], 2D;
MOV oColor, pixel;
END";
surface temp = allocsurf(width, height);
texture[0].source = backbuffer;
texture[1].source = temp;
destination temp;
apply ghostPixelShader;
texture[0].source = temp;
destination backbuffer;
apply copyPixelShader;
-
Interesting pics of TBP EMW mission 5... ;)
-
I love seeing Earth in low Orbit :D
-
Originally posted by Raa
If it was possible yo get a bloom on only the pure red, pure blue, and pure green colors, for glowmaps, it might be nice. ;)
or just render glow and shine seperatly then do the blur on them.
-
Tell me how to do that with a post-filter, and I'll do it. :p
-
I was talking about when the real thing was implememnted, that yu were continuingg on from your previous post.
Evidently confusion was sewn like grain in a cornfield.
-
i dont see a difference....
question: am i supposed to enable smarthshaders in the driver options for it to work?
-
umm.. you need to be in openGL, i dont have an "ebale smarthaders" option.
-
Originally posted by Singh
i dont see a difference....
question: am i supposed to enable smarthshaders in the driver options for it to work?
You have first to run Fs 2 open in OpenGL mode. But before doing this, install the 2 zip into you hdd, and then copy/past one of the following modification from Dabrain or me if you want the Motion Blur, into a txt file and rename it as a .pss file.
Then execute the pssControl2.exe and select the file you have just created or if you want tested the original, select the HDRish.pss fromm the All directory or from the NitroGl directory.
You can close the pssControl2 without deactivated the SmartShader you have selected, or let it open and play Fs2 open or TBP 3.0 :D
Have fun !
-
I did exactly that......but yet notice little difference......:/
-
Try with the original HDRish from one of both zip. Run fs 2, normally, you will notice a great change for lightning.
Just for info, it run only with 9x00 Radeon card series. Otherwise, you can't see any difference.
-
I have a 9200SE, will it run on that?
-
Hm i don't now but I just know it from the Rage3d forum. Try anyway. Hope it will work.
-
HDRish uses some Shader 2.0 instructions AFAIK.
So it won't run on the 8500, 9000, 9100 and 9200.
But even with the Shader 1.4 instructions you should be able to achive an almost simliar effect. I just have no clue how to do that. :(
Try some other shader files. Some might work.
This one should work:
shader grayscalePixelShader =
"!!ARBfp1.0
PARAM scale = {0.30, 0.59, 0.11, 1.0};
TEMP pixel;
OUTPUT oColor = result.color;
TEX pixel, fragment.texcoord[0], texture[0], 2D;
DP3 oColor, pixel, scale;
END";
texture[0].source = backbuffer;
apply grayscalePixelShader;
If not, I doubt any other effect will work.
BTW I think this feature will be added for OpenGL first, as fragmentprograms are only an extension.
Many emulator plugins have added this feature (only for OpenGL) so I think it's pretty easy to add.
-
nm then. I'll just enjoy lighty's shineys then :)
-
Someone gave me this code.
Can you test it?
//
// Vertex shader for modifying image brightness by
// interpolation and extrapolation
//
// Author: Randi Rost
//
// Copyright (c) 2003-2004: 3Dlabs, Inc.
//
// See 3Dlabs-License.txt for license information
//
varying vec2 TexCoord;
void main (void)
{
gl_Position = ftransform();
TexCoord = gl_MultiTexCoord0.st;
}
//
// Fragment shader for modifying image brightness by
// interpolation and extrapolation
//
// Author: Randi Rost
//
// Copyright (c) 2003-2004: 3Dlabs, Inc.
//
// See 3Dlabs-License.txt for license information
//
varying vec2 TexCoord;
uniform float Alpha;
uniform sampler2D Image;
void main (void)
{
gl_FragColor = texture2D(Image, TexCoord) * Alpha;
}
//
// Vertex shader for modifying image contrast by
// interpolation and extrapolation
//
// Author: Randi Rost
//
// Copyright (c) 2003-2004: 3Dlabs, Inc.
//
// See 3Dlabs-License.txt for license information
//
varying vec2 TexCoord;
void main (void)
{
gl_Position = ftransform();
TexCoord = gl_MultiTexCoord0.st;
}
//
// Fragment shader for modifying image contrast by
// interpolation and extrapolation
//
// Author: Randi Rost
//
// Copyright (c) 2002: 3Dlabs, Inc.
//
// See 3Dlabs-License.txt for license information
//
varying vec2 TexCoord;
uniform vec3 AvgLuminance;
uniform float Alpha;
uniform sampler2D Image;
void main (void)
{
vec3 color = texture2D(Image, TexCoord).rgb;
color = mix(AvgLuminance, color, Alpha);
gl_FragColor = vec4 (color, 1.0);
}
and 3Dlabs-License.txt
/************************************************************************
* *
* Copyright (C) 2002-2004 3Dlabs Inc. Ltd. *
* *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the following disclaimer. *
* *
* Redistributions in binary form must reproduce the above *
* copyright notice, this list of conditions and the following *
* disclaimer in the documentation and/or other materials provided *
* with the distribution. *
* *
* Neither the name of 3Dlabs Inc. Ltd. nor the names of its *
* contributors may be used to endorse or promote products derived *
* from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
* POSSIBILITY OF SUCH DAMAGE. *
* *
************************************************************************/
-
Dab, your code is base on C or C++, so i don't think it will work with the pssControl2.exe.
And we have to compile it to try. erf
-
Oh, damn.
I took a look at this, but I didn't notice. Stupid me.
-
if you used 1.1 pixle shaders 1.1 vertex shaders, most of the community would be covered down to the crappy radeon 8500, and there really isnt _that_ big of a difference besides performance.
If we could somehow manage to covert alot of the straight texture effects into shaders, it would become much more avalible to lower end systems.
-
Originally posted by Drew
if you used 1.1 pixle shaders 1.1 vertex shaders, most of the community would be covered down to the crappy radeon 8500, and there really isnt _that_ big of a difference besides performance.
If we could somehow manage to covert alot of the straight texture effects into shaders, it would become much more avalible to lower end systems.
just for a point of reference, Radeon 9000's have 1.2 pixel shaders. :nod:
-
Not quite. It's pixel shader 1.4 for 8500, 9000, 9100, 9200.
Geforce 4 TI has pixel shader 1.3
Geforce 3 has pixel shader 1.1
-
Be advised people, (i dunno if anyone has already noticed, not gonna wade thru all that code in this thread) --- The White Screen problem only occurs with Catalyst 4.11 on my Radeon 9800 Pro. It goes away if you upgrade to 4.12. :)
Keep at it guys...ideally, we want an HDR style effect that is only applied to the lightest highlights...not everything like it is pretty much done right now. In JK3: Jedi Academy they specify where they do and do not want this kind of glow...we can't do THAT at present (that was done with JK3's texture files)...but we can at least filter it so it doesn't go crazy and blur/glow EVERYTHING...
...id write it myself but best i can do right now is tweak a few settings and see what happens, im not much of a coder --- but maybe i will be. given time, maybe if i look at the design docs for smartshader i found on that site link dabrain gave...
oh btw...one more thing. ive found that it looks best with the following:
- If using a bright smartshader, decrease gamma correction drastically in either FS2 or in your control panel
- put your ambient lighting really low (ambient_factor 60 or lower)
- use Taylor's OpenGL build (http://www.hard-light.net/forums/index.php/topic,29087.0.html).
- make sure you have the Media VP's and/or Lightspeed's special shinemapping installed
- Weep in joy at the beauty while watching your FPS eat the toilet (depends on your computer --- if its uber, you may just get to cry and not watch toiletry FPS)
-
It should be an option whether to glow everything or just highlights. Personally I like the effect of blurring everything.
-
The effect we aim for is like this:
1.Copy current screen into the buffer (as texture).
2.Increase saturation 25%
3.Decrease brightness 25%
4.Increase contrast 50%
5.(SUB [fragments wih lower values than set]
6.(KIL [these fragments])
7.(apply gaussianPixelShader [just copy it from the first page])
8.(output)
I've just found a software called "Shader Designer".
It works somehow different from the *.pss files.
The bad thing is, it won't show me a preview for fragment shaders without a vertex shader.
I know how to do these steps now: 2-4 in this langauge and 1, 5-8 in the Assembler-like *.pss language. ;)
duh...
Edit: Step 2-4:
uniform sampler2D texture;
uniform float alpha;
const vec3 coef= vec3(0.2125, 0.7154, 0.0721);
void main()
{
vec4 color = texture2D(texture,gl_TexCoord[0].st);
vec4 intensity = vec4(dot(color.rgb,coef));
gl_FragColor = mix(intensity, color,alpha)+ color + color - alpha - alpha -alpha
+ color ;
}
-
Any chance of a Direct3D version of this type of smartshader activation prog existing? I'd like to apply these glow effects to Freelancer too :)
-
my modification of HDRish
the following will create a less-intense and tightly-spread glow that doesn't spill everywhere like the original did.
shader samplePixelShader =
"!!ARBfp1.0
TEMP Temp;
TEX result.color, fragment.texcoord[0], texture[0], 2D;
END";
shader gaussianXPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[3]=
{
{ 0.182008, 0.116053, 0.073999, 0.047184 },
{ 0.030086, 0.019183, 0.012232, 0.007799 },
{ 0.004973, 0.003171, 0.002022, 0.001289 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader gaussianYPixelShader =
"!!ARBfp1.0
PARAM Offset[11]={ program.local[0..10] };
PARAM Weight[3]=
{
{ 0.182008, 0.116053, 0.073999, 0.047184 },
{ 0.030086, 0.019183, 0.012232, 0.007799 },
{ 0.004973, 0.003171, 0.002022, 0.001289 }
};
TEMP s0, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10;
ADD r0, -Offset[10], fragment.texcoord[0];
ADD r1, -Offset[ 9], fragment.texcoord[0];
ADD r2, -Offset[ 8], fragment.texcoord[0];
ADD r3, -Offset[ 7], fragment.texcoord[0];
ADD r4, -Offset[ 6], fragment.texcoord[0];
ADD r5, -Offset[ 5], fragment.texcoord[0];
ADD r6, -Offset[ 4], fragment.texcoord[0];
ADD r7, -Offset[ 3], fragment.texcoord[0];
ADD r8, -Offset[ 2], fragment.texcoord[0];
ADD r9, -Offset[ 1], fragment.texcoord[0];
ADD r10, -Offset[ 0], fragment.texcoord[0];
MOV s0, fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
TEX s0, s0, texture[0], 2D;
MUL s0, s0, Weight[0].x;
MAD s0, r0, Weight[2].w, s0;
MAD s0, r1, Weight[2].z, s0;
MAD s0, r2, Weight[2].y, s0;
MAD s0, r3, Weight[2].x, s0;
MAD s0, r4, Weight[1].w, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].y, s0;
MAD s0, r7, Weight[1].x, s0;
MAD s0, r8, Weight[0].w, s0;
MAD s0, r9, Weight[0].z, s0;
MAD s0, r10, Weight[0].y, s0;
ADD r0, Offset[ 0], fragment.texcoord[0];
ADD r1, Offset[ 1], fragment.texcoord[0];
ADD r2, Offset[ 2], fragment.texcoord[0];
ADD r3, Offset[ 3], fragment.texcoord[0];
ADD r4, Offset[ 4], fragment.texcoord[0];
ADD r5, Offset[ 5], fragment.texcoord[0];
ADD r6, Offset[ 6], fragment.texcoord[0];
ADD r7, Offset[ 7], fragment.texcoord[0];
ADD r8, Offset[ 8], fragment.texcoord[0];
ADD r9, Offset[ 9], fragment.texcoord[0];
ADD r10, Offset[10], fragment.texcoord[0];
TEX r0, r0, texture[0], 2D;
TEX r1, r1, texture[0], 2D;
TEX r2, r2, texture[0], 2D;
TEX r3, r3, texture[0], 2D;
TEX r4, r4, texture[0], 2D;
TEX r5, r5, texture[0], 2D;
TEX r6, r6, texture[0], 2D;
TEX r7, r7, texture[0], 2D;
TEX r8, r8, texture[0], 2D;
TEX r9, r9, texture[0], 2D;
TEX r10, r10, texture[0], 2D;
MAD s0, r0, Weight[0].y, s0;
MAD s0, r1, Weight[0].z, s0;
MAD s0, r2, Weight[0].w, s0;
MAD s0, r3, Weight[1].x, s0;
MAD s0, r4, Weight[1].y, s0;
MAD s0, r5, Weight[1].z, s0;
MAD s0, r6, Weight[1].w, s0;
MAD s0, r7, Weight[2].x, s0;
MAD s0, r8, Weight[2].y, s0;
MAD s0, r9, Weight[2].z, s0;
MAD s0, r10, Weight[2].w, s0;
MOV result.color, s0;
END";
shader outputPixelShader =
"!!ARBfp1.0
TEMP back, blur;
TEX blur, fragment.texcoord[0], texture[0], 2D;
TEX back, fragment.texcoord[0], texture[1], 2D;
ADD blur, blur, blur;
MAD result.color, blur, 0.75, back;
END";
surface blur0 = allocsurf(width/4, height/4);
surface blur1 = allocsurf(width/4, height/4);
gaussianXPixelShader.constant[ 0] = { (2.0*ds_dx)* 1.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 1] = { (2.0*ds_dx)* 3.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 2] = { (2.0*ds_dx)* 5.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 3] = { (2.0*ds_dx)* 7.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 4] = { (2.0*ds_dx)* 9.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 5] = { (2.0*ds_dx)*11.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 6] = { (2.0*ds_dx)*13.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 7] = { (2.0*ds_dx)*15.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 8] = { (2.0*ds_dx)*17.45, 0, 0, 0 };
gaussianXPixelShader.constant[ 9] = { (2.0*ds_dx)*19.45, 0, 0, 0 };
gaussianXPixelShader.constant[10] = { (2.0*ds_dx)*21.45, 0, 0, 0 };
gaussianYPixelShader.constant[ 0] = { 0, (2.0*dt_dy)* 1.45, 0, 0 };
gaussianYPixelShader.constant[ 1] = { 0, (2.0*dt_dy)* 3.45, 0, 0 };
gaussianYPixelShader.constant[ 2] = { 0, (2.0*dt_dy)* 5.45, 0, 0 };
gaussianYPixelShader.constant[ 3] = { 0, (2.0*dt_dy)* 7.45, 0, 0 };
gaussianYPixelShader.constant[ 4] = { 0, (2.0*dt_dy)* 9.45, 0, 0 };
gaussianYPixelShader.constant[ 5] = { 0, (2.0*dt_dy)*11.45, 0, 0 };
gaussianYPixelShader.constant[ 6] = { 0, (2.0*dt_dy)*13.45, 0, 0 };
gaussianYPixelShader.constant[ 7] = { 0, (2.0*dt_dy)*15.45, 0, 0 };
gaussianYPixelShader.constant[ 8] = { 0, (2.0*dt_dy)*17.45, 0, 0 };
gaussianYPixelShader.constant[ 9] = { 0, (2.0*dt_dy)*19.45, 0, 0 };
gaussianYPixelShader.constant[10] = { 0, (2.0*dt_dy)*21.45, 0, 0 };
texture[0].magfilter = "linear";
texture[0].source = backbuffer;
destination blur0;
apply samplePixelShader;
texture[0].source = blur0;
destination blur1;
apply gaussianXPixelShader;
texture[0].source = blur1;
destination blur0;
apply gaussianYPixelShader;
texture[0].source = blur0;
texture[1].source = backbuffer;
destination backbuffer;
apply outputPixelShader;
My version...I took a few suggestions from other places...such as the line
MAD result.color, blur, 0.75, back;
that line came from elsewhere on the same forum that referred the original files...it tones down the glow. i also did a little logical checking around and figured "oh look at these 4.0 values in here, I bet they deal with the size of the glow!" so I did a Find and Replace on all the "dt_dy"'s and "ds_dx"'s that were in the thing. The Ds_DX ones control the width of the glows, the dt_dy ones control the height (so you can make glows that are vertical or horizontal only if you want, but why you'd want to is beyond me).
Result: A soft glow that spreads over a smaller area around what it is glowing up. Looks MUCH better imho and is very fast -- note however that this does not include any of the dark pixel optimizations DaBrain's version has.
UPDATE: For strange results, do a Find and Replace on "2.0*" in the above code, or "4.0*" in the original HDRish, without the quotes, and replace it with numbers lower than 1.0 (0.5 is fine) --- causes VERY strange effects on the lighting...the menus get all funky for one thing...
UPDATE 2: Eliminating Shimmering Once and For All Has a Nasty Price
surface blur0 = allocsurf(width/4, height/4);
surface blur1 = allocsurf(width/4, height/4);
Those lines...the number 4 determines how much less resolution the gaussian has. In other words, /4 samples only every four pixels for the blur.
/1 : samples EVERY SINGLE DAMN PIXEL, at a severe severe severe SEVERE cost to your video card's framerate.
/2 : samples 2x2 pixels at a time...which means every 2 pixels that exist are treated as ONE pixel with ONE color (arbitrarily, it appears).
/4: samples 4x4 pixels at a time. 4 pixels are recognized as one.
/6: samples 6x6 pixel region at a time. 6 pixels are treated and displayed as one single pixel enlarged to fit your resolution.
and so on...
...What we need is a code to make it take the AVERAGE of four pixels or six pixels or eight pixels and use that average for the blur effect, rather than a straight resolution chopping which is what is currently having.
The bigger that number, the more mosaic-y your HDRishnish effects are going to be. The only way to cut back on this is if it is somehow made to be the average RGB and brightness of four or more pixels together rather than just using one of them to represent the whole region of four or more pixels/unit.
That would be the best tradeoff between performace and quality. Right now, the larger the number after that divide sign, the less resolution and the faster the HDR effect, but the worse it looks and the more it shimmers.
-
Well this might be interessting for Geforce or Direct3d user in general.
The DX-Tweaker Beta
http://www.forum-3dcenter.org/vbulletin/showthread.php?t=199049 (for non-german, just click on "Beta Seite")
It will feature a postfilter like ATI does already. But we'll have to wait for the second beta for this feature.
-
The time has come:
Postfilter for all DX cards. ;) (Yeah, that means you'll have to use Direct3d)
The new Beta version of the DXtweaker allows to use Postfilter.
Well, there are only three included for now, so we'll have to write our own effects.
http://www.nonatainment.de/portal/DesktopDefault.aspx?tabindex=7&tabid=19