0

I'm working on a game using OpenTK in C#. Currently trying to implement the pause menu system.

One feature, that I need your help with, is darkening the whole screen when the menu appears.

Is there any way i can do a final modification of every pixel (half the RGB?) once everything is rendered? If not, i know that drawing a quad over the screen works, but i can't seem to work out how to get semi-transparency to work with OpenTK quads.

Joel
  • 1,580
  • 4
  • 20
  • 33

2 Answers2

2

What do can do is create a semi opaque grey image. When the game is paused, just draw that texture over top of everything (but probably underneath the pause text so that it doesn't also appear greyed out) All of your game elements will still show through (since the texture is opaque), but they will be "greyed" out in effect.

CC Inc
  • 5,842
  • 3
  • 33
  • 64
  • How do i go about partial transparency? That is my main issue. Making the image partially transparent isn't enough, the image still appears fully opaque for me. – Joel Jan 07 '13 at 20:37
  • There's code needed to manage the alpha, otherwise it'll simply handle it as completely opaque or transparent. I don't know the code :/ – Joel Jan 13 '13 at 02:31
0

One simple effect, that uses only 100% and 0% alpha, yet 'darkens' the screen, is to have a checkerboard pattern (for 50% darker) of black and clear pixels, and render that over the screen.

The downfall of this is it isn't 'darkening' the screen flawlessly, however it is faster than handling partial transparency, and can have a nice effect as it is (a bit of diversity).

Joel
  • 1,580
  • 4
  • 20
  • 33