Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I started this work to fix #622, as reported by @Akkete. This was a graphical glitch that showed gaps between clone tiles when using a look-at camera.
As expected, the issue was simply a rounding error which I replicated in the test scene in this PR, and then fixed.
However, while I was doing that I also noticed that
LookAt
camera's were behaving weirdly when you have different levels of magnification going. Essentially, layers are all rendered at 1:1 and then stretched up to the right size (this helps give nice crisp pixels and reduce's rendering requirements quadratically) and so the projection matrices were being calculated with a magnification of 1 irrespective of what the layer / scene update fragment had to say. This works fine for fixed cameras, but look-at camera's need the real magnification for their matrix calculations.No doubt this just slipped the testing net in days of old, and I haven't used a look-at camera since. It happens. 😬
I've fixed both issues at once, and tested this in a variety of combinations (this time...), including WebGL 1. The solution is a bit... ugly. The
CameraHelper
should probably be refactored. It currently manages to produce the projection matrix for several possible scenario's at once, and is a bit spaghetti-like... but it works.