Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Xorcist

What is the easiest way to implement scanlines?

This topic is 6075 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Guest Anonymous Poster
I''d use the hardware to do it. (Monitor)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You have a structure of lists of buckets. So you have a list of polygons to render for each scanline or pixel-line.

After you do the final transformation to get your polygons into screen space. You place each polygon into its respective bucket list. To determine how a polygon gets placed into a bucket is the determined by the polygons highest y (height/pixel) value, it is in screen space. You may have a hash function that does the appropriate math to get the actual pixel value. Once you have all your scenes polygons into buckets you then start at the top of the screen..scanline 0 and start drawing. For each scanline you place its entire bucket into an active draw list. You then traverse this list to draw your scene. When a polygon is done being drawn it is removed from this active list. To draw a polygon you must keep track of the incremental values down the lengths of the polygon.

You can put the resultant image data into a Bitmap or RGB image very easily. Those file formats are really easy.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!