3 ms·
> clipping against the near plane (hopefully rare in practice) I am not sure I understand why this would be rare. If I am intending to construct a rasterizer f
by bob1029 4y ago
> clipping against the near plane (hopefully rare in practice)
I am not sure I understand why this would be rare. If I am intending to construct a rasterizer for a first-person shooter, clipping is essentially mandatory for all but the most trivial of camera arrangements.
- bpye 4y agoClipping or culling? I expect it’s mostly the latter unless your camera ends up intersecting the geometry.
- bob1029 4y agoBoth. You almost always need both. Clipping deals with geometry that is partially inside the camera. Culling (either for backfaces or entire instances) is a preliminary performance optimization that can be performed in a variety of ways.
- royjacobs 4y agoAs an example, if you're writing a shooter then the floor might be a large square that will almost definitely be intersecting the near plane. You absolutely need clipping here.
- bob1029 4y agoThis is precisely the first place I realized I needed proper clipping. Wasted many hours trying to hack my way out of doing it the right way.
- Jasper_ 4y agoYes, of course, I was definitely imagining you were struggling to get simpler scenes to work. But also, proportionally few of your triangles in any given scene should be near-plane clipped. It's OK to have a slow path for it, and then speed it up later. I've never felt the math for the adjusted barycentrics is too hard, but it can take a bit to wrap your head around. Good luck :)
- Sharlin 4y agoYou and the GP have different rasterization algorithms in mind I think. The GP, I presume, is talking about a classic scanline-based rasterizer rather than an edge function "am I inside or not" type rasterizer that GPUs use.