Skip to main content
gamedev.net
🔒 Locked

Greyscale

Started by Kryptus 9 replies 500+ views
Original Post
Kryptus
Kryptus
how do i make a game run only in the shades of grey? ie. like black and white tv
ToohrVyk
ToohrVyk
Either 1°/ use only greyscale textures and lights or 2°/ set format 8-bit palletized and use a palette of greyscale...

ToohrVyk

Ilankt
Ilankt
There is another way to do it?
i know (well, think) there is a way to do it in OGL, and in DirectX not??!
How appropriate, you fight like a cow!
Kryptus
Kryptus
i am sick of people who reply but dont answer the question!
Ilankt
Ilankt
me too...
sorry
i just wanna know the answer too
How appropriate, you fight like a cow!
Pipo DeClown
Pipo DeClown
quote:
Original post by Ilankt
There is another way to do it?
i know (well, think) there is a way to do it in OGL, and in DirectX not??!



Whats the code to do it in OpenGL?


.lick
S1CA
S1CA
The SEARCH is working y''know:

http://www.gamedev.net/community/forums/topic.asp?topic_id=111422
http://www.gamedev.net/community/forums/topic.asp?topic_id=154727
http://www.gamedev.net/community/forums/topic.asp?topic_id=62579



--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
higherspeed
higherspeed
The search doesn''t always work. For me the forums are really quick, but the search takes a long time or just times out on me.

I''m afraid I can''t answer your question, but there will be a way to do it without pixel shaders.
xyzzy00
xyzzy00
From section C-9 of colorspace faq (www.faqs.org):
Y = 0.212671 * R + 0.715160 * G + 0.072169 * B;

Which can also be written:
Y = dot(float3(0.212671f, 0.715160f, 0.072169f), Color.rgb);

All that is required to convert a RGB value to grayscale is one DOT3 instruction. The DOT3 instruction is available in all pixel shader models, and is also available as a fixed-function TSS operation on some cards (check caps).

The weights may vary depending on your display device, and the lighting enviornment you are viewing it in. For example, for NTSC TV signals (usually viewed in a darkish room), the values would be more like (0.299, 0.587, 0.114)

xyzzy

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.