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 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/gx.h> 16 17void GXSetZScaleOffset( f32 scale, f32 offset ); 18</pre></dd></dl> 19 20<H2>Arguments</H2> 21<TABLE class="arguments" border="1" > 22 <TBODY> 23 <TR> 24<TH><STRONG><EM><CODE>scale</CODE></EM></STRONG></TH> 25<TD>specifies scale value for Z adjustment</TD> 26 </TR> 27 <TR> 28<TH>offset</TH> 29<TD>specifies offset value for Z adjustment</TD> 30 </TR> 31 </TBODY> 32</TABLE> 33 34<H2>Return Values</H2> 35<P>None.</P> 36 37<H2>Description</H2> 38<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> 39<P><SPAN class="argument">Zs' = Zs * scale + offset;</SPAN></P> 40<P>where <SPAN class="argument">Zs</SPAN> 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> 41<P>The viewport depth parameters are normalized coordinates from 0.0f to 1.0f, thus the offset value should be defined in the same manner.</P> 42 43<H2>See Also</H2> 44<P class="reference"> 45<A href="GXSetViewport.html">GXSetViewport</A> 46</P> 47 48<H2>Revision History</H2> 49<P> 502006/03/01 Initial version.<br> 51</P> 52 53<hr><p>CONFIDENTIAL</p></body> 54</HTML>