I’m in a situation where i have to combine 2 textures like this:
tex0 / 2 + tex1 / 2
rather than (tex0 + tex1) / 2 to avoid clamping
i do it like this:
!!RC1.0
{
rgb {
spare0 = tex0;
spare1 = tex1;
scale_by_one_half();
}
}
out.rgb = spare0 + spare1;
now i want to do the same with 4 textures
(tex0/2 + tex1/2) / 2 + (tex2/2 + tex3/2) / 2
(rather than (tex0/4 + tex1/4 + tex2/4 + tex3/4) or avoid precision/clamping issues
i cant figure out the rc code
can somone help me ?
ps: using blending to achieve the same is not an option
thnx in advance,
McBain