2 multitexture questions

Hi all. I have a couple of questions concerning multitexturing. These may be answered in the Red Book, but it’s Friday afternoon… I’m at work… my Red Book is at home… so humour me, please!

First question: Assuming you wish to render a polygon with a texture map and a light map, can you get the same result with multipass rendering as with multitexture? I found an article on delphi3d that seems to say flat out that you can’t, and has pictures to prove it. It says you have to invert your lightmap and do subtractive blending, because “OpenGL does not support multiplicative alpha blending”.

But surely you could get the desired result by rendering the polygon with the texture map, then rendering it again with the lightmap as texture format GL_LUMINANCE? Doesn’t that produce the result C = CfLt, which is what we’d want?

Second question: So how widely supported is the multitexture extension? I assume most (all?) “modern” PC hardware supports it (but with how many texture units?), but if you demanded it, how much hardware would you be cutting out? That article I mentioned above said that a Voodoo2 supported multitexturing… surely there’s not much around that’s older than that?

[This message has been edited by Stormie (edited 07-06-2001).]

First: Assuming that a given polygon requires only a single texture, then yes, you can render that polygon with a lightmap in two passes or in one pass on multitexture hardware. In two passes you draw the base texture, then in the lightmap pass just use glBlendFunc(GL_ZERO, GL_SRC_COLOR). In multitexture mode, just use GL_MODULATE mode on both texture units.

Second: I would agree. I doubt you would be cutting out any significant number of users by requiring multitexture support. Though I would assume that number would depend upon your targeted demographic to some degree.

have a look at the multitexturing example on my site (profile) lightmapping either with multipass or with multitexture

2/ cards that dont support multitexture voodoo1,riva128,intel740?
most cards have 2 texture units. radeon has 3 ,geforce3 has 4

Originally posted by zed:

most cards have 2 texture units. radeon has 3 ,geforce3 has 4

Only 2? ugh that must have been why my program kept freezing today when i was trying to get 3 and 4 texture units to work. I saw up to GL_TEXTURE31_ARB in glext.h so i thought “Hey, I bet i’ve got at least 10 supported on this geforce 256! I’ll try 3 and 4!!!”. Uhhh, i just started learning how to use extensions today, i decided to start with multi texturing.