Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Greyscale 8bpp mode?  (Read 2580 times)

0 Members and 1 Guest are viewing this topic.

SamuraiCrow

  • Newbie
  • *
  • Posts: 40
    • Yahoo Instant Messenger - samuraileumas
    • View Profile
Greyscale 8bpp mode?
« on: February 19, 2010, 06:41:07 pm »
Hello,

In order to emulate an old-style paletted display mode, I was going to implement a CLUT fragment shader on a greyscale 8bpp mode.  It seems that 8bpp modes get promoted to higher depth or don't implement palettes in the way that I think they should.

Is there a way to insure that I get exactly 8 bits per pixel so that I can be sure that my colorize shader works correctly?  I need it to work correctly because my game will use palette cycling effects.

I'm using MacOSX 10.5.8 with SFML 1.5 under C++ native, if it makes any difference.

Thanks in advance,

--Sam

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Greyscale 8bpp mode?
« Reply #1 on: February 19, 2010, 06:57:15 pm »
Hi

Could you give more details about what you (want to) do?

Where exactly do you want 8bpp (window? image? shader? everywhere?) ?

Do you handle the palette yourself or do you expect SFML to do it?
Laurent Gomila - SFML developer

SamuraiCrow

  • Newbie
  • *
  • Posts: 40
    • Yahoo Instant Messenger - samuraileumas
    • View Profile
Greyscale 8bpp mode?
« Reply #2 on: February 19, 2010, 07:11:27 pm »
Since many modern graphics cards don't support palette graphics modes any more, I thought it would be a practical use of a palette shader that would do a color lookup table from an 8 bit per pixel screenmode.  I figured that allocating an 8 bit per pixel greyscale mode would be the most practical way to try to get 8 bits per pixel on the latest versions of OpenGL.

What I was planning on doing was having a bigger-than-screen-size texture that would be 8bpp and then use a shader to render it to the display window using a 1-dimensional 32-bit texture as my CLUT.  There would be part of the screen that would opaquely overlap the 256 color portion of the screen (I think that's called a billboard) which would be 32-bit truecolor.  The 1D texture would change every frame of animation.

Is what I'm doing possible in the current version of SFML?

SamuraiCrow

  • Newbie
  • *
  • Posts: 40
    • Yahoo Instant Messenger - samuraileumas
    • View Profile
Greyscale 8bpp mode?
« Reply #3 on: February 23, 2010, 08:14:21 pm »
On second thought I'll probably palette the billboard also.  It will make everything simpler that way.

The important part is that I need to cycle the entries in the palette manually so I need to have control over the palette.