I have the following projection matrix: Projection matrix overview

Projection matrix formula

and I need to make a hole in the center of my matrix, something like that: (I don't want to project a custom W and H) Example of projection matrix wihout center

Is that possible ? Thanks.


1 Answer 1


It's not possible to cut a hole in the image by altering the projection matrix, no. However, you can mask out rendering in that region by using the depth test or stencil test.

For example, before rendering your scene, you could render a depth-only quad at the near plane to define the excluded region. Then any subsequent rendering will be clipped to outside of that region, because it will fail the depth test. The region doesn't have to be a rectangle with this approach, either; it can be any shape.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.