Log In  

Cart #19009 | 2016-02-28 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

I wanted to try this since a long time:
The scenery polygons are rendered as a list of line segment for every line of the screen. { { x, z, color }, { x, z, color }, ... }
No need to sort anything because polygons are inserted in every line raster with z test (making previous segments moved or deleted inside every lines)
it takes less than 0.3 of the frame to draw this frame rasterized buffer even if it is quite complex.
Then dynamic model polygons are drawn on the top of it with z test.
I'm quite happy with the result, now I need to try more complex models...

This is just a demo yet. (It still has annoying bugs)

P#19010 2016-02-28 10:08 ( Edited 2016-02-28 18:28)

Hi FRedShift,

This is incredible. So you essentially pre-render the scenery and store the Z values for each pixel (or each line of pixels) and then you use this to mask the dynamic polygons that are in front of it? (And I realize that I just paraphrased your description completely...) Very very cool.

P#19013 2016-02-28 12:33 ( Edited 2016-02-28 17:33)

Hi electricgryphon, more precisely, not each pixel got a z but a segment of same color pixels (it is not completly accurate then) and drawing the buffer on screen would be very long. if you press C and up/down you can see my debug line showing the content of one line. a list of horizontal segments.

P#19016 2016-02-28 13:28 ( Edited 2016-02-28 18:28)

[Please log in to post a comment]