public static float SampleHeightmap16(Double u, Double v, MapSO heightMap, bool bits24) { if (heightMap == null || !heightMap.IsCompiled) { return(0); } BilinearCoords coords = VertexHeightMap16.ConstructBilinearCoords(u, v, heightMap); return(Mathf.Lerp( Mathf.Lerp( SingleSample(coords.xFloor, coords.yFloor, heightMap, bits24), SingleSample(coords.xCeiling, coords.yFloor, heightMap, bits24), coords.u), Mathf.Lerp( SingleSample(coords.xFloor, coords.yCeiling, heightMap, bits24), SingleSample(coords.xCeiling, coords.yCeiling, heightMap, bits24), coords.u), coords.v)); }
public override void OnVertexBuildHeight(PQS.VertexBuildData data) { // Apply it data.vertHeight += heightMapOffset + heightMapDeformity * VertexHeightMap16.SampleHeightmap16(data.u, data.v, heightMap, false); }