I've been asked to port some old HLSL code (Shader Model 2.0/3.0) into another language.
There is a line in the code that reads - int(value)
or int(x)
.
But it doesn't seem to be a "convert to integer" or "return integer of" or similar command.
Anyone know what int(x)
does in older versions of HLSL?
Thank you very much!
EDIT: ///////////
The line in the code reads:
x = int(x / 12) * 12;
it seems intended to "step" or "toon" the value of x... this should be the same as using the 2 code lines;
int x2 = x / 12;
x = x2 * 12;
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
x = int(x / 12) * 12;
actually does to the value of x under HLSL Shader Model 2.0/3.0. Thanks for any help.