<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta content="text/html; charset=windows-1251" http-equiv="Content-Type">
<title>texture_environment_combiners_NV_ATI_ARB</title></head><body>case GL_SUBTRACT:<br>
<------> color_combine = (R200_TXC_ARG_B_ZERO |<br>
<------><------><------> R200_TXC_COMP_ARG_B |.<br>
<------><------><------> R200_TXC_NEG_ARG_C |<br>
<------><------><------> R200_TXC_OP_MADD);<br>
<------> R200_COLOR_ARG( 0, A );<br>
<------> R200_COLOR_ARG( 1, C );<br>
<br>
<airlied> AndrewR: generally you have a negative bit, so you just feed in arg1 and negative arg2 and arg0 == 1<code><br>
R200_TXC_NEG_ARG_A (1 << 19)<br>
<br>
<AndrewR> so, for four-component input one can just set arg0 ==
arg3 == 1, then negate arg 2 and freed arg 1, and execute add (NV
version)<br>
</code><br>
<br>
case GL_ADD:<br>
<------> color_combine = (R200_TXC_ARG_B_ZERO |<br>
<------><------><------> R200_TXC_COMP_ARG_B |.<br>
<------><------><------> R200_TXC_OP_MADD);<br>
<------> R200_COLOR_ARG( 0, A );<br>
<------> R200_COLOR_ARG( 1, C );<br>
<br>
ARB_texture_env_combine operations in terms of NV_texture_env_combine4 NV extension:<br>
<pre>REPLACE Arg0 = <br>ADD Arg0 * Arg1 + Arg2 * Arg3 (arg0, 1, 1, 0)<br><br><br>MODULATE Arg0 * Arg1 =<br>ADD Arg0 * Arg1 + Arg2 * Arg3 (arg0, arg1, 1, 0)<br><br>ADD Arg0 + Arg1 =<br>ADD Arg0 * Arg1 + Arg2 * Arg3 (arg0, 1, arg1, 1)<br><br>ADD_SIGNED_ARB Arg0 + Arg1 - 0.5 =<br>ADD_SIGNED_EXT Arg0 * Arg1 + Arg2 * Arg3 - 0.5 (arg0, 1, 1, arg1)<br><br>SUBTRACT_ARB Arg0 - Arg1 =<br>ADD Arg0 * Arg1 + Arg2 * Arg3 (arg0, 1, INV(arg1), 1)<br><br>MODULATE_ADD_ATI Arg0 * Arg2 + Arg1 = <br>ADD Arg0 * Arg1 + Arg2 * Arg3 (arg0, arg1, arg1, 1)<br><br>MODULATE_SIGNED_ADD_ATI Arg0 * Arg2 + Arg1 - 0.5 =<br>ADD_SIGNED_EXT Arg0 * Arg1 + Arg2 * Arg3 - 0.5 (arg0, arg2, arg1, 1)<br><br><br>MODULATE_SUBTRACT_ATI Arg0 * Arg2 - Arg1 = <br>ADD Arg0 * Arg1 + Arg2 * Arg3 (arg0, arg2, INV(arg1), 1)<br><br><br>INTERPOLATE_ARB Arg0 * (Arg2) + Arg1 * (1-Arg2) =<br>ADD Arg0 * Arg1 + Arg2 * Arg3 (arg0, arg2, arg1, INV(arg2))<br><br></pre>
<br>
</body></html>