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

Author Topic: Graphics: full 16-bit grayscale support  (Read 4363 times)

0 Members and 1 Guest are viewing this topic.

Strobe

  • Newbie
  • *
  • Posts: 15
    • View Profile
Graphics: full 16-bit grayscale support
« on: September 17, 2011, 01:09:35 am »
Hi!

I would eventually like to develop some height_field utilities with SFML, but as you may already know, height maps produce the best results when they are in a 16-bit format; 8-bit just really doesn't cut it.

My goal is to use the height maps in POV-Ray, though there are plenty of other programs supporting 16-bit grayscale images. I know how to produce 16-bit values using the red/green channels of an 8-bit image, but that format can be difficult to manipulate in POV. I'd like to avoid unnecessary conversions, especially if I make my utility publicly available.

sf::Image seems to be the only way to save images, and it appears to only accept 8-bit values.

16-bit grayscale support would include:
    * loading 16-bit data directly into images and textures
    * floating point textures (and, consequently, GLSL shaders)
    * drawing 16-bit data to render textures, using sprites
    * saving 16-bit grayscale PNG images


Since SFML is a multimedia library--and not only used for authoring games--this feature request doesn't seem entirely unreasonable :D

~Strobe

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Graphics: full 16-bit grayscale support
« Reply #1 on: September 17, 2011, 09:37:43 am »
Quote
loading 16-bit data directly into images and textures

From which file format?

Quote
floating point textures (and, consequently, GLSL shaders)

This is out of scope for SFML. It's only supported by recent graphics card, so it's a bad candidate for integration in SFML.
Moreover, it would be used for very specific use cases.

Quote
Since SFML is a multimedia library--and not only used for authoring games--this feature request doesn't seem entirely unreasonable

Support for 16-bits pixel components requires support for different formats (I mean, from the public API point of view), which I'm still not sure about.
And before 16-bits floating-point formats, there are other formats that are more important to support : 8 bits luminance, YUV, ARGB, ... ;)
Laurent Gomila - SFML developer

Silvah

  • Guest
Graphics: full 16-bit grayscale support
« Reply #2 on: September 17, 2011, 07:39:34 pm »
Quote from: "Laurent"
And before 16-bits floating-point formats, there are other formats that are more important to support : 8 bits luminance, YUV, ARGB, ... ;)
Wait. Does it mean SFML doesn't support alpha channel? Or it's just the ARGB vs RGBA issue?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Graphics: full 16-bit grayscale support
« Reply #3 on: September 17, 2011, 08:45:55 pm »
No no, don't worry, it's just ARGB vs RGBA ;)
Laurent Gomila - SFML developer

Strobe

  • Newbie
  • *
  • Posts: 15
    • View Profile
Graphics: full 16-bit grayscale support
« Reply #4 on: September 18, 2011, 07:35:06 pm »
Quote from: "Laurent"
Quote
loading 16-bit data directly into images and textures

From which file format?


From 16-bit grayscale PNGs, since they are generally the easiest format to work with.

Quote
Support for 16-bits pixel components requires support for different formats (I mean, from the public API point of view), which I'm still not sure about.
And before 16-bits floating-point formats, there are other formats that are more important to support : 8 bits luminance, YUV, ARGB, ... ;)


Ah, OK. That's all right  8) I'll probably check out the Visualization Library before I make an HF utility.

BTW Laurent, I'm very happy with SFML; it's a real joy to use! Thanks for all your hard work  :)

 

anything