Archived

This topic is now archived and is closed to further replies.

d000hg

Illogical choices for possible TextureStage combinations?

Recommended Posts

I have a GF2MX & I''m aware of limitations like 2 textures, which have to be put in the first two stages only. However I''ve found some other things with varying degrees of wierdness: 1)I can only use up to stage 2 (the 3rd stage) or everything goes black even if in stage 3 I just pass through the values from stage 2. 2)I can have a texture in state 0 (just selecting arg1) and one in state 1 being blended with it. With just this I can then change state 0 to take two inputs rather than just the texture. Or I can put state 2 with some colour input. But I can''t do both no matter what the operation is. 3)It seems I''m limited to 3 inputs no matter how I arrange it which kinda sucks - with 3 stages proper and a 3arg op like MULTIPLYADD I could do so much more. This way I can''t even use both diffuse & specular together with 2 textures! Why are such (apparently) simple limitations there? 2 textures is obvious but why not being able to have two inputs to stage 0 if I have stages 1 and 2 in use? I do have recent drivers.

Share this post


Link to post
Share on other sites
Muhammad: you forgot the http://

http://tomsdxfaq.blogspot.com


d000hg:

APIs such as the TSS in D3D present a conceptual and abstract version of what's available in hardware (to allow manufacturers to do things in different ways). The true hardware is actually much much more rigid - remember it's just a set of logic gates and other hardwired electronic components.

Fixed function cards such as the GeForce2 are just that, very much fixed.

AFAIK, with many cards, what the SetTextureStageState() calls translate into are parameters of a ***fixed*** equation such as:
"OUTPUT = +/- D * (A*(1-C)+B*C) + B*C "* where A,B,C and D are inputs that can come from one of a certain set of possible choices [e.g. D3DTA_TEXTURE or D3DTA_DIFFUSE] which are configured by your SetTextureStageState() call.

Cards that support more stages with arbitrary operations simply have a bigger fixed equation (i.e. more hardwired logic gates). Usually the same equation repeated where the output of one unit can be fed in as an input to another unit (if you've ever done any computer science, physics or electronics courses, the combination of gates to form larger components ["adders" and the like] should be familar to you.

Due to the fixed nature of the equation in use (potentially a different one for each manufacturer), the conceptual SetTextureStageState() model doesn't neatly map onto it.
Usually there are enough inputs in the fixed equation to allow all possibilities for a certain number of stages (say 2), after those, if there are any spare inputs (say an A and D in the one above), operations using those inputs are exposed - which is why you get cards where the only thing you can do in stage 3 is say an ADD and nothing else.


As Muhammad says, take a look at Tom's FAQ for more info.
It's turning into a very handy resource; well worth a read. As well as being very knowledgable and generally a cool bloke, he's one of the very few people who's seen the way things work from both sides of the fence (he used to write drivers for 3DLabs and now does games at Mucky Foot. One of his drivers is used in the DDK as an example of how to write good drivers).


In nVidia parlance, the fixed equation(s) are known as register combiners. Those are exposed directly by an nVidia OpenGL extension or the "8 stage setup/hack" in D3D.

With the GeForce256/GeForce2's, as I'm sure I've mentioned a few times on here before: they do any 2 stage setups, two or three 3 stage setups, a single 4 stage setup (for nVidia's version of emboss bump mapping) and the 8 stage combiner exposing setup. nVidia devrel told me that personally BTW not just my experience or opinion.

Any others (I'm not aware of any) depend entirely on drivers exposing them (i.e. translating the TSS model into their fixed equation).

[* that example from a non D3D games console graphics chip rather than a PC graphics card, but illustrates the point nicely]

--
Simon O'Connor
ex -Creative Asylum
Programmer &
Microsoft MVP


[edited by - s1ca on July 27, 2003 6:06:56 AM]

Share this post


Link to post
Share on other sites