How to make the texture with internal format RGBD?
In order to execute similary code:


glCopyTexImage2D (GL_TEXTURE_2D, 0, GL_RGB16, …);
glCopyTexImage2D (GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, …);

This is don’t work.

There’s no such thing as a single texture with color and depth information. They need to be two separate textures (perhaps of the same size).

Thanks, interestingly on D3D it is possible?

Is it a question ? If so, it’s not a DX forum :slight_smile:

You could just use a RGBA16 texture and a simple fragment shader that writes the Alpha value do depth and replaces the alpha value with 1.


I’am had jump over these (similar) procedures.
In general it is clear. Thanks.

Originally posted by Racoon:
Thanks, interestingly on D3D it is possible?
Maybe in a IDirect3DSurface9, but not with a IDirect3DTexture9.

A surface in D3D is kind of (just a little) like a FBO (Frame Buffer Object) in GL. It can contain color info, depth, etc. So maybe you would be interested in using FBOs. :slight_smile: Although an FBO can contain multiple color attachments whereas a d3d surface can’t (as far as I know).

Ok, but the FBO is like are primary buffers in this sense.

[OFF-TOPIC] D3D does not support 16-bit floating point color and depth values in the same surface and/or texture. Even if some third party software does it, it’ll be doing it in software.

Originally posted by Racoon:
Ok, but the FBO is like are primary buffers in this sense.
Yes, you render to them. Use them for render to texture (RTT). They are simple enough to use.

To everyone else, I’m sure D3D is wonderdul, but how is this relevant?

It was a bit relevant in this particular case (particularly since the author seems to have used D3D) and it can be quite relevant some other times too, and if need be, i don’t see any crime in making comparisons between OpenGL and D3D on this particular forum (or elsewhere).
Sometimes features in OpenGL specifications (especially recently) are “inspired” from D3D and explicit references are given in some specs (and/or research papers by nVidia and ATI).
Nobody is discussing D3D over here, its just some feature set comparison, and its always good to know your “enemy”.

<speculation> oh god, here comes a flame war :wink: </speculation>