nV News Forums

 
 

nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   NVIDIA Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=14)
-   -   General Combiners (http://www.nvnews.net/vbulletin/showthread.php?t=12131)

TriangleMan 05-20-03 09:49 AM

General Combiners
 
Sorry this is a bit off-topic, but I couldn't find an appropriate forum.

In a general combiner, you can say something like:
product = tex0 * tex1; \n

Is there a way to multiply by a constant?
IE
product = tex0 * 0.5;

When I try this, it says that it get's unknown tokens.

Thanks,

TM
:beer2:

Bert 05-20-03 11:25 AM

You have to put the number into a constant register first:

const0 = (.5, .5, .5, .5);
product = tex0 * const0;

TriangleMan 05-20-03 11:51 AM

:banghead:

Thanks, but I outsmarted myself. I shoudl have asked for what I really wanted.

If I do that, it works just fine. If I try to use a constant ABOVE 1.0, then it only uses the fractional portion, so

const0 = (1.2, 1.2, 1.2, 1.0)

results in my multiply being .2, .2, .2, 1.0.

Do you know any way around this? We've tried multiplying by the fraction, and scale_by_two(), but can't seem to get the syntax right.

Thanks,

Chris

Bert 05-20-03 11:58 AM

Works for me:
Code:

const0 = (.6, .6, .6, 1.0); //actually 1.2
{
    rgb {
        result = tex0 * const0;
        scale_by_two();
    }
}


TriangleMan 05-20-03 01:29 PM

:dance:

I love these extended smilies....

Thanks,
I had implemented the scale_by_two() wrong.
I had done spare0 = scale_by_two();

I used your example and it worked!.

Thank you,

TM.


All times are GMT -5. The time now is 11:47 AM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.