This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Pixel Shader Question


Postby fzammetti » Jan 15, 2003 @ 12:18pm

...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby refractor » Jan 15, 2003 @ 1:04pm

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.
User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby damian » Feb 8, 2003 @ 6:17pm

damian
pm Insider
 
Posts: 3960
Joined: Sep 3, 2002 @ 7:59pm
Location: Acton, MA (home), NYC (school)


Postby damian » Feb 9, 2003 @ 11:00pm

damian
pm Insider
 
Posts: 3960
Joined: Sep 3, 2002 @ 7:59pm
Location: Acton, MA (home), NYC (school)


Postby fzammetti » Feb 9, 2003 @ 11:31pm

...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby damian » Feb 10, 2003 @ 12:19am

damian
pm Insider
 
Posts: 3960
Joined: Sep 3, 2002 @ 7:59pm
Location: Acton, MA (home), NYC (school)


Postby draklava » Mar 6, 2003 @ 1:04am

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!
User avatar
draklava
pm Member
 
Posts: 79
Joined: May 15, 2002 @ 6:13am
Location: Atlanta, Albania, Wherever


Postby fzammetti » Mar 6, 2003 @ 2:39am

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.
...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby damian » Mar 7, 2003 @ 11:06pm

damian
pm Insider
 
Posts: 3960
Joined: Sep 3, 2002 @ 7:59pm
Location: Acton, MA (home), NYC (school)


Postby damian » Mar 8, 2003 @ 12:13am

OK, finished, might be of help:



Just a quick demo of 3 lame pixel shaders... tap the stylus to cycle between them.
damian
pm Insider
 
Posts: 3960
Joined: Sep 3, 2002 @ 7:59pm
Location: Acton, MA (home), NYC (school)


Postby HTK » Mar 8, 2003 @ 2:01am

User avatar
HTK
pm Member
 
Posts: 132
Joined: Dec 14, 2002 @ 5:40pm


thanks for the demo

Postby Conan » Mar 8, 2003 @ 9:15am

What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Postby fzammetti » Mar 8, 2003 @ 4:35pm

...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby HTK » Mar 9, 2003 @ 6:55pm

User avatar
HTK
pm Member
 
Posts: 132
Joined: Dec 14, 2002 @ 5:40pm


Postby damian » Mar 9, 2003 @ 9:31pm

damian
pm Insider
 
Posts: 3960
Joined: Sep 3, 2002 @ 7:59pm
Location: Acton, MA (home), NYC (school)


Previous

Return to PocketFrog & PocketHAL


Sort


Forum Description

SDKs for fast and robust device-independent access to Pocket PC display hardware.

Moderators:

sponge, Kzinti

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron