PDA

View Full Version : Texture Blending with Register Cobiners



zroobavela
04-03-2002, 09:32 AM
Hey.

First off, can someone possibly refer me to register combiner and nvparse documentation?

I tried links that were posted previously, but the links dont work (anymore?)

I know of course about the extension specification. I also read "Texture Blending" and otehr papers at NVidia.com. But with these, you must learn by example. which is tough.
I dont even understand what
discard = expand(tex0) means. What does the expand function do? What is discard and how is it I can still access it's value?
any help would be appreciate, thx.

now to the real problem.
I am trying to encode blending ratios in the primary color (col0).

That is, I want to perform the following operation:

out.rgb = col0.r * tex0 +
col0.g * tex1 +
col0.b * tex2 +
col0.a * tex3;
out.a = 1;

I cant even get col0.r * tex0 to give me what I expect, which is
col0.r * tex0.r +
col0.r * tex0.g +
col0.r * tex0.b;
(am I wrong?)

The actual code I use is the following:
/////////////////////////////////////
{
rgb
{
spare0 = col0.r * tex0;
}
}
out.rgb = spare0;
out.a = unsigned_invert(zero);
/////////////////////////////////////
When col0.r = 1 and tex0 is any texture,
The result displayed is white.
I must be missing something.
Does anyone see the problem with the above code?

thx

zroobavela
04-03-2002, 10:47 AM
Hi. A correction for the previous message.

What I expect 'out.rgb = col0.r * tex0' to do is:

out.r = col0.r * tex0.r
out.g = col0.r * tex0.g
out.b = col0.r * tex0.b

Am I wrong? cause it ain't doing that.

thx

zed
04-03-2002, 10:18 PM
there is a pdf u can get from nvidia that explains all the symbols

u want a final output of tex*colour

myself i dont use nvparse but use the opengl statements instead
put the colour into registerA + unsigned identity
and the texture into registerB + unsigned identity
set the rest to zero