public void createNoise( int seedSurface, int seedLand, int seedLandColour01, int seedLandColour23, int seedCity, int seedCloud ) { perlinNoiseSurface = new PlanetNoisePerlin( seedSurface ); perlinNoiseLand = new PlanetNoisePerlin( seedLand ); perlinNoiseLandColour01 = new PlanetNoisePerlin( seedLandColour01 ); perlinNoiseLandColour23 = new PlanetNoisePerlin( seedLandColour23 ); _cityRnd = new System.Random( seedCity ); perlinNoiseCloud = new PlanetNoisePerlin( seedCloud ); worleyNoiseCloud = new PlanetNoiseWorley( seedCloud ); isDoingCityWork = false; #if USE_GPU if( noiseComputeShader == null ) { useComputerShader = false; if( SystemInfo.supportsComputeShaders ) { useComputerShader = true; noiseComputeShader = ( ComputeShader ) AssetDatabase.LoadAssetAtPath( computeShaderPath, typeof( ComputeShader ) ); if( noiseComputeShader ) { _diffuseKernel = noiseComputeShader.FindKernel( "diffuseNoiseKernel" ); _cloudKernel = noiseComputeShader.FindKernel( "cloudNoiseKernel" ); } else { Debug.LogError( "couldn't load " + computeShaderPath ); useComputerShader = false; } } } #endif }
public void createNoise( int seedSurface, int seedLand, int seedLandColour01, int seedLandColour23, int seedCity, int seedCloud ) { perlinNoiseSurface = new PlanetNoisePerlin( seedSurface ); perlinNoiseLand = new PlanetNoisePerlin( seedLand ); perlinNoiseLandColour01 = new PlanetNoisePerlin( seedLandColour01 ); perlinNoiseLandColour23 = new PlanetNoisePerlin( seedLandColour23 ); _cityRnd = new System.Random( seedCity ); perlinNoiseCloud = new PlanetNoisePerlin( seedCloud ); worleyNoiseCloud = new PlanetNoiseWorley( seedCloud ); isDoingCityWork = false; #if USE_GPU if( noiseComputeShader == null ) { useComputerShader = false; if( SystemInfo.supportsComputeShaders ) { useComputerShader = true; noiseComputeShader = ( ComputeShader ) AssetDatabase.LoadAssetAtPath( computeShaderPath, typeof( ComputeShader ) ); if( noiseComputeShader ) { _diffuseKernel = noiseComputeShader.FindKernel( "diffuseNoiseKernel" ); _cloudKernel = noiseComputeShader.FindKernel( "cloudNoiseKernel" ); } else { //Debug.LogError( "couldn't load " + computeShaderPath ); useComputerShader = false; } } } #endif }