|
-
Senior Member
 Originally Posted by realMakc
Ah, but with K = 0.5 this is no problem, right (except that you should perhaps add few pixels to compensate for rounding errors and ensure that walls overlap (better than occasional 1px gaps))... so why dont you treat 1st and last items in hciStartQueue (?, I mean first and last pixel spans in a row) as if there was K = 0.5 set for them, and subdivide them in thin strips? frame rate will drop, but not that much as if K was always 0.5
Hehe someone has been digging in the code. Yes, the rasterization is essentially perfect for K=0.5. (You could actually simplify the code quite a bit if you used K=0.5 all the time, but picking bigger K is what makes the code faster). The thickness of the ink was controlled by K, so at small K you got thinner lines. But I think that got clobbered in a refactor (the inking functionality was moved out of the TextureMapper and into a new "Inker" module, and I forgot to make inkwidth depend on K).
I did try something like you are suggesting. Instead of refining K near the edges, I drew the first & last spans as little trapezoids that aligned correctly with the edge of the polygon. It was buggy, but it looked good and the bugs could've been fixed. However it also exposed another problem that would take another pile of code to fix. When you're drawing a strip of wall that's supposed to be occluded by tip of a brush, you need to chip a little bite out of the middle of a span, otherwise you will overwrite this tip, and sort of chamfer it off. You could always try painters algorithm, draw the wall first and the brush later so that you don't overwrite its corners, but that's a significant change and might have performance penalities.
Both of these problems could be fixed, no doubt, but I did not want to throw so much code at the problem. Even getting the ends drawn correctly was a significant change to TextureMapper and the ClippingItem classes, I expect coding around that overwrite/chamfer case would require even more substantial changes. The strips that you are drawing can end up with funky shapes. I can pm the code that I have for it if you'd like to take a stab at it, but me=lazy and thicker ink=easy fix.
 Originally Posted by realMakc
I could help you set up google code stuff if you are that technology-friendly 
I have another project in the fire, maybe I can take you up on that offer once I get back around to this code again (estimate mid-march).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|