1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="Microsoft FrontPage 5.0">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
8<TITLE>GXSetZScaleOffset</TITLE>
9</HEAD>
10<BODY>
11<H1 align="left">GXSetZScaleOffset</H1>
12<H2>C Specification</H2>
13<DL>
14  <DD>
15<PRE><CODE>#include &lt;revolution/gx.h&gt;</CODE></PRE>
16  <DD>
17<PRE><CODE>void GXSetZScaleOffset( f32 scale, f32 offset );</CODE></PRE>
18</DL>
19<H2>Arguments</H2>
20<TABLE border="1" cellpadding="3" cellspacing="0.1">
21  <TBODY>
22    <TR>
23<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>scale</FONT></STRONG></EM></TD>
24<TD width="520">Specifies scale value for Z adjustment</TD>
25    </TR>
26    <TR>
27<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>offset</FONT></STRONG></EM></TD>
28<TD width="520">Specifies offset value for Z adjustment</TD>
29    </TR>
30  </TBODY>
31</TABLE>
32<H2>Return Values</H2>
33<P>None.</P>
34<H2>Description</H2>
35<P>This function sets scale and offset values that are applied to the depth value of each pixel before it is written into the Z buffer. The Z modification function is:</P>
36<P><code><em><strong>Zs' = Zs * scale + offset;</strong></em></code></P>
37<P>where <strong><em><code>Zs</code></em></strong> is the result value in screen-space after model-view, projection and viewport transformations.<br>This function internally adjusts the viewport setting to realize these scaling/offsetting. With this function, you can easily modify depth priorities for each primitive without changing the entire viewport.</P>
38<P>The viewport depth parameters are normalized coordinates from 0.0f - 1.0f; thus, the <em><code>offset</code></em> value should be defined in the same manner.</P>
39<H2>See Also</H2>
40<P><A href="GXSetViewport.html"><CODE>GXSetViewport</CODE></A></P>
41<H2>Revision History</H2>
42<P>03/01/2006 Initial version.</P>
43</BODY>
44</HTML>