Search Issue Tracker
By Design
Votes
0
Found in
2019.1
2019.1.14f1
2019.2
2019.3
2020.1
Issue ID
1190975
Regression
No
[Terrain] The function TerrainData.GetDetailLayer only returns 0 or 1
To reproduce:
1) Open the attached project and scene
2) Select Terrain in Hierarchy
3) Right Click Terrain Detail Density Exporter in the inspector and select "Do Test"
4) Notice only 0s and 1s are printed out
5) Paint some more grass on the terrain
6) Repeat step 3
Expected: More values should be output depending on the pixel
Actual: Only 0s and 1s are printed
Reproduced in 2019.1.0b1, 2020.1.0a8
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (2019.3.X):
The Detail layer data is stored as an integer in the range [0, 16].
(Don't ask, it's old code..)
So painting with a target strength of 0.0625 will store a value of 1.
If you paint with a target strength of 1.0, you will get 16.
If you want to convert to a texture, you should divide the returned value by 16.0.