0

So I have been trying to use the power of compute shaders to speed up the process of generating simplex noise for my map terrain generation in unity. The problem is that for the game to work it requires everything to be deterministic in order to prevent desync in its lockstep simulation. To do this I need to use some sort of fixed point math in order to avoid the nondeterministic mess that is floats :( . Wondered if anyone could help with this as can't seem to figure out how to achieve this in a reasonable run time

4

1 回答 1

0

fixed您可以在着色器中使用一种数据类型。它的值范围从 -2.0 到 2.0,精确到 1/256。这应该这样做。

如果范围不适合您,您将不得不使用整数,这在旧平台上不受支持(即使它们在内部使用浮点模拟,这不是您想要的)。

请参阅https://docs.unity3d.com/Manual/SL-DataTypesAndPrecision.html

于 2017-04-30T13:16:37.947 回答