1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../css/manpage.css" type="text/css" /> 7 <link rel="stylesheet" href="../css/timetable.css" type="text/css" /> 8 <title>litp - Light coefficients</title> 9 </head> 10 <body> 11 <h1>litp - Light coefficients</h1> 12 13 <h2>Calling Format</h2> 14 <div class="section"> 15 <pre class="definition"> 16litp dest, src 17</pre> 18 </div> 19 20 <h2>Operands</h2> 21 <div class="section"> 22 <table class="arguments"> 23 <thead> 24 <tr> 25 <th>Name</th> 26 <td>Registers</td> 27 </tr> 28 </thead> 29 <tr> 30 <th>dest</th> 31 <td>An output register or temporary register.</td> 32 </tr> 33 <tr> 34 <th>src</th> 35 <td>A temporary register, input register, or floating-point constant register.</td> 36 </tr> 37 </table> 38 </div> 39 40 <h2>Overview</h2> 41 <div class="section"> 42 <p> 43 Runs some lighting calculations.<BR> This instruction determines the sign of the product of the normal and light vectors and that of the normal and half vectors required by the vertex shader to perform lighting. It also clamps the specular coefficient, which is equivalent to the value specified by <CODE>GL_SHININESS</CODE> for the material color in OpenGL ES1.1.<BR> <br> If called with the dot product of the normal and light vector stored in <CODE>src.x</CODE>, the specular coefficient stored in <CODE>src.y</CODE>, and the dot project of the normal and half vector stored in src.w, then parameters that aid in calculating specular lighting will be stored in <CODE>dest</CODE> and the status register.<br> <br> Status registers are also simultaneously changed by this instruction.<br> If <CODE>src.x</CODE> is larger than <CODE>0</CODE>, status register 0 is set to <CODE>1</CODE>. If <CODE>src.w</CODE> is larger than <CODE>0</CODE>, status register 1 is set to <CODE>1</CODE>.<br> After this instruction is called, if a branch instruction, such as <CODE>ifc</CODE>, determines that both status registers are set to <CODE>1</CODE>, it is assumed a power calculation will be made.<br> 44 </p> 45 </div> 46 47 <h2>Operation</h2> 48 <div class="section"> 49<pre class="definition"> 50dest.x = ( src.x < 0 ) ? 0 : src.x 51dest.y = ( src.y < -127.9961 ) ? -127.9961 : ( src.y > 127.9961 ? 127.9961 : src.y ) 52dest.z = 0 53dest.w = ( src.w < 0 ) ? 0 : src.w 54status_reg0 = ( src.x > 0 ) ? 1 : 0 55status_reg1 = ( src.w > 0 ) ? 1 : 0 56</pre> 57 </div> 58 59 <h2>Code Example</h2> 60 <div class="section"> 61<pre class="definition"> 62// r0.x : Stores the dot product of the normal and light vectors. 63// r0.y : Stores the specular coefficient. 64// r0.z : This value is not used. 65// r0.w : Stores the dot product of the normal and half vectors. 66 67litp r1, r0 68ifc 1, 1, 1 // if ( N*H > 0 && N*L > 0 ) 69 pow r2.x, r1.w, r1.y // r2.x = power ( r1.w , r1.y ); 70endif 71</pre> 72 </div> 73 74 <h2>Timetable</h2> 75 <div class="section"> 76 <table class="timetable"> 77 <tr> 78 <th></th> 79 <th>1</th><th>2</th><th>3</th><th>4</th><th>5</th> 80 </tr> 81 <tr> 82 <th rowspan="2"><CODE>litp</CODE></th> 83 <td class="read" rowspan="2">read</td> 84 <td class="MAX">MAX</td> 85 <td class="MIN">MIN</td> 86 <td class="post" rowspan="2">post</td> 87 <td class="write" rowspan="2">write</td> 88 <td class="dummy" rowspan="2"></td> 89 </tr> 90 <tr> 91 <td class="CMP" colspan="2">CMP</td> 92 </tr> 93 </table> 94 </div> 95 96 97 <h2>Revision History</h2> 98 <div class="section"> 99 <dl class="history"> 100 <dt>2011/12/20</dt> 101 <dd>Initial version.<br /> 102 </dd> 103 </dl> 104 </div> 105 106 <hr><p>CONFIDENTIAL</p></body> 107</html>