View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0006238 | Spring engine | General | public | 2019-07-08 18:26 | 2019-07-11 20:32 | ||||
Reporter | gajop | ||||||||
Assigned To | Kloot | ||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Product Version | |||||||||
Target Version | Fixed in Version | 104.0 +git | |||||||
Summary | 0006238: $heightmap is rendered off-by-one? | ||||||||
Description | The $heightmap texture seems to have a wall in the y=0, x=maxX, as can be seen here: https://i.imgur.com/rlVxORv.jpg (notice the white lines in the bottom and right of the black & white image) PS: This was tested with 104.0.1-1239-g12caea1 maintenance because of https://github.com/springfiles/upq/issues/53 PSS: Relying on $heightmap when exporting the map results in weird issues like https://youtu.be/lHzrftvQN0E?t=2939 PSSS: I've fixed the SB issue with this commit https://github.com/Spring-SpringBoard/SpringBoard-Core/commit/a20ff6949436ecda6504a6d9ceb42d54585d984b , which feels like a hack. | ||||||||
Tags | No tags attached. | ||||||||
Checked infolog.txt for Errors | Yes | ||||||||
Attached Files |
|
Notes | |
Kloot (developer) 2019-07-08 19:27 Last edited: 2019-07-08 19:28 |
the texture stores grid corner heights, which is why it has dimensions (256+1)x(256+1). what are the actual heightmap values at (x=256,z=*) and (x=*,z=256)? |
gajop (developer) 2019-07-11 15:57 |
To answer your question: the heightmaps values at those coords are below zero. I did some more testing and here are the results of a slightly bigger map with the old engine (104.0.1-1239-g12caea1 maintenance): https://i.imgur.com/aazIeKT.jpg and my hacky fix: https://i.imgur.com/8QUIBsq.jpg . You can see that "my hacky fix" properly has everything as black, while the original version still shows the two lines as white (like the original values on load). my hacky fix version is based on https://github.com/spring/spring/commit/b98931fc9080d2ed36ee3b9f47d6b2121e9db61d + this change: diff --git a/rts/Map/HeightMapTexture.cpp b/rts/Map/HeightMapTexture.cpp index ab7089c036..d91d2316bc 100644 --- a/rts/Map/HeightMapTexture.cpp +++ b/rts/Map/HeightMapTexture.cpp @@ -68,8 +68,8 @@ void HeightMapTexture::UnsyncedHeightMapUpdate(const SRectangle& rect) if (texID == 0) return; - const int sizeX = rect.x2 - rect.x1 + 1; - const int sizeZ = rect.z2 - rect.z1 + 1; + const int sizeX = rect.x2 - rect.x1 + 2; + const int sizeZ = rect.z2 - rect.z1 + 2; pbo.Bind(); pbo.New(sizeX * sizeZ * sizeof(float)); PS: I made a mistake when writing the original report. I had issues with 104.0.1-1239-g12caea1 maintenance version, not 104.0.1-1290-g619a2a8.. |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2019-07-08 18:26 | gajop | New Issue | |
2019-07-08 19:27 | Kloot | Note Added: 0020016 | |
2019-07-08 19:28 | Kloot | Note Edited: 0020016 | View Revisions |
2019-07-11 15:57 | gajop | Note Added: 0020022 | |
2019-07-11 15:59 | gajop | Description Updated | View Revisions |
2019-07-11 15:59 | gajop | Checked infolog.txt for lua Errors | Yes => |Yes| |
2019-07-11 15:59 | gajop | Description Updated | View Revisions |
2019-07-11 15:59 | gajop | Checked infolog.txt for lua Errors | Yes => |Yes| |
2019-07-11 16:00 | gajop | Description Updated | View Revisions |
2019-07-11 16:00 | gajop | Checked infolog.txt for lua Errors | Yes => |Yes| |
2019-07-11 20:32 | Kloot | Assigned To | => Kloot |
2019-07-11 20:32 | Kloot | Status | new => resolved |
2019-07-11 20:32 | Kloot | Resolution | open => fixed |
2019-07-11 20:32 | Kloot | Fixed in Version | => 104.0 +git |