ScratchData LogoScratchData
Back to TheLogFather's profile

Raster 'ghosted' penta-fill performance test

THTheLogFather•Created May 9, 2015
Raster 'ghosted' penta-fill performance test
129
90
5361 views
View on Scratch

Description

This is to go along with the ghosted tri-fill and quad-fill projects. The reason ghosted pentagons are needed as well as tris & quads is that it's possible for only part of a 3d quad to be in front of the viewer. To make the quad look right, it needs 'clipping' at some minimum distance - and that can turn it into a pentagon... The new pen alpha feature allows drawing with semi-transparency. However, it's not easy to get a uniform transparency because of the 'overlap problem' - if you draw over the same region twice, you get 'double-strength' opacity. The penta-fill here uses a rastering method to draw only horizontal lines that don't overlap each other, thus ensuring a uniform fill. The inner loop contains lots of logic to deal with non-convex cases, hence the rather poor performance compared to tris/quads... :(

Project Details

Project ID61355912
CreatedMay 9, 2015
Last ModifiedMay 9, 2015
SharedMay 9, 2015
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root