bevy/crates/bevy_render/src/camera
Lixou 7c80ae7313
Add depth_ndc_to_view_z for cpu-side (#14590)
# Objective

I want to get the visual depth (after view proj matrix stuff) of the
object beneath my cursor.
Even when having a write-back of the depth texture, you would still need
to convert the NDC depth to a logical value.

## Solution

This is done on shader-side by [this
function](e6261b0f5f/crates/bevy_pbr/src/render/view_transformations.wgsl (L151)),
which I ported over to the cpu-side.

I also added `world_to_viewport_with_depth` to get a `Vec3` instead of
`Vec2`.

---

If anyone knows a smarter solution to get the visual depth instead of
going `screen -> viewport ray -> screen`, please let me know :>
2024-08-02 15:37:29 +00:00
..
camera_driver_node.rs RenderGraph Labelization (#10644) 2024-01-31 14:51:19 +00:00
camera.rs Add depth_ndc_to_view_z for cpu-side (#14590) 2024-08-02 15:37:29 +00:00
clear_color.rs Allow mix of hdr and non-hdr cameras to same render target (#13419) 2024-06-06 20:55:05 +00:00
manual_texture_view.rs
mod.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
projection.rs Normalise matrix naming (#13489) 2024-06-03 16:56:53 +00:00