Immediate-Mode Drawing with anamorphic camera
We are using Shapes to display rigging of a sailing boat, which is working great...
...The issue is that we are rendering an extremely anamorphic camera and need the Shape lines to reflect the camera projection matrix (i.e: We need the horizontal thickness to be different to the vertical thicknes for the lines; let's say a perfectly horizontal line is 10px wide, so a perfectly vertical line needs to be 4px wide [and a diagonal line is somewhere between the two]).
We are setting the anamorphic by using:
```cam.projectionMatrix = cam.projectionMatrix * Matrix4x4.Scale(new Vector3(0.4f, 1f, 1f));```
Is there a way to get the Shapes to respect (or emulate) this scaled camera projection matrix, so that the line thickness is drawn scaled anamorphically so that when the video output scale gets restored, the lines are not super thick horizontally.
Any advice would be appreciated.
Kind regards,
Adam.
I think your best bet right now is to use meter-based thickness of the lines instead of pixel based ones, if possible, in that case I don't think there should be any issues with scaling right?
Another option that might be a little too involved for now is to implement anisotropic pixel scaling in Shapes itself - I have recently been working with pixel based sizing (in a different project) and found a method of getting meters/pixel ratios that support anisotropic projection matrices, as well as just being more accurate in general. I think it wouldn't be too hard to implement it for me at least, once I get around to the next update!