Archived

This topic is now archived and is closed to further replies.

PSioNiC

Greyscale Rendering

Recommended Posts

Is there any way to render in greyscale only? But not just to make it look cool, to make it run faster. I know it can be done with vertex and pixel shaders, but somehow can you just send grey information to the DX rendering engine instead of red, green and blue information?

Share this post


Link to post
Share on other sites
If the r, g and b values are equal, then the resulting color is a shade of grey. (Suprise, suprise) The higher the value, the lighter the shade of grey. Example: D3DCOLOR_RGBA(x, x, x, 0); I assume that this would be much faster than using pixel / vertex shading manipulation.
Hope this helps,
Cheers,
-Jesse

Share this post


Link to post
Share on other sites
no you missed the point completely

if you only had to pass one number (for grey) instead of three (for red green and blue) you would drastically cut down on bandwidth through the rendering pipeline.

The default surface for make is A8R8G8B8, imagine if it was only A8G8! (g for grey not green of course)


Plus your method wouldn't work when you texture your primitives unless you set some strange texture stage states.

Edited by - Psionic on November 9, 2001 12:12:55 AM

Share this post


Link to post
Share on other sites
Theoretically that would be faster, but that''s not the way things work. The card is very tuned to handling color in certain ways. So yes, processing one byte would be faster, but the hardware isn''t set up that way.

Share this post


Link to post
Share on other sites
Why don''t you switch to 8 bit palettized mode, create a palette of all shades of gray (there are only 256 of them). Then you can work with the palette which should enable you to pass only one number (the palette entry) as the color value.

baumep

Share this post


Link to post
Share on other sites
Every modern 3d card is optimized to render color. So you get squat in savings for rendering in gray. If however, you had a card that was optimised for gray, you MIGHT get a big speed increase on some programs, just because you MIGHT have 1/3 to 1/2 fewer memory reads and writes, but then again, most cards are designed to fetch/write several bytes at a time, so i don''t know that there really even would be an advantage except memory savings. Many newer cards are just as fast in 32 bit as 16bit mode, unless fillrate limited.

Share this post


Link to post
Share on other sites