1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<title>G3X_SetFog</title> 9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13 14<h1 align="left">G3X_SetFog <img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></H1> 15<H2>Syntax</H2> 16 17<dl> 18 <dd> 19<PRE> 20<CODE>#include <nitro/gx/g3x.h></CODE><BR> 21<CODE>void G3X_SetFog( 22 BOOL enable,<BR> GXFogBlend fogMode,<BR> GXFogSlope fogSlope,<BR> int fogOffset<BR>);</CODE></PRE></dd> 23</dl><h2>Arguments</h2> 24 25<table border="1" width="100%"> 26 27 <tr> 28 <TD width="109"><em><strong><font face="Courier New">enable</font></strong></em></TD> 29 <TD width="593">Sets whether fog is enabled</TD> 30 </tr> 31 <TR> 32 <TD><em><strong><font face="Courier New">fogMode</font></strong></em></TD> 33 <TD>Sets whether fog will be applied to color in addition to the a-value</TD> 34 </TR> 35 <TR> 36 <TD><em><strong><font face="Courier New">fogSlope</font></strong></em></TD> 37 <TD>Sets the gradient for applying fog</TD> 38 </TR> 39 <TR> 40 <TD><em><strong><font face="Courier New">fogOffset</font></strong></em></TD> 41 <TD>Sets the depth value where fog calculations start</TD> 42 </TR> 43 </table> 44<h2>Return Values</h2> 45<p>None.</p> 46<H2>Description</H2> 47<P>This function sets Fog to enable/disable and how fog is applied. The larger the last number in the <code>GXFogSlope</code> format symbol indicates more flexibility in how the fog is applied. That is to say, if this value is <code>x</code>, the depth value is applied from <em><strong><code>fogOffset</code></strong></em> to <em><strong><code>fogOffset</code></strong></em> + <code>x</code> and the fog gradually becomes denser (the index in the referenced fog table grows larger). 48</P> 49<TABLE border="1"> 50 <TBODY> 51 <TR> 52 <TD width="30%"><CODE>GX_FOGBLEND_COLOR_ALPHA</CODE></TD> 53 <TD><CODE>Fog blending applied to the pixel's color value and α-value</CODE></TD> 54 </TR> 55 <TR> 56 <TD><CODE>GX_FOGBLEND_ALPHA</CODE></TD> 57 <TD><CODE>Fog blending applied only to the pixel's α-value</CODE></TD> 58 </TR> 59 </TBODY> 60</TABLE> 61<P></P> 62<TABLE border="1"> 63 <TBODY> 64 <TR> 65 <TD width="30%"><CODE>GX_FOGSLOPE_0x8000</CODE></TD> 66 <TD>Fog becomes denser according to the depth value with a width of 0x8000</TD> 67 </TR> 68 <TR> 69 <TD><CODE>GX_FOGSLOPE_0x4000</CODE></TD> 70 <TD>Fog becomes denser according to the depth value with a width of 0x4000</TD> 71 </TR> 72 <TR> 73 <TD><CODE>GX_FOGSLOPE_0x2000</CODE></TD> 74 <TD>Fog becomes denser according to the depth value with a width of 0x2000</TD> 75 </TR> 76 <TR> 77 <TD><CODE>GX_FOGSLOPE_0x1000</CODE></TD> 78 <TD>Fog becomes denser according to the depth value with a width of 0x1000</TD> 79 </TR> 80 <TR> 81 <TD><CODE>GX_FOGSLOPE_0x0800</CODE></TD> 82 <TD>Fog becomes denser according to the depth value with a width of 0x0800</TD> 83 </TR> 84 <TR> 85 <TD><CODE>GX_FOGSLOPE_0x0400</CODE></TD> 86 <TD>Fog becomes denser according to the depth value with a width of 0x0400</TD> 87 </TR> 88 <TR> 89 <TD><CODE>GX_FOGSLOPE_0x0200</CODE></TD> 90 <TD>Fog becomes denser according to the depth value with a width of 0x0200</TD> 91 </TR> 92 <TR> 93 <TD><CODE>GX_FOGSLOPE_0x0100</CODE></TD> 94 <TD>Fog becomes denser according to the depth value with a width of 0x0100</TD> 95 </TR> 96 <TR> 97 <TD><CODE>GX_FOGSLOPE_0x0080</CODE></TD> 98 <TD>Fog becomes denser according to the depth value with a width of 0x0080</TD> 99 </TR> 100 <TR> 101 <TD><CODE>GX_FOGSLOPE_0x0040</CODE></TD> 102 <TD>Fog becomes denser according to the depth value with a width of 0x0040</TD> 103 </TR> 104 <TR> 105 <TD><CODE>GX_FOGSLOPE_0x0020</CODE></TD> 106 <TD>Fog becomes denser according to the depth value with a width of 0x0020</TD> 107 </TR> 108 </TBODY> 109</TABLE> 110<P>Below are the matrix format type definitions used in the argument.</P> 111<PRE><CODE>typedef enum 112{ 113 GX_FOGBLEND_COLOR_ALPHA = 0, 114 GX_FOGBLEND_ALPHA = 1 115} 116GXFogBlend; 117 118typedef enum 119{ 120 GX_FOGSLOPE_0x8000 = 0, 121 GX_FOGSLOPE_0x4000 = 1, 122 GX_FOGSLOPE_0x2000 = 2, 123 GX_FOGSLOPE_0x1000 = 3, 124 GX_FOGSLOPE_0x0800 = 4, 125 GX_FOGSLOPE_0x0400 = 5, 126 GX_FOGSLOPE_0x0200 = 6, 127 GX_FOGSLOPE_0x0100 = 7, 128 GX_FOGSLOPE_0x0080 = 8, 129 GX_FOGSLOPE_0x0040 = 9, 130 GX_FOGSLOPE_0x0020 = 10 131} 132GXFogSlope;</CODE></PRE> 133<h2>See Also</h2> 134<P><A href="G3X_SetFogColor.html"><code>G3X_SetFogColor</code></A>, <A href="G3X_SetFogTable.html"><code>G3X_SetFogTable</code></A></P> 135<H2>Revision History</H2> 136<P>2004/01/19 Initial version.</P> 137<hr><p>CONFIDENTIAL</p></body> 138</html> 139