public EffectHolder(CelestialBodyGenerator generator) { this.generator = generator; if (generator.body.shading.hasOcean && generator.body.shading.oceanSettings) { oceanEffect = new OceanEffect(); } if (generator.body.shading.hasAtmosphere && generator.body.shading.atmosphereSettings) { atmosphereEffect = new AtmosphereEffect(); } }
public List <Material> GetMaterials() { if (!active) { return(null); } Init(); if (generators.Count > 0) { Camera cam = Camera.current; Vector3 camPos = cam.transform.position; SortBodiesFarToNear(camPos); for (int i = 0; i < generators.Count; i++) { var generator = generators[i]; // Oceans if (displayOceans) { if (generator.body.shading.hasOcean) { if (oceanEffects[i] == null) { oceanEffects[i] = new OceanEffect(); } oceanEffects[i].Update(generator, oceanShader); postProcessingMaterials.Add(oceanEffects[i].GetMaterial()); } } } } return(postProcessingMaterials); }