/*Save to texture*/ public static void EncodeSurfaceRegion(SurfaceBiomeDatabase.SurfaceBiome encode, Texture2D dataTexture, int index, out int nextIndex) { nextIndex = index; TextureEncoder.EncodeFloat(encode.Height, dataTexture, nextIndex, out nextIndex); TextureEncoder.EncodeFloat(encode.Floor, dataTexture, nextIndex, out nextIndex); TextureEncoder.EncodeFloat(encode.AdditiveHeightLimit, dataTexture, nextIndex, out nextIndex); GradientEncoder.EncodeGradient(encode.GroundPalette, dataTexture, nextIndex, out nextIndex); GradientEncoder.EncodeGradient(encode.WallPalette, dataTexture, nextIndex, out nextIndex); }
//Subtractive public GPUSurfaceBiome(SurfaceBiomeDatabase.SurfaceBiome surfaceBiome) { Persistance = surfaceBiome.Persistance; Height = surfaceBiome.Height; Floor = surfaceBiome.Floor; AdditiveHeight = surfaceBiome.AdditiveHeight; AdditiveHeightLimit = surfaceBiome.AdditiveHeightLimit; AdditiveOffset = surfaceBiome.AdditiveOffset; }