title: HLSL - What Does int(x) or int(value) do in High Level Shading Language 2.0?
body: <p>I've been asked to port some old HLSL code (Shader Model 2.0/3.0) into another language.</p>
  
  <p>There is a line in the code that reads -  <code>int(value)</code> or <code>int(x)</code>.</p>
  
  <p>But it doesn't seem to be a "convert to integer" or "return integer of" or similar command.</p>
  
  <p>Anyone know what <code>int(x)</code> does in older versions of HLSL?</p>
  
  <p>Thank you very much!</p>
  
  <p>EDIT: ///////////</p>
  
  <p>The line in the code reads:     </p>
  
  <p><code>x = int(x / 12) * 12;</code>     </p>
  
  <p>it seems intended to "step" or "toon" the value of x...  this should be the same as using the 2 code lines;     </p>
  
  <pre><code>int x2 = x / 12;   
  x = x2 * 12;  
  </code></pre>
  
  <p>right after another but the result comes out different - the rendered image screws up completely when I use the 2 line version. I may be able to remove this line completely and replace it with something else... its not a very crucial operation... but I'm curious to know what    </p>
  
  <p><code>x = int(x / 12) * 12;</code> </p>
  
  <p>actually does to the value of x under HLSL Shader Model 2.0/3.0. Thanks for any help.</p>