Sign in to follow this  

Luminance rendering

This topic is 3933 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

HI there HOw do i get a black and white rendering of my frame buffer. I want to display my normal 3D RGBA colour output to Gray scale colours. Do i have to just set buffers or do something complicated. Thanks Viresh

Share this post


Link to post
Share on other sites
You need to render to a texture and then use a fragment shader on that texture to do the conversion as you place the texture on the screen.

Share this post


Link to post
Share on other sites
Instead of doing it in a separate pass, you could also just tack it on at the end of your final renderpass. Compile two different versions of your final shader, one with the grayscale and one without the grayscale, and switch between the two depending on when you want to render in grayscale.

A common luminance formula is Y = 0.2126*R + 0.7152*G + 0.0722*B, however I've also seen a shorter Y = 0.3*R + 0.59*G + 0.11*B. You can probably Google for a bunch of variations.

Share this post


Link to post
Share on other sites

This topic is 3933 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this