2
$\begingroup$

I know in computer graphic, we can set a world window in world coordinate system, and then mapping it to viewport which is the display window. Things that are not in the world window should not be displayed and we can do this through Clipping (like in OpenGL). I have a question that do we have alternative methods?

$\endgroup$
4
$\begingroup$

"Go not to the CG Elves for counsel for they will say both no and yes".

Yes and No. As noted in another post, these issues don't exist with ray tracing but I'll assume you are interested in standard rasterisation.

  • It's possible to dispose of near clipping by using homogeneous rendering but that can introduce additional cost. (e.g more expensive triangle set up, more difficulty in identifying which screen regions are covered in tile-based renderers)

  • You could eliminate XY clipping by using float representations for the X and Y coordinates in the rasteriser but that can lead to catastrophic cancellation when computing triangle determinants which, AFAICS, is a necessary step. In my experience, hardware rasterisers* usually work in fixed-point so that everything is 'exact'.

  • As a compromise to XY clipping, guard-band clipping was introduced so that clipping only needs to be done on triangles that extend a 'long'** way off screen. Culling, however, is still be done with the standard frustum planes to eliminate those that are trivially off-screen.

*Dreamcast being a notable exception.

**for certain definitions of 'long', e.g. a small integer multiple of the screen width/height.

$\endgroup$
  • $\begingroup$ Since comments were cleared theres nolonger a link. $\endgroup$ – joojaa Sep 22 '16 at 18:42
  • $\begingroup$ @joojaa even after the comment was auto-deleted, the linked question still shows in the "linked" section at the top right of this page. Since that's easy to miss I've added a comment with the link too. $\endgroup$ – trichoplax Sep 22 '16 at 22:16
  • $\begingroup$ I still don't know how I can deal with internal register overflow problem. For example, we adopt a world window whose x coordinate from 0~1023, that's a 10 digits binary. While scanning, a line whose x coordinates exceeds the 1023 will have more than 10 digits, then the extra part will be ignored, right? So this line will be display in 0~1023 area. How can I deal with this ? $\endgroup$ – zfb Sep 23 '16 at 4:00
  • $\begingroup$ @zfb Just as an aside, typically HW rasterisers will have, say, an additional 4 to 8 bits of sub-pixel precision to allow smoother animation. As for raster scanning, you'd only start/end on pixels inside the window. Out of curiosity are you writing a software rasteriser? $\endgroup$ – Simon F Sep 23 '16 at 8:11
  • $\begingroup$ I am still studying this, no creation... $\endgroup$ – zfb Sep 23 '16 at 13:20

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.