I want to revert a homogeneous transformation after performing a perspective division. To be more specific, I’m implementing a GPU-based voxelization algorithm using conservative rasterization. For an overview, these are the steps I’ve implemented so far (VS=vertex shader, GS=geometry shader):
- Apply the model transform to the vertices (VS).
- Apply an orthographic projection transform to a copy of each vertex (GS).
- Apply a view transform to the copies (GS).
- Perform a perspective division on the copies (GS).
- Translate the copied vertices based on screen coordinates (GS).
Next, I want to revert the view transform from (3) and transform the vertices with a different view matrix. Now, my question is whether it’s as easy as applying the inverse view matrix? Do I need to worry about the homogeneous coordinates at all when I only work with orthogonal projections and affine (rotation, translation, scaling) transformations? It seems to me that only with the normal transformations I need to worry about it since the transposed inverse is not an affine transformation. I could neither find a web resource on this topic nor a counter example, so I’m asking here.