View Full Version : General Combiners
TriangleMan
05-20-03, 09:49 AM
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:
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
Works for me:
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.
vBulletin® v3.7.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.