OpenGL tell me my Video Card has 4 texture-units,but...

Started by
5 comments, last by OrangyTang 18 years, 4 months ago
OPENGL:glGet(GL_MAX_TEXTURE_UINT) returns 4 D3D:GetDeviceCaps,caps.dwMaxBlendStages == 8 which is correct? my terrain program(4 texture layers,3 alpha maps between them) is now do single-pass rendering in D3D,and multi-pass in OpenGL.and I want to do single-pass in OpenGL. the fact that I can do 7layer multitexturing in D3D means my card do support 8 texture blend stages. but OpenGL tell me the max-texture-units is 4,so can I do single-pass rendering with OpenGL?
Advertisement
I'm guessing you've got an NV card?

In OpenGL NV only expose 4 texture units via the fixed function pipeline, to use more you'll have to use a fragment shader
You can use Cg, Vertex/Fragment programs or GLSL to access 16 texture units. ATI has 8 texture units in the FFP.
weird. why does NV do that?
Try glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS), it returns the actual number of texture units.
-u.
- a human beyond the bug -
Code-R asked
Quote:
weird. why does NV do that?

http://developer.nvidia.com/object/General_FAQ.html#t6
Quote:Original post by Code-R
weird. why does NV do that?

Because a texture image unit (ie. that which lets you sample from a texture, including any filtering done) is seperate from a texture coord unit (which includes a set of texture coords, behaviour for wrapping/clamping and texture coord generation). A matching pair of these makes up a complete fixed function texture unit.

Obviously these all take up space on the chip. nVidia obviously thinks that it's chip real estate is better spent on extra texture samplers at the expense of texture coord sets (and they've got a point - most fragment programs typically use the same set of texture coords for multiple textures, such as colour+normalmap+specularmap).

This topic is closed to new replies.

Advertisement