glsl不支持类型的隐式或显示的转换,只能通过构造函数来转。 float转int,可以这样做 float f=2.0; int i=int(f); 不可以这样: float f=2.0; int i=floor(f);