赞
踩
Most mobile GPUs support both precision types, half being more efficient. So if you’re optimizing for mobiles it makes sense to use half as much as possible. The rule of thumb is to use float for positions and texture coordinates only and half for everything else, provided that the results are good enough.
When not targeting mobile platforms, precision isn’t an issue because the GPU always uses float, even if we write half. I’ll consistently use float in this tutorial series.
There’s also the fixed type, but it’s only really supported by old hardware that you wouldn’t target for modern apps. It’s usually equivalent to half.
来源:https://catlikecoding.com/unity/tutorials/custom-srp/draw-calls/
翻译:
大多数移动GPU都支持这两种精度类型,half类型效率要高。所以,如果你在优化移动设备,那么尽可能多地使用half是有意义的。根据使用经验,只在位置(Positions)和纹理坐标(Texture Coordinates)上使用float,其他的在结果足够好的情况下使用half。
当不针对移动平台时,精度不是问题,因为GPU总是使用浮点数,即使我们写了half。
也有fixed类型,但它只主要支持旧设备,现代应用程序不用考虑它。fixed通常就相当于half。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。