ProceduralPlanets

◆ TextureLODSteps

int ProceduralPlanets.PlanetManager.TextureLODSteps
staticgetset

Specifies the number of Level Of Detail (LOD) steps that should be used if TextureDetailMode.LOD or TextureDetailMode.LOD_Separate is used. Valid values = 2-5.

Default value is 5 (max).

When changed to a new value the LOD textures for planets existing in the scene are automatically recreated with the new number of steps. Note that you may need to update TextureLOD* arrays.



using System.Collections;
// This example requires a PlanetManager instance to be present in the scene.
// Add the "Procedural Planets/Prefabs/PlanetManager" prefab to the scene first.
// Then create another gameobject and attach this example script to it.
public class Example : MonoBehaviour
{
void Start()
{
// Create a random planet at the center of the scene
PlanetManager.CreatePlanet(Vector3.zero);
// Set the Texture Detail Mode to Level of Detail (LOD)
PlanetManager.TextureDetailMode = PlanetManager.TextureDetailModes.LOD;
// Set number of texture LOD levels to 5
PlanetManager.TextureLODSteps = 5;
// Set the texture LOD detail levels by using an array of texture resolution levels
// The first value in the array is the highest level of detail and the last value in the array is the lowest quality
PlanetManager.TextureLODCommon = new int[5] { 7, 6, 5, 3, 1 };
// Set the planet sizes used to transition between mesh LOD levels
// Note: There are only 4 entries in this array because it specifies the size *between* the LOD levels.
// The float values in the array represent the ratio between screen height and the height of a planet as seen by the camera.
// E.g. the value 0.5f = when the planet takes up half the screen height.
PlanetManager.TextureLODPlanetSizes = new float[4] { 0.6f, 0.4f, 0.2f, 0.05f };
}
}
See also
TextureDetailMode, TextureLODPlanetSizes, TextureLODCommon, TextureLODComposition, TextureLODBiome, TextureLODClouds, TextureLODCities, TextureLODLava, TextureLODPolarIce, TextureLODGas