This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Landscape Tool
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
内容优化
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::LandscapeMapFileCompression Class

Header: #include <UnigineObjects.h>

Landscape Map File Compression class is used to compress and decompress .lmap file data using Zlib, LZ4, or Unigine's compression algorithm. The latter provides better compression results for 2D and 3D textures than LZ4 and Zlib without quality reduction.

LandscapeMapFileCompression Class

Enums

COMPRESSOR_TYPE#

NameDescription
COMPRESSOR_TYPE_NONE = 0No compression is used.
COMPRESSOR_TYPE_JACKALLESS = 1Our Method compression is used. It is optimized for compressing 2D and 3D textures and provides better results than LZ4 and Zlib without deteriorating the quality.
COMPRESSOR_TYPE_LZ4 = 2LZ4 compression is used (temporary option, planned to be removed in the upcoming releases).
COMPRESSOR_TYPE_ZLIB = 3Zlib compression (can provide up to 2 times higher compression ratio, but takes up to 20 times longer).

Members


LandscapeMapFileCompression ( ) #

Constructor.

bool isCompressing ( ) const#

Returns the value indicating if the compression is in progress.

Return value

true if the compression is running; otherwise, false.

bool isDecompressing ( ) const#

Returns the value indicating if the decompression is in progress.

Return value

true if the decompression is running; otherwise, false.

int getProgress ( ) const#

Returns the current landscape map file compression progress.

Return value

Current landscape map file compression progress (percentage).

bool run ( bool decompress, bool is_safe ) #

Runs the landscape map file compression/decompression process.

Arguments

  • bool decompress - true — the landscape map file will be decompressed, false — the landscape map file will be compressed.
  • bool is_safe - true to make the Engine automatically call filesClose()/fileOpen() methods when performing operations (before modifying an .lmap file the Engine should release files via filesClose(), while after modification fileOpen() should be called), false — to call filesClose()/fileOpen() methods manually.

    The Landscape class has two overloads for the filesClose() method:

    • filesClose() — to be called in case of moving an .lmap file (no data reloading is performed as the file itself was not modified — saves time on reloading data)
    • filesClose(reload_files) — to be called in case of deleting or modifying an .lmap file.
    Notice
    When is_safe = true the Engine shall always call filesClose(reload_files) with complete data reloading.

Return value

true if the operation is successful; otherwise, false.

void stop ( ) #

Stops the landscape map file compression/decompression process.

bool isLoaded ( ) const#

Returns a value indicating if the landscape map file (.lmap) is loaded.

Return value

true if the .lmap is loaded; otherwise, false.

bool load ( const UGUID& guid ) #

Loads the landscape map file (.lmap) having the specified GUID.

Arguments

  • const UGUID& guid - GUID of the landscape map file (.lmap) to be loaded.

Return value

true if the operation is successful; otherwise, false.

void setHeightCompressor ( LandscapeMapFileCompression::COMPRESSOR_TYPE compressor ) #

Sets the type of the compressor used for height data compression.

Arguments

LandscapeMapFileCompression::COMPRESSOR_TYPE getHeightCompressor ( ) const#

Returns the current type of the compressor used for height data compression.

Return value

Compressor type:
  • 0 – None
  • 1 – Our Method
  • 2 – LZ4
  • 3 – Zlib

void setAlbedoCompressor ( LandscapeMapFileCompression::COMPRESSOR_TYPE compressor ) #

Sets the type of the compressor used for albedo data compression.

Arguments

LandscapeMapFileCompression::COMPRESSOR_TYPE getAlbedoCompressor ( ) const#

Returns the current type of the compressor used for albedo data compression.

Return value

Compressor type:
  • 0 – None
  • 1 – Our Method
  • 2 – LZ4
  • 3 – Zlib

void setOpacityHeightCompressor ( LandscapeMapFileCompression::COMPRESSOR_TYPE compressor ) #

Sets the type of the compressor used for compression of the opacity height data.

Arguments

LandscapeMapFileCompression::COMPRESSOR_TYPE getOpacityHeightCompressor ( ) const#

Returns the current type of the compressor used for compression of the opacity height data.

Return value

Compressor type:
  • 0 – None
  • 1 – Our Method
  • 2 – LZ4
  • 3 – Zlib

void setMaskCompressor ( int mask, LandscapeMapFileCompression::COMPRESSOR_TYPE compressor_type ) #

Sets the type of the compressor used for the specified mask.

Arguments

void setMaskOpacityCompressor ( int mask, LandscapeMapFileCompression::COMPRESSOR_TYPE compressor_type ) #

Sets the type of the compressor used for the opacity data of the specified mask.

Arguments

void setCompressorAll ( LandscapeMapFileCompression::COMPRESSOR_TYPE compressor_type ) #

Sets the type of the compressor used to compress all data.

Arguments

bool isCompressed ( ) const#

Returns the value indicating if the .lmap file is compressed.

Return value

true if the file is compressed; otherwise, false.

int getMaskCompressor ( int mask ) #

Returns the current type of the compressor used for the specified mask.

Arguments

  • int mask - Mask number.

Return value

Compressor type:
  • 0 – None
  • 1 – Our Method
  • 2 – LZ4
  • 3 – Zlib

int getMaskOpacityCompressor ( int mask ) #

Returns the current type of the compressor used for the opacity data of the specified mask.

Arguments

  • int mask - Mask number.

Return value

Compressor type:
  • 0 – None
  • 1 – Our Method
  • 2 – LZ4
  • 3 – Zlib

void setEnabledAlbedoTextureCompression ( bool compression ) #

Sets the albedo texture compression enabled or disabled.

Arguments

  • bool compression - true to enable albedo texture compression; otherwise, false.

bool isEnabledAlbedoTextureCompression ( ) const#

Returns the value indicating if the albedo texture compression is enabled.

Return value

true if the albedo texture compression is enabled; otherwise, false.

void setEnabledOpacityHeightTextureCompression ( bool compression ) #

Sets the compression of the opacity height texture enabled or disabled.

Arguments

  • bool compression - true to enable compression of the opacity height texture; otherwise, false.

bool isEnabledOpacityHeightTextureCompression ( ) const#

Returns the value indicating if the compression of the opacity height texture is enabled.

Return value

true if the compression of the opacity height texture is enabled; otherwise, false.

void setEnabledMaskTextureCompression ( int mask, bool enable ) #

Enables or disables compression of the specified mask texture.

Arguments

  • int mask - Mask number.
  • bool enable - true to enable the mask texture compression; otherwise, false.

void setEnabledMaskOpacityTextureCompression ( int mask, bool enable ) #

Enables or disables compression of the specified mask opacity texture.

Arguments

  • int mask - Mask number.
  • bool enable - true to enable the compression of the mask opacity texture; otherwise, false.

bool isEnabledMaskTextureCompression ( int mask ) #

Returns a value undicating if the mask texture compression is enabled.

Arguments

  • int mask - Mask number.

Return value

true if the mask texture compression is enabled; otherwise, false.

bool isEnabledMaskOpacityTextureCompression ( int mask ) #

Returns the value indicating if the compression of the mask opacity texture is enabled.

Arguments

  • int mask - Mask number.

Return value

true if the mask opacity texture compression is enabled; otherwise, false.

UGUID getGUID ( ) const#

Returns a GUID of the .lmap file containing landscape map data.

Return value

GUID of the .lmap file.

void setCacheDirectory ( const char * directory ) #

Sets a path to the directory that is used to store the cache. By default the cache is located in the same place where the UnigineEditor's cache is (you can find it in the UnigineEditor Settings tab). If there is not enough memory, you can use another disk. A full copy of the current terrain will be temporarily stored in the cache directory, so you should take this into account when estimating the cache size. SSD is recommended for fast data copying.

Arguments

  • const char * directory - The path to the directory that stores the cache.

const char * getCacheDirectory ( ) const#

Returns the current path to the directory that is used to store the cache.

Return value

The path to the directory that stores the cache.
Last update: 2022-03-10
Build: ()