PDA

View Full Version : texture upload.



noncopyable
11-24-2007, 05:59 AM
Hello.

Is it possible to upload a texture without converting and clamping? If it isn't, why? :)

Thank you.



GL_RGB Each element is an RGB triple. The GL converts it
to floating point and assembles it into an RGBA
element by attaching 1 for alpha. Each component
is then multiplied by the signed scale factor
GL_c_SCALE, added to the signed bias GL_c_BIAS,
and clamped to the range [0,1] (see
glPixelTransfer).

GL_RGBA Each element contains all four components. Each
component is multiplied by the signed scale factor
GL_c_SCALE, added to the signed bias GL_c_BIAS,
and clamped to the range [0,1] (see
glPixelTransfer).

Xmas
11-24-2007, 07:19 AM
Is it possible to upload a texture without converting and clamping? If it isn't, why? :)
If you want unclamped values you have to use one of the texture formats provided by the extensions ARB_texture_float, EXT_texture_integer, EXT_packed_float, or EXT_texture_shared_exponent.

The normal fixed point texture formats simply can't represent values outside the [0, 1] range.

noncopyable
11-24-2007, 09:29 AM
This restriction may be understandable before programmable gpus, but right now isn't it something OpenGL must support? DirectX supports this btw?

Didn't know about EXT_texture_integer [Shipping for GeForce 8 Series (November 2006)], i think this is what i want. but my card doesn't support, since it is quite new (and unpopular?).

Jan
11-24-2007, 11:36 AM
This isn't a feature, that you can just enable. Your hardware needs to support it. If your hardware does support it, it will also expose the needed extensions.

DirectX (i assume you mean D3D9 or at least D3D10) "supports" it, IF you have hardware that can handle it.

Jan.

noncopyable
11-24-2007, 12:00 PM
If D3D9-10 support something, a hardware -have to- handle it, to be able to say that they support D3D9-10, i was thinking this idea is one of the main selling points of DX, which is possible another misinterpretation of mine :)

ZbuffeR
11-24-2007, 12:09 PM
right now isn't it something OpenGL must support?
As everybody else pointed out, this is supported by OpenGL.
If your hardware is not able to do it, the graphic API (whether D3D or GL) will not allow you to use it anyway.

What is your card btw ?

V-man
11-24-2007, 12:22 PM
BTW, this is a DX10 level feature. The extension was put forward by NV to go along with their 8800 when it came out.

noncopyable
11-24-2007, 12:29 PM
If your hardware is not able to do it, the graphic API (whether D3D or GL) will not allow you to use it anyway.

This is something i don't really get. To be able to claim such a thing, vendors should pay attention to OpenGL as they do for DX, since mostly my troubles come from what -implementation- can do, more than what hardware can do.

My card is X1950Pro.

I am not good at English, sorry :)

ZbuffeR
11-24-2007, 01:19 PM
GL implementation is the combination of driver and hardware.
D3D implementation is the combination of Microsoft spec+implem, driver, and hardware.
That allowed some D3D10 features to be available in GL even before Vista was out.

And if you have problems with your ATI card, complain to ATi/AMD, or buy nvidia.

Humus
11-24-2007, 02:06 PM
My card is X1950Pro.

EXT_texture_integer is not supported on that hardware. However, you can use GL_ATI_texture_float, which won't clamp the values.

m3xican
11-27-2007, 03:30 AM
ARB_texture_rectangle (http://www.opengl.org/registry/specs/ARB/texture_rectangle.txt) could be a good solution, and it's available from OpenGL 1.1

Xmas
11-27-2007, 04:59 AM
ARB_texture_rectangle (http://www.opengl.org/registry/specs/ARB/texture_rectangle.txt) could be a good solution, and it's available from OpenGL 1.1
And it's completely unrelated to this thread.

m3xican
11-27-2007, 06:27 AM
And it's completely unrelated to this thread.
My bad, I've misunderstood the question.
ARB_texture_float and other similar extensions are the right solution.

Sorry for the wrong answer :P