Put these in the tenebrae/glprogs folder, they are loaded by the engine at run time so they can be edited more easily.

This commit is contained in:
cholleme 2004-11-12 11:29:41 +00:00
parent 35a3e19c12
commit c5640beb93
12 changed files with 277 additions and 0 deletions

19
glprogs/blur_fp.txt Normal file
View File

@ -0,0 +1,19 @@
!!ARBfp1.0
OPTION ARB_precision_hint_fastest;
TEMP r0, final;
MOV final, 0;
TEX r0, fragment.texcoord[0], texture[0], 2D;
MAD final, r0, 0.2, final;
TEX r0, fragment.texcoord[1], texture[0], 2D;
MAD final, r0, 0.2, final;
TEX r0, fragment.texcoord[2], texture[0], 2D;
MAD final, r0, 0.2, final;
TEX r0, fragment.texcoord[3], texture[0], 2D;
MAD final, r0, 0.2, final;
TEX r0, fragment.texcoord[4], texture[0], 2D;
MAD final, r0, 0.1, final;
TEX r0, fragment.texcoord[5], texture[0], 2D;
MAD result.color, r0, 0.1, final;
END

28
glprogs/blur_vp.txt Normal file
View File

@ -0,0 +1,28 @@
!!ARBvp1.0
OPTION ARB_position_invariant;
PARAM frameTexelSize = program.env[0];
PARAM smallTexelSize = program.env[1];
PARAM frameScale = program.env[2];
PARAM smallScale = program.env[3];
PARAM smallWriteScale = program.env[4];
PARAM axis = program.local[0];
TEMP texel, halfTexel, base, r0;
MOV result.color, vertex.color;
MUL texel, smallTexelSize, axis;
MUL halfTexel, texel, 0.5;
MUL base, vertex.texcoord[0], smallScale;
MUL base, base, 4;
ADD result.texcoord[0], base, halfTexel;
ADD result.texcoord[1], base, -halfTexel;
MAD r0, texel, 2, halfTexel;
ADD result.texcoord[2], base, r0;
ADD result.texcoord[3], base, -r0;
MAD r0, texel, 4, halfTexel;
ADD result.texcoord[4], base, r0;
ADD result.texcoord[5], base, -r0;
END

16
glprogs/downsample_fp.txt Normal file
View File

@ -0,0 +1,16 @@
!!ARBfp1.0
OPTION ARB_precision_hint_fastest;
PARAM lumiConst = { 0.333, 0.333, 0.333, 0 };
PARAM glareInfo = program.env[0];
TEMP r0, lumi;
TEX r0, fragment.texcoord[0], texture[0], 2D;
DP3 lumi, r0, lumiConst;
SUB_SAT lumi, lumi, glareInfo.x;
MUL_SAT lumi, lumi, glareInfo.y;
MOV r0.a, lumi.x;
MOV result.color, r0;
END

16
glprogs/downsample_vp.txt Normal file
View File

@ -0,0 +1,16 @@
!!ARBvp1.0
OPTION ARB_position_invariant;
PARAM frameTexelSize = program.env[0];
PARAM smallTexelSize = program.env[1];
PARAM frameScale = program.env[2];
PARAM smallScale = program.env[3];
TEMP r0;
MOV result.color, vertex.color;
MOV r0, vertex.texcoord[0];
MUL r0, r0, frameScale; # account for rounding to nearest pow of 2
MUL r0, r0, 4; # downsample 4 times
MOV result.texcoord[0], r0; # write result
END

32
glprogs/final_fp.txt Normal file
View File

@ -0,0 +1,32 @@
!!ARBfp1.0
OPTION ARB_precision_hint_fastest;
PARAM lumiConst = { 0.333, 0.333, 0.333, 0 };
PARAM noContrast = { 0.5, 0.5, 0.5, 0 };
PARAM glareInfo = program.env[0];
PARAM postInfo = program.local[0];
TEMP r0, r1, r2;
TEX r0, fragment.texcoord[0], texture[0], 2D; #normal frame buffer
TEX r1, fragment.texcoord[1], texture[1], 2D; #blurred with alpha containing glare scale
MAD r1.a, glareInfo.a, r1.a, postInfo.a; # setup contribution of blurred image
MUL r1, r1, r1.a;
MAD r0, r0, glareInfo.z, r1; # r0 is final color
DP3 r1, r0, lumiConst; # r1 is grayscale version
# after saturation in r2
SUB r2, r0, r1;
MAD r2, postInfo.x, r2, r1;
# after constrast in r1
SUB r1, r2, noContrast;
MAD r1, postInfo.y, r1, noContrast;
# brightness
MUL result.color, r1, postInfo.z;
# screen flashy stuff
#SUB r2, fragment.color, r1;
#MAD result.color, fragment.color.a, r2, fragment.color;
END

14
glprogs/final_vp.txt Normal file
View File

@ -0,0 +1,14 @@
!!ARBvp1.0
OPTION ARB_position_invariant;
PARAM frameTexelSize = program.env[0];
PARAM smallTexelSize = program.env[1];
PARAM frameScale = program.env[2];
PARAM smallScale = program.env[3];
TEMP r0;
MOV result.color, vertex.color;
MUL result.texcoord[0], vertex.texcoord[0], frameScale;
MUL result.texcoord[1], vertex.texcoord[0], smallScale;
END

31
glprogs/light_fp_1.txt Normal file
View File

@ -0,0 +1,31 @@
!!ARBfp1.0
OPTION ARB_precision_hint_fastest;
ATTRIB tex0 = fragment.texcoord[0];
ATTRIB tex1 = fragment.texcoord[1];
ATTRIB tex2 = fragment.texcoord[2];
ATTRIB tex3 = fragment.texcoord[3];
ATTRIB col = fragment.color.primary;
PARAM scaler = { 16, 8, 2, -1 };
OUTPUT outColor = result.color;
TEMP normalmap, lightvec, halfvec, colormap, atten;
TEMP diffdot, specdot, selfshadow;
TEX normalmap, tex0, texture[0], 2D;
MAD normalmap.rgb, normalmap, scaler.b, scaler.a;
DP3 lightvec.x, tex1, tex1;
RSQ lightvec.x, lightvec.x;
MUL lightvec, tex1, lightvec.x;
TEX colormap, tex0, texture[1], 2D;
DP3 halfvec.x, tex2, tex2;
RSQ halfvec.x, halfvec.x;
MUL halfvec, tex2, halfvec.x;
TEX atten, tex3, texture[2], 3D;
DP3_SAT diffdot, normalmap, lightvec;
MUL_SAT selfshadow.r, lightvec.z, scaler.g;
DP3_SAT specdot.a, normalmap, halfvec;
MUL diffdot, diffdot, colormap;
POW specdot.a, specdot.a, scaler.r;
MUL specdot.a, specdot.a, normalmap.a;
MAD diffdot, diffdot, selfshadow.r, specdot.a;
MUL atten, col, atten;
MUL_SAT outColor, diffdot, atten;
END

34
glprogs/light_fp_2.txt Normal file
View File

@ -0,0 +1,34 @@
!!ARBfp1.0
OPTION ARB_precision_hint_fastest;
ATTRIB tex0 = fragment.texcoord[0];
ATTRIB tex1 = fragment.texcoord[1];
ATTRIB tex2 = fragment.texcoord[2];
ATTRIB tex3 = fragment.texcoord[3];
ATTRIB tex4 = fragment.texcoord[4];
ATTRIB col = fragment.color.primary;
PARAM scaler = { 16, 8, 2, -1 };
OUTPUT outColor = result.color;
TEMP normalmap, lightvec, halfvec, colormap, atten;
TEMP diffdot, specdot, selfshadow, filter;
TEX normalmap, tex0, texture[0], 2D;
MAD normalmap.rgb, normalmap, scaler.b, scaler.a;
DP3 lightvec.x, tex1, tex1;
RSQ lightvec.x, lightvec.x;
MUL lightvec, tex1, lightvec.x;
TEX colormap, tex0, texture[1], 2D;
DP3 halfvec.x, tex2, tex2;
RSQ halfvec.x, halfvec.x;
MUL halfvec, tex2, halfvec.x;
TEX atten, tex3, texture[2], 3D;
DP3_SAT diffdot, normalmap, lightvec;
MUL_SAT selfshadow.r, lightvec.z, scaler.g;
DP3_SAT specdot.a, normalmap, halfvec;
MUL diffdot, diffdot, colormap;
POW specdot.a, specdot.a, scaler.r;
TEX filter, tex4, texture[3], CUBE;
MUL specdot.a, specdot.a, normalmap.a;
MUL atten, atten, filter;
MAD diffdot, diffdot, selfshadow.r, specdot.a;
MUL atten, col, atten;
MUL_SAT outColor, diffdot, atten;
END

24
glprogs/light_vp_1.txt Normal file
View File

@ -0,0 +1,24 @@
!!ARBvp1.0
OPTION ARB_position_invariant;
ATTRIB iPos = vertex.position;
ATTRIB iNormal = vertex.normal;
ATTRIB iColor = vertex.color;
ATTRIB iTex0 = vertex.texcoord[0];
ATTRIB iTex1 = vertex.texcoord[1];
ATTRIB iTex2 = vertex.texcoord[2];
PARAM texMatrix[4] = { state.matrix.texture[2] };
TEMP disttemp;
OUTPUT oColor = result.color;
OUTPUT oTex0 = result.texcoord[0];
OUTPUT oTex1 = result.texcoord[1];
OUTPUT oTex2 = result.texcoord[2];
OUTPUT oTex3 = result.texcoord[3];
DP4 oTex3.x, texMatrix[0], iPos;
DP4 oTex3.y, texMatrix[1], iPos;
DP4 oTex3.z, texMatrix[2], iPos;
DP4 oTex3.w, texMatrix[3], iPos;
MOV oTex0, iTex0;
MOV oTex1, iTex1;
MOV oTex2, iTex2;
MOV oColor, iColor;
END

30
glprogs/light_vp_2.txt Normal file
View File

@ -0,0 +1,30 @@
!!ARBvp1.0
OPTION ARB_position_invariant;
ATTRIB iPos = vertex.position;
ATTRIB iNormal = vertex.normal;
ATTRIB iColor = vertex.color;
ATTRIB iTex0 = vertex.texcoord[0];
ATTRIB iTex1 = vertex.texcoord[1];
ATTRIB iTex2 = vertex.texcoord[2];
PARAM texMatrix[4] = { state.matrix.texture[2] };
PARAM texMatrix2[4]= { state.matrix.texture[3] };
OUTPUT oColor = result.color;
OUTPUT oTex0 = result.texcoord[0];
OUTPUT oTex1 = result.texcoord[1];
OUTPUT oTex2 = result.texcoord[2];
OUTPUT oTex3 = result.texcoord[3];
OUTPUT oTex4 = result.texcoord[4];
OUTPUT oFog = result.fogcoord;
DP4 oTex3.x, texMatrix[0], iPos;
DP4 oTex3.y, texMatrix[1], iPos;
DP4 oTex3.z, texMatrix[2], iPos;
DP4 oTex3.w, texMatrix[3], iPos;
DP4 oTex4.x, texMatrix2[0], iPos;
DP4 oTex4.y, texMatrix2[1], iPos;
DP4 oTex4.z, texMatrix2[2], iPos;
DP4 oTex4.w, texMatrix2[3], iPos;
MOV oTex0, iTex0;
MOV oTex1, iTex1;
MOV oTex2, iTex2;
MOV oColor, iColor;
END

17
glprogs/ppsprite_fp.txt Normal file
View File

@ -0,0 +1,17 @@
!!ARBfp1.0
OPTION ARB_precision_hint_fastest;
TEMP r0, r1, r2;
TEX r0, fragment.texcoord[0], texture[0], 2D;
RCP r1.x, fragment.texcoord[1].w;
MUL r1, fragment.texcoord[1], r1.x;
MUL r2, 0.02, fragment.color.x; # particle fade out factor
MUL r2, r2, r0.a; # alpha fade factor
MAD r1, r0, r2, r1;
#assemble this in a register first, ati goes crazy if you assemble in result.color
TEX r2, r1, texture[1], 2D;
MOV r2.a, 1;
MOV result.color, r2;
END

16
glprogs/ppsprite_vp.txt Normal file
View File

@ -0,0 +1,16 @@
!!ARBvp1.0
OPTION ARB_position_invariant;
PARAM projMatrix[4] = { state.matrix.texture[1] };
PARAM texMatrix[4] = { state.matrix.texture[0] };
DP4 result.texcoord[1].x, projMatrix[0], vertex.position;
DP4 result.texcoord[1].y, projMatrix[1], vertex.position;
DP4 result.texcoord[1].z, projMatrix[2], vertex.position;
DP4 result.texcoord[1].w, projMatrix[3], vertex.position;
DP4 result.texcoord[0].x, texMatrix[0], vertex.texcoord[0];
DP4 result.texcoord[0].y, texMatrix[1], vertex.texcoord[0];
MOV result.color, vertex.color;
END