This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
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
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::LandscapeTextures Class

Header: #include <UnigineObjects.h>

This class is used to manage a fragment of terrain data on the GPU side (e.g. modify heights, albedo, or masks, etc.). Actually it represents a data container for a fragment of terrain area of the specified resolution. This class can be used, for example, when implementing GPU-based brushes.

LandscapeTextures Class

Members


Ptr<LandscapeTextures> create ( const Math::ivec2 & resolution ) #

Creates a new LandscapeTextures object to store the data for a terrain area of the specified resolution.

Arguments

  • const Math::ivec2 & resolution - Two-component vector containing texture resolution along X and Y axes.

Ptr<Texture> getHeight ( ) #

Returns height data as an R32F texture.

Return value

Texture (R32F) containing height data.

Ptr<Texture> getAlbedo ( ) #

Returns albedo data as an RGBA8 texture. Opacity data is stored in the alpha-channel.

Return value

Texture (RGBA8) containing albedo data.

Ptr<Texture> getMask ( int num ) #

Returns mask data as an RGBA8 texture.
Notice
Each detail mask can be represented by a single-channel texture. For optimization purposes detail mask data is stored in blocks - RGBA8 textures (each containing 4 masks, one mask per each channel). There are 5 blocks, as the terrain has 20 detail masks available. Thus, the data of the 9th detail mask shall be stored in the R-channel of the third block (index = 2).

Arguments

  • int num - Masks data block index.

Return value

Texture (RGBA8) containing mask data.

Ptr<Texture> getOpacityHeight ( ) #

Returns opacity information for height data as an R32F texture.

Return value

Texture (R32F) containing opacity information for height texture.

Ptr<Texture> getOpacityMask ( int num ) #

Returns opacity information for mask data as an RGBA8 texture.
Notice
Each mask can be represented by a single-channel texture. For optimization purposes opacity information for mask data is stored in blocks - RGBA8 textures (each containing 4 masks, one mask per each channel). There are 5 blocks, as the terrain has 20 detail masks available. Thus, the data of the 9th detail mask shall be stored in the R-channel of the third block (index = 2).

Arguments

  • int num - Masks data block index.

Return value

Texture (RGBA8) containing opacity information for mask data.

Ptr<Texture> get ( int type ) #

Returns the texture of the specified type.

Arguments

Return value

Texture of the specified type.

Ptr<RenderTarget> getRenderTarget ( ) #

Returns the render target containing terrain data.

Return value

Render target containing terrain data.

Math::ivec2 getResolution ( ) #

Returns the current texture resolution.

Return value

Two-component vector containing texture resolution along X and Y axes.

int getNumMipmaps ( ) #

Returns the total number of mipmaps for the textures (maximum value among all data layers).

Return value

Total number of mipmaps for the textures.

void createMipmaps ( ) #

Generates mipmaps for the textures of all data layers.

void clearBuffers ( ) #

Clears all levels of the textures of all data layers (fills all elements with 0-values).
Last update: 2021-04-09
Build: ()