6 Months Ago
New TerrainMaterial & TerrainStorage resources, rework creation of terrain, component custom editor, simple height blends and various QOL improvements New TerrainMaterial asset, can be used on multiple terrains, copied from other projects * Replaces TerrainData.TerrainLayer which used manual packed vtex files * Accepts source images for: albedo, normal, rough, ao, height * Compiles into 2 generated vtex_c * Contains other properties for metalness, uv scale, uv rotation * AssetPreview is used for editor UX too, instead of hacky shit before * TerrainMaterialEditor auto populates _normal _rough etc. properties from albedo * Drag drop TerrainMaterial assets into Terrain component * Open for expansion to grass/clutter properties TerrainStorage * Replaces TerrainData & TerrainDataFile * Make use of IJsonConvert to avoid all the crazy crap I was doing before * Drag drop TerrainStorage asset into scene * JsonUpgrader for TerrainData -> TerrainStorage, resmaples ^2+1 heightmaps to just ^2 Terrain component editor: * Support creating or linking TerrainStorage if none is attached * Split settings into its own tab * Add heightmap resampling for non pow2 heightmaps * Add import splatmap * Terrain creation no longer forced through GameObject menu, remove Hide attribute from Terrain component. * Remove special terrain save logic from SceneEditorSession, use scene.saved editor event * Texture streaming works properly * Basic height blend * Disable specular on terrain