Giter Site home page Giter Site logo

Comments (3)

Speak2Erase avatar Speak2Erase commented on June 12, 2024

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 RenderPass::set_viewport to set the region where custom paint callbacks are drawn on the screen.
This is both a curse and a blessing because it means that if we decide to draw things like events inside luminol_graphics::MapView we'll need to set the viewport ourselves, but it also means that we can effectively ditch Viewport (for events)

from luminol.

white-axe avatar white-axe commented on June 12, 2024

We can still get rid of the projection matrix for Viewport though because, as far as I know, every single Viewport projection matrix we currently use is created using glam::Mat4::orthographic_rh, and that function just generates a matrix that represents some combination of translation and scaling (no rotations, shearing or other weird stuff). That can be reduced to just passing to the shader the translation as vec2<f32> and the scale as vec2<f32> instead of using a matrix.

from luminol.

Speak2Erase avatar Speak2Erase commented on June 12, 2024

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

from luminol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.