-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Viewport transformation efficiency #98
Comments
I'm honestly not sure how to solve this one? Viewports are currently projection matrices from model space (coordinates for vertices relative to each other) to clip space (position on the screen) The way they're currently implemented, they actually don't do a lot for us, because egui calls |
We can still get rid of the projection matrix for |
I think what I'll do is split viewport into the region on the screen being drawn to (shared between things drawn in the samw region), and any transformations being applied to what's being drawn This is how 3d usually works (there's a transformation matrix that applies rotation, scaling, and translation to an object) and a projection matrix which applies perspective and normalizes coordinates to fit in clip space |
Is your feature request related to a problem? Please describe.
Luminol's shaders have a 4D viewport transformation matrix. This is totally unnecessary because all we ever do to the viewport is translate and scale it.
Describe the solution you'd like
Replace the 4D viewport matrices with two
vec2<f32>
s: one that represents the position of the viewport and another that represents the scale along the X- and Y-axes.Describe alternatives you've considered
If we need to do more than just translations and scaling to the viewport, we can use a 3D transformation matrix instead of a 4D one. A 3D transformation matrix is enough to encode any 2D affine transformation, a 4D transformation matrix is only required for 3D affine transformations.
The text was updated successfully, but these errors were encountered: