Page 2 of 2

PostPosted: Jan 15, 2003 @ 12:18pm
by fzammetti

PostPosted: Jan 15, 2003 @ 1:04pm
by refractor
In the code you posted, you forgot to return finalCol, and you want to shift the values down before you average them to get something like:

finalCol=((color&red_mask)>>10 + (color&green_mask)>>5 + (blue&blue_mask))/3;
finalCol+=(finalCol<<10 + finalcol<<5);
return finalCol;


The other reason that it may look "odd" when you use your fader is that you're decreasing the colours all by the same delta.

Consider a colour that's comprised of:

Red: 31
Green: 15
Blue: 15

And your decrement is 5 for all three colours. You're just going to be left with a mid-intensity red
:
Red: 16
Green: 0
Blue: 0

after 3 decrements, not the:

Red: 16
Green: 7
Blue: 7
(poor accuracy but nevermind) that you would get by decrementing the intensities proportionally to their start intensity.

Cheers,

Ref.

PostPosted: Feb 8, 2003 @ 6:17pm
by damian

PostPosted: Feb 9, 2003 @ 11:00pm
by damian

PostPosted: Feb 9, 2003 @ 11:31pm
by fzammetti

PostPosted: Feb 10, 2003 @ 12:19am
by damian

PostPosted: Mar 6, 2003 @ 1:04am
by draklava
Speaking of samples... would someone be so kind as to post the support code for a shader. Like the calls you would use in your gameLoop to implement a shader. I noticed the SetPixelShader function but perhaps an example using the FadeShader would be helpful to me.

Thanks!

PostPosted: Mar 6, 2003 @ 2:39am
by fzammetti
display->SetPixelShader(&yourShader);

yourShader is simply an instance of your pixel shader... display is, well, you know!

From that point on, until you change it, every pixel rendered will be processed by your pixel shader.

PostPosted: Mar 7, 2003 @ 11:06pm
by damian

PostPosted: Mar 8, 2003 @ 12:13am
by damian
OK, finished, might be of help:



Just a quick demo of 3 lame pixel shaders... tap the stylus to cycle between them.

PostPosted: Mar 8, 2003 @ 2:01am
by HTK

thanks for the demo

PostPosted: Mar 8, 2003 @ 9:15am
by Conan

PostPosted: Mar 8, 2003 @ 4:35pm
by fzammetti

PostPosted: Mar 9, 2003 @ 6:55pm
by HTK

PostPosted: Mar 9, 2003 @ 9:31pm
by damian