Fix render pass viewport in custom_shader example
This commit is contained in:
parent
5195a59e20
commit
56bb4ce721
2 changed files with 18 additions and 16 deletions
|
|
@ -33,9 +33,7 @@ pub const OPENGL_TO_WGPU_MATRIX: glam::Mat4 = mat4(
|
|||
|
||||
impl Camera {
|
||||
pub fn build_view_proj_matrix(&self, bounds: Rectangle) -> glam::Mat4 {
|
||||
//TODO looks distorted without padding; base on surface texture size instead?
|
||||
let aspect_ratio = bounds.width / (bounds.height + 150.0);
|
||||
|
||||
let aspect_ratio = bounds.width / bounds.height;
|
||||
let view = glam::Mat4::look_at_rh(self.eye, self.target, self.up);
|
||||
let proj = glam::Mat4::perspective_rh(
|
||||
self.fov_y,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue