Terrain component generates wrong number of blend textures

Description

The Terrain::getBlendTextureCount(uint8 numLayers) function returns a higher value than needed in some cases. It is defined as (numLayers-1)/4 +1, and this, for example, returns 2 for numLayers = 5 , where it should return 1.

Possible fix : change it to std::max(1, numLayers-2)/4+1), or just (numLayers-2)/4+1 if there is no need for a blend texture when there is only one layer.

Environment

All

Assignee

Unassigned

Reporter

Leonardo Scandolo

Labels

None

Components

Fix versions

Affects versions

Priority

Minor
Configure