mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 06:19:19 +02:00
Heightmap terrain: .tch chunk packs, streaming with LOD, terrain painting, water and modifiers - terrain/<name>/terrain.yaml + <px>_<pz>.tch packs of 16x16 chunks (250 m, 0.5/1/2/5 m spacing), slices with crc-32 and optional zstd (vendored zstd 1.5.6 in ref/zstd) - heightmap_terrain [name] endheightmap_terrain directive replaces editorterrain - streamer: worker threads, camera + look-ahead loading, geomipmap LOD with skirts, pooled geometry - mat_terrain shader: up to 8 painted layer materials per chunk via texture arrays (opengl33); other renderers fall back to the dominant material - water bodies (outline + level), terrain modifiers (vertical profile shaping kept non-destructive) - F11 Terrain work mode rebuilt: chunks, sculpt, smooth, paint, point spacing, water tools
This commit is contained in:
@@ -640,6 +640,28 @@ material_manager::create( std::string const &Filename, bool const Loadnow ) {
|
||||
return materialhandle;
|
||||
};
|
||||
|
||||
material_handle
|
||||
material_manager::create_from_text( std::string const &Name, std::string const &Definition ) {
|
||||
|
||||
opengl_material material;
|
||||
cParser materialparser( Definition, cParser::buffer_TEXT );
|
||||
if( false == material.deserialize( materialparser, true ) ) {
|
||||
return null_handle;
|
||||
}
|
||||
material.name = Name;
|
||||
try {
|
||||
material.finalize( true );
|
||||
}
|
||||
catch( gl::shader_exception const &e ) {
|
||||
ErrorLog( "invalid shader: " + std::string( e.what() ) );
|
||||
return null_handle;
|
||||
}
|
||||
auto const materialhandle { static_cast<material_handle>( m_materials.size() ) };
|
||||
m_materials.emplace_back( std::move( material ) );
|
||||
// not listed under its name: the name isn't a file which could be asked for
|
||||
return materialhandle;
|
||||
}
|
||||
|
||||
void
|
||||
material_manager::on_weather_change() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user