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.
hmm, that's a tricky one, I don't think there's a way to get this to work out of the box, but there might be modifications to the shaders that would do it by applying a non-uniform scaling factor to any billboarded/clip space offsets, but I'm not sure if even those might have some unforeseen consequences
I'm kinda curious though - what's the reason you're scaling the projection matrix like this/emulating an anamorphic lens? I would've expected this to introduce a lot of artifacts and issues once you restore it to the output aspect ratio