Skip to content

Rename View matrices in the form world_to_view, etc #8492

@JMS55

Description

@JMS55

Currently, the View uniform looks like this:

struct View {
    view_proj: mat4x4<f32>,
    unjittered_view_proj: mat4x4<f32>,
    inverse_view_proj: mat4x4<f32>,
    view: mat4x4<f32>,
    inverse_view: mat4x4<f32>,
    projection: mat4x4<f32>,
    inverse_projection: mat4x4<f32>,
    ...
};

There's been much confusion over which of these do what. It would be much better to call, for instance the projection matrix, view_to_clip. We could then put "This is the projection matrix" in a doc comment.

We could also use a doc comment for unjittered_view_proj vs view_proj. The unjittered matrix is basically only useful for calculating motion vectors for TAA, and is equivalent to the view_proj matrix when the motion vector prepass is disabled. Users shouldn't really need to touch the unjittered matrix ever.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-Code-QualityA section of code that is hard to understand or changeC-DocsAn addition or correction to our documentationD-TrivialNice and easy! A great choice to get started with Bevy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions