How to change far clipping plane depth. #2875
-
Hello! I'm wondering how to change or set an arbitrary clipping plane depth. The only thing I found while searching online (as well as in the documentation) is implementing an oblique view frustum. Given that wgpu already has a value set, I think it's plausible you can change it. In short, polygons are clipped when far enough away from the "camera". |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm not sure I've understood your question, but normally, controlling the Z/depth clipping range is done by using via the projection matrix (or simpler arithmetic) in your vertex shader. Most graphics libraries that construct a projection matrix for you, will let you select the “near” and “far” distance to be clipped; these are the If that doesn't help, can you clarify what you're looking for by providing the code you've got so far and maybe drawings of what difference you want? |
Beta Was this translation helpful? Give feedback.
I'm not sure I've understood your question, but normally, controlling the Z/depth clipping range is done by using via the projection matrix (or simpler arithmetic) in your vertex shader. Most graphics libraries that construct a projection matrix for you, will let you select the “near” and “far” distance to be clipped; these are the
znear
andzfar
variables seen in the learn-wgpu tutorial).If that doesn't help, can you clarify what you're looking for by providing the code you've got so far and maybe drawings of what difference you want?