fix depth clipping in perspective view

The depth range is now set slightly differently. Both ends of the range
are shifted for each layer to solve some precision issues.

Some layers draw multiple things at different depths. For example, fill
layers draw fills and antialiasing separately. To handle this case, I
added setDepthSublayer(n) which a
This commit is contained in:
Ansis Brammanis
2015-08-17 19:02:30 -04:00
parent 0d68c4fedf
commit 9e68e49c89
10 changed files with 33 additions and 34 deletions

View File

@@ -39,7 +39,7 @@ void TransformState::getProjMatrix(mat4& projMatrix) const {
matrix::rotate_z(projMatrix, projMatrix, getAngle());
matrix::translate(projMatrix, projMatrix, pixel_x() - getWidth() / 2.0f,
pixel_y() - getWidth() / 2.0f, 0);
pixel_y() - getHeight() / 2.0f, 0);
}
box TransformState::cornersToBox(uint32_t z) const {