Greyscale Rendering

Started by
6 comments, last by PSioNiC 22 years, 5 months ago
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?
"This is stupid. I can't believe this! Ok, this time, there really IS a bug in the compiler."... 20 mins pass ..."I'M AN IDIOT!!!"
Advertisement
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
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
"This is stupid. I can't believe this! Ok, this time, there really IS a bug in the compiler."... 20 mins pass ..."I'M AN IDIOT!!!"
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.
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
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
baumep
You won''t get any speed increase for using greyscale.

Even in palettised mode, it will still be computed as full colour in the card.

Besides, greyscale? I think I prefer colour!
quote:Original post by PSioNiC
The default surface for make is A8R8G8B8, imagine if it was only A8G8! (g for grey not green of course)


No, it wouldn''t be faster. Color components are computed simultaneously, not sequentially.

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.

This topic is closed to new replies.

Advertisement