SFML community forums

Help => Graphics => Topic started by: pixartist on January 05, 2014, 01:22:54 pm

Title: 64-bit textures?
Post by: pixartist on January 05, 2014, 01:22:54 pm
Hi, I need to create a texture with a 64-bit color depth (or at least 32 bit). Is that possible? If so, how?
Title: Re: 64-bit textures?
Post by: Nexus on January 05, 2014, 01:36:44 pm
32 bit is the default. 64 bit is not possible with SFML, you need to use OpenGL directly.
Title: Re: 64-bit textures?
Post by: pixartist on January 05, 2014, 01:38:12 pm
But this is one of the most important features of modern hardware. How can this not be supported ?
(PS: I meant per channel)
Title: Re: 64-bit textures?
Post by: Nexus on January 05, 2014, 01:39:48 pm
But this is one of the most important features of modern hardware.
64 bit textures? I doubt it.

(PS: I meant per channel)
What games exactly need 64 bits to represent a single color? :o
Title: Re: 64-bit textures?
Post by: Daddi on January 05, 2014, 01:40:25 pm
May I ask what you want to achive with that much colors? Are current operating systems even capable of displaying 64bit colors?
Title: Re: 64-bit textures?
Post by: pixartist on January 05, 2014, 01:40:33 pm
Well, I consider Deferred rendering and HDR pretty important.
Title: Re: 64-bit textures?
Post by: pixartist on January 05, 2014, 01:41:11 pm
Well, I consider Deferred rendering and HDR pretty important.

I wanna use it for calculating heightmap erosion. Otherwise I'd have to use a double array and manually convert it to a texture every frame...
Title: Re: 64-bit textures?
Post by: pixartist on January 05, 2014, 01:42:56 pm
But this is one of the most important features of modern hardware.
64 bit textures? I doubt it.

(PS: I meant per channel)
What games exactly need 64 bits to represent a single color? :o
I for once used it to create a Game-Of-Life shader system... Textures are not only used for displaying images anymore. They are a convenient way of carrying 2D-data.
Title: Re: 64-bit textures?
Post by: Nexus on January 05, 2014, 01:44:02 pm
Not even OpenGL supports textures with 64 bits per channel (source (http://www.opengl.org/wiki/Image_Format)). Are you sure you're not confusing something?
Title: Re: 64-bit textures?
Post by: pixartist on January 05, 2014, 01:45:57 pm
I'm pretty sure XNA supported 256 bit textures (at LEAST 128 bit though)

Edit: 32bit per channel is max: http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.surfaceformat.aspx

see: Vector4
Title: Re: 64-bit textures?
Post by: Nexus on January 05, 2014, 01:47:57 pm
Are you sure they don't just gather multiple components to one? After all, you won't even find a built-in 128 bit integral type in programming languages.

Anyway, SFML doesn't support it :)
Title: Re: 64-bit textures?
Post by: pixartist on January 05, 2014, 01:50:03 pm
Are you sure they don't just gather multiple components to one? After all, you won't even find a built-in 128 bit integral type in programming languages.

Anyway, SFML doesn't support it :)

No, it really works. It's useful for shaders that contain more detailed information. Also it's 128 bits for all channels together. Each channel is a 32 bit float. I don't know the exact technical solution though.

Too bad I can't find any posts on how to change the surface format in sfml manually and if sfml can even work with modified renderTextures.
Title: Re: 64-bit textures?
Post by: Nexus on January 05, 2014, 01:53:48 pm
I know that it works, I have used 32 bit integral textures for a geometric meshing application. But other texture formats are currently not supported by SFML, and I don't think they will be in the near future, since it's a rather advanced feature that only few people require for 2D rendering.

As stated, you should try to use OpenGL directly (or emulate the functionality somehow with smaller texture formats). You can use OpenGL on top of SFML, so you don't need to rewrite everything.
Title: Re: 64-bit textures?
Post by: pixartist on January 05, 2014, 01:58:25 pm
Hmm, SFML does not know the GL_RGBA32F enum :(
Title: Re: 64-bit textures?
Post by: Nexus on January 05, 2014, 02:01:15 pm
Yes, as I said "other texture formats are currently not supported by SFML". So, "you should try to use OpenGL directly" ;)
Title: Re: 64-bit textures?
Post by: pixartist on January 05, 2014, 02:07:27 pm
Edit: Is it possible to draw an opengl texture using sfml (to the sfml quad) ?
Title: Re: 64-bit textures?
Post by: Nexus on January 05, 2014, 03:21:01 pm
Edit: Is it possible to draw an opengl texture using sfml (to the sfml quad) ?
Since SFML can't handle texture formats other than GL_RGBA8, no.

You should have a look at the tutorials, documentation and examples to see how OpenGL and SFML interact. It's actually not that difficult to achieve, but of course you have to know the basics of OpenGL.