Pete´s Messageboard... No ISO/BIOS requests!

Homepage Members Register Login Search Old board


Neuer Thread ...


AuthorTopics » Book an abo for this threadClose Thread Move Thread Fix the thread Print view Delete this thread

<Luigi>
unregistried

...   Created on 27.01.2005 - 16:56Jump to top Quote this post Report this post Edit Delete


I have written (copied ) this program taking example from SMARTSHADER Cel Shade.pss.
should work on all dx9 cards.

gpuPeteOGL2.vp:

!!ARBvp1.0
OPTION ARB_position_invariant;
MOV result.texcoord[ 0 ],vertex.texcoord[ 0 ];
END

gpuPeteOGL2.fp:

!!ARBfp1.0

PARAM One = {1.0, 1.0, 1.0, 0.0};
PARAM OneAndAhalf = {1.5, 1.5, 1.5, 0.0};
PARAM half = {0.5, 0.5, 0.5, 0.0};
PARAM darkIntensity = {0.1, 0.1, 0.1, 0.0};
PARAM brightIntensity = {0.7, 0.7, 0.7, 0.0};
PARAM shrink = {.99, .99, .99, 0};
PARAM r = {1.0, 0.0, 0.0, 0.0};
PARAM g = {0.0, 1.0, 0.0, 0.0};
PARAM b = {0.0, 0.0, 1.0, 0.0};

TEMP pixel;
TEMP overallColor;
TEMP brightScale;
TEMP brightColor;
TEMP darkScale;
TEMP darkColor;
TEMP colorTemp;



# Read my pixel color & convert it to (0,1)
TEX pixel, fragment.texcoord[0], texture[0], 2D;
SUB pixel, pixel, half;
MAD pixel, pixel, shrink, half;

# Compute bright color
DP3 colorTemp, pixel, r;
MOV brightScale, colorTemp;
DP3 colorTemp, pixel, g;
MAX brightScale, brightScale, colorTemp;
DP3 colorTemp, pixel, b;
MAX brightScale, brightScale, colorTemp;
RCP brightScale, brightScale.x;
MUL brightScale, brightScale, brightIntensity;
MUL brightColor, brightScale, pixel;

# Compute dark color
DP3 colorTemp, pixel, r;
MOV darkScale, colorTemp;
DP3 colorTemp, pixel, g;
MAX darkScale, darkScale, colorTemp;
DP3 colorTemp, pixel, b;
MAX darkScale, darkScale, colorTemp;
RCP darkScale, darkScale.x;
MUL darkScale, darkScale, darkIntensity;
MUL darkColor, darkScale, pixel;

# Choose bright or dark
DP3 overallColor, pixel, One;
SUB overallColor, overallColor, OneAndAhalf;
CMP result.color, overallColor, darkColor, brightColor;

END

Ciao





Similarly threads:
Topics Created by Replies Boardname
Cell Shader? Twigboy 8 pete_bernert
Natural Vision Shader + AA Shader v2.o = Best Shader for 2d !! zaykho 10 pete_bernert
Smart Shading Z 5 pete_bernert
MMJ's 4-in-1 Shader MegaManJuno 10 pete_bernert
4-in-1 Shader v1.10 MegaManJuno 3 pete_bernert
Neuer Thread ...





Masthead

This forum is a free service of razyboard.com powered by:
Geizkragen Price Comparison. Top product in the price comparison: Krups Nespresso Essenza (XN2001)
Do you want a free forum in less than two minutes? Then click here!



Verwandte Suchbegriffe:
cell shading shader | smartshader cell shading | cell shading fragment | smart shader pss | arb cel shader | arb shader cell shading | arb fragment vertex cell shading
blank